void-packages/srcpkgs/llvm/files/patches/cfe/cfe-008-remove-lgcc-when-using-compiler-rt.patch
Christian Neukirchen 6fb80ee39c clang++: revert to --rtlib=libgcc
We previously patched clang to default to --rtlib=compiler-rt, but
this caused problems; revert to upstream default.

Change cfe-008-remove-lgcc-when-using-compiler-rt to only remove
-lgcc_s (which is superseded by compiler-rt), but keep -lgcc_eh which
is required for unwinding; else -lgcc_s is searched for -static
builds, causing failure.

This should fix build of C++ programs using exceptions on both glibc
and musl, and also should fix using --rtlib=compiler-rt on these
platforms.

Closes #2042.
2015-08-11 14:11:11 +02:00

11 lines
446 B
Diff

--- lib/Driver/Tools.cpp 2015-08-11 13:59:22.324639527 +0200
+++ lib/Driver/Tools.cpp 2015-08-11 13:59:34.058576064 +0200
@@ -2158,8 +2158,6 @@
CmdArgs.push_back(Args.MakeArgString(getCompilerRT(TC, "builtins")));
if (!TC.getTriple().isOSWindows()) {
- // FIXME: why do we link against gcc when we are using compiler-rt?
- CmdArgs.push_back("-lgcc_s");
if (TC.getDriver().CCCIsCXX())
CmdArgs.push_back("-lgcc_eh");
}