summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-06-04 06:27:06 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-06-04 06:27:06 +0000
commit97864dac7610ff314eb4d0b84aa794cdd69e6fc3 (patch)
tree3fffdb486d6ddef872d102ed9ad9b918d93b4d67
parent43efe1c8bd43bd5b4644d2dfd6678196f6dafc02 (diff)
downloadbcm5719-llvm-97864dac7610ff314eb4d0b84aa794cdd69e6fc3.tar.gz
bcm5719-llvm-97864dac7610ff314eb4d0b84aa794cdd69e6fc3.zip
On linux, -nostdlib was causing a --start-group with no --end-group to be passed
to the linker. llvm-svn: 132629
-rw-r--r--clang/lib/Driver/Tools.cpp6
-rw-r--r--clang/test/Driver/nostdlib.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 695077058b9..87358cc4b06 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -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");
diff --git a/clang/test/Driver/nostdlib.c b/clang/test/Driver/nostdlib.c
new file mode 100644
index 00000000000..c73212f895e
--- /dev/null
+++ b/clang/test/Driver/nostdlib.c
@@ -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
OpenPOWER on IntegriCloud