title: Compilation failing on EnableABIBreakingChecks
body: <p>I recently installed LLVM v8.0.0 (on RHEL 7.4). I am going through the <a href="https://llvm.org/docs/tutorial/LangImpl02.html" rel="noreferrer">LLVM Kaleidoscope tutorial</a> to learn how to use the system, but am running into an issue linking.</p>
  
  <p>Per the tutorial (<a href="https://llvm.org/docs/tutorial/LangImpl02.html#full-code-listing" rel="noreferrer">end of chapter 2</a>), I run:</p>
  
  <pre><code>clang++ -g -O3 kld.cpp `llvm-config --cxxflags` -o kld
  </code></pre>
  
  <p>It compiles, but the linker fails on:</p>
  
  <pre><code>/tmp/kld-f7264f.o:(.data+0x0): undefined reference to `llvm::EnableABIBreakingChecks'
  clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>I suspected this may have been an issue with <code>llvm-config</code>, so I also tried using the <code>--ldflags</code> and <code>--system-libs</code> flags, but no luck.</p>
  
  <p><code>llvm-config --cxxflags</code> gives (reformatted for readability)</p>
  
  <pre><code>-I~/project/llvm-src/include -I~/project/llvm-build/include 
  -fPIC -fvisibility-inlines-hidden
  -std=c++11
  -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual
  -Wno-missing-field-initializers -pedantic -Wno-long-long
  -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment
  -g 
  -fno-exceptions -fno-rtti
  -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS
  -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
  </code></pre>
  
  <p>Where <code>~/...</code> is just the path to my home directory (edited for privacy; the actual output is a fullpath). I am working on a shared system that requires I install new software locally.</p>
  
  <p>The tutorial code never references ABI explicitly, so I assume this must be some kind of compiler-flags issue. <code>grep</code>ing for the missing symbol in non-binary files gives an <code>extern</code> declaration in <code>include/llvm/Config/abi-breaking.h</code> and the real declaration in <code>lib/Support/Error.cpp</code>:</p>
  
  <pre><code>#if LLVM_ENABLE_ABI_BREAKING_CHECKS
  int EnableABIBreakingChecks;
  #else
  int DisableABIBreakingChecks;
  #endif
  </code></pre>
  
  <p>I thought I would try re-compiling, then, with <code>-DLLVM_ENABLE_ABI_BREAKING_CHECKS</code>. That also does that work.</p>
  
  <p>I'm not really clear what the ABI breaking checks are doing in the first place, and this may be way over my C++ comfort level. But how can I silence this error, if I don't need the referenced functionality; or fix it, if i do?</p>
  
  <p>Thanks.</p>