From: Joerg Sonnenberger Date: Tue, 7 Jun 2011 23:39:17 +0000 (+0000) Subject: Sort -lgcc after -lgcc_s for NetBSD, otherwise shared libraries on i386 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db6393f259b8e634302e27d538ca4760f4221d91;p=clang Sort -lgcc after -lgcc_s for NetBSD, otherwise shared libraries on i386 may pick it up. This would create bad text relocations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132736 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 03b7e2029f..bc3ff6873b 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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 // the default system libraries. Just mimic this for now. - CmdArgs.push_back("-lgcc"); if (Args.hasArg(options::OPT_static)) { CmdArgs.push_back("-lgcc_eh"); } else { @@ -3759,6 +3758,7 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-lgcc_s"); CmdArgs.push_back("--no-as-needed"); } + CmdArgs.push_back("-lgcc"); if (Args.hasArg(options::OPT_pthread)) CmdArgs.push_back("-lpthread");