On linux, -nostdlib was causing a --start-group with no --end-group to be passed

to the linker.

llvm-svn: 132629
This commit is contained in:
Nick Lewycky 2011-06-04 06:27:06 +00:00
parent 43efe1c8bd
commit 97864dac76
2 changed files with 7 additions and 3 deletions

View File

@ -3945,10 +3945,10 @@ void linuxtools::Link::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-lm");
}
if (Args.hasArg(options::OPT_static))
CmdArgs.push_back("--start-group");
if (!Args.hasArg(options::OPT_nostdlib)) {
if (Args.hasArg(options::OPT_static))
CmdArgs.push_back("--start-group");
if (!D.CCCIsCXX)
CmdArgs.push_back("-lgcc");

View File

@ -0,0 +1,4 @@
// RUN: %clang -ccc-host-triple i686-pc-linux-gnu -### -nostdlib %s 2> %t
// RUN: FileCheck < %t %s
//
// CHECK-NOT: start-group