title: Why does llvm-config disables exceptions for me?
body: <p>I was compiling a code using LLVM and it failed compiling:</p>
  <pre><code>In file included from main.cpp:8:
  In file included from /usr/lib/llvm-12/include/llvm/IR/LLVMContext.h:19:
  In file included from /usr/lib/llvm-12/include/llvm/Support/CBindingWrapping.h:17:
  /usr/lib/llvm-12/include/llvm/Support/Casting.h:309:7: error: cannot use 'throw' with exceptions disabled
        throw runtime_error(&quot;Address sanitizer is not turned on.&quot;);
        ^
  </code></pre>
  <p>I realized my <code>llvm-config</code> is disabling the exceptions for me.</p>
  <pre><code>llvm-config-12 --cxxflags --ldflags --system-libs --libs core
  </code></pre>
  <p>Returns</p>
  <pre><code>-I/usr/lib/llvm-12/include -std=c++14   -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
  -L/usr/lib/llvm-12/lib 
  -lLLVM-12
  </code></pre>
  <p>In the past, I was not observing <code>-fno-exceptions</code> at all. A typical example should look like <a href="https://www.rubydoc.info/gems/ruby-llvm/LLVM/CONFIG" rel="nofollow noreferrer">this</a>.</p>
  <p>Where does this exception prevention come from?</p>