clang 8, lldClangStdenv: Get LLVM's unwind working properly

Backport the `--unwindlib` flag, so it don't try to use libgcc on Linux
for hysterical reasons. The alternative of passing `-lunwind` always
would mess up C.
This commit is contained in:
John Ericson
2019-04-12 13:19:48 -04:00
committed by Matthew Bauer
parent d453273fbf
commit 6794b01658
4 changed files with 538 additions and 1 deletions
@@ -97,11 +97,13 @@ let
targetLlvmLibraries.libcxx
targetLlvmLibraries.libcxxabi
targetLlvmLibraries.compiler-rt
targetLlvmLibraries.libunwind
];
extraBuildCommands = ''
echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags
echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
'' + mkExtraBuildCommands cc;
};