diff --git a/Troubleshooting-Build-Issues.md b/Troubleshooting-Build-Issues.md index eec513c..35a1e5c 100644 --- a/Troubleshooting-Build-Issues.md +++ b/Troubleshooting-Build-Issues.md @@ -1,6 +1,6 @@ -### Troubleshooting +# Troubleshooting -#### Dual-Abi Linking +## Dual-Abi Linking If you get one of these: @@ -16,33 +16,28 @@ different one, for example GCC vs clang. LLVM, Clang, and Zig must all be compiled with the same C++ compiler. -#### Arch Linux +## Arch Linux, Gentoo, Fedora 32+ -The Clang package distributed via official Pacman sources isn't built with static libraries, -therefore, it is not possible to statically link against individual Clang libs. Instead, one -should link against the shared lib `libclang-cpp.so`. Thus, when building on Archlinux, you -need to pass `ZIG_PREFER_CLANG_CPP_DYLIB` flag set to true like so: +The Clang packages in these distributions do not contain static libraries, which Zig tries to use by default. +Instead, one should link against the shared lib `libclang-cpp.so`. + +For building stage1, set `ZIG_PREFER_CLANG_CPP_DYLIB`: ``` cmake .. -DZIG_PREFER_CLANG_CPP_DYLIB=true ``` +For building stage2, pass `-Dstatic-llvm=false` to Zig. -#### Gentoo - -Like Arch Linux' clang package, Gentoo's Clang is built without static libraries, so you'll need to pass `-DZIG_PREFER_CLANG_CPP_DYLIB=true` to cmake. +## Gentoo If you get the message `: CommandLine Error: Option 'mc-relax-all' registered more than once!`, you're affected by the issue discussed in https://reviews.llvm.org/D75579. The fix has not (yet?) been included in clang 10.0.1. As a workaround, you can build clang with the line `add_clang_subdirectory(handle-llvm)` removed from clang/tools/clang-fuzzer/CMakeLists.txt. Additionally, you'll need lld's .a and .h files, which aren't installed by Gentoo's lld ebuild, so you'll need to modify your lld ebuild file to not delete them. -#### Fedora 32+ - -Starting with version 32, Fedora will no longer ship individual component libraries in the `clang-libs` package instead requiring users to link against `libclang-cpp.so`. Thus when building on Fedora version 32 or greater you'll need to pass `-DZIG_PREFER_CLANG_CPP_DYLIB=true` to cmake. - -#### Ubuntu/Debian +## Ubuntu/Debian The LLVM repositories/packages are listed at https://apt.llvm.org/. The following packages that are not listed must be installed: `liblld-12-dev`, `libclang-12-dev` (as well as at least `libllvm12` from the listed packages). -### Still not working? +## Still not working? Log on to one of the [[Community]] spaces and ask for help. \ No newline at end of file