forked from OSchip/llvm-project
Fix passing stdc++ correctly in the FreeBSD toolchain support, Credit to Roman Divacky.
llvm-svn: 89205
This commit is contained in:
parent
fb4ff27367
commit
c14422223b
|
@ -2609,6 +2609,8 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
// FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding
|
||||
// the default system libraries. Just mimic this for now.
|
||||
CmdArgs.push_back("-lgcc");
|
||||
if (D.CCCIsCXX)
|
||||
CmdArgs.push_back("-lstdc++");
|
||||
if (Args.hasArg(options::OPT_static)) {
|
||||
CmdArgs.push_back("-lgcc_eh");
|
||||
} else {
|
||||
|
@ -2638,10 +2640,6 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
else
|
||||
CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath(C, "crtendS.o")));
|
||||
CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath(C, "crtn.o")));
|
||||
// FIXME: g++ is more complicated here, it tries to put -lstdc++
|
||||
// before -lm, for example.
|
||||
if (D.CCCIsCXX)
|
||||
CmdArgs.push_back("-lstdc++");
|
||||
}
|
||||
|
||||
const char *Exec =
|
||||
|
|
Loading…
Reference in New Issue