From 793e6f6a01d8cd4ef5d9190ce9aa911fb8c480f4 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 24 Apr 2017 17:00:40 -0400 Subject: [PATCH] Created Troubleshooting Build Issues (markdown) --- Troubleshooting-Build-Issues.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Troubleshooting-Build-Issues.md diff --git a/Troubleshooting-Build-Issues.md b/Troubleshooting-Build-Issues.md new file mode 100644 index 0000000..a475184 --- /dev/null +++ b/Troubleshooting-Build-Issues.md @@ -0,0 +1,19 @@ +### Troubleshooting + +If you get one of these: + +``` +undefined reference to `_ZNK4llvm17SubtargetFeatures9getStringB5cxx11Ev' +undefined reference to `llvm::SubtargetFeatures::getString() const' +``` + +This is because of +[C++'s Dual ABI](https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html). +Most likely LLVM was compiled with one compiler while Zig was compiled with a +different one, for example GCC vs clang. + +To fix this, you have 2 options: + + * Compile Zig with the same compiler that LLVM was compiled with. + * Add `-DZIG_LLVM_OLD_CXX_ABI=yes` to the cmake configure line. +