Sort -lgcc after -lgcc_s for NetBSD, otherwise shared libraries on i386

may pick it up. This would create bad text relocations.

llvm-svn: 132736
This commit is contained in:
Joerg Sonnenberger 2011-06-07 23:39:17 +00:00
parent c85e0d81e4
commit 87717773e2
1 changed files with 1 additions and 1 deletions

View File

@ -3751,7 +3751,6 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
} }
// FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding // FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding
// the default system libraries. Just mimic this for now. // the default system libraries. Just mimic this for now.
CmdArgs.push_back("-lgcc");
if (Args.hasArg(options::OPT_static)) { if (Args.hasArg(options::OPT_static)) {
CmdArgs.push_back("-lgcc_eh"); CmdArgs.push_back("-lgcc_eh");
} else { } else {
@ -3759,6 +3758,7 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-lgcc_s"); CmdArgs.push_back("-lgcc_s");
CmdArgs.push_back("--no-as-needed"); CmdArgs.push_back("--no-as-needed");
} }
CmdArgs.push_back("-lgcc");
if (Args.hasArg(options::OPT_pthread)) if (Args.hasArg(options::OPT_pthread))
CmdArgs.push_back("-lpthread"); CmdArgs.push_back("-lpthread");