aboutsummaryrefslogtreecommitdiff
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
commit80df02592ccc283b20b66959f74c6d61af28cadb (patch)
tree43ccf578d85d1ffac7a65c7b423ed73984161a7e
parent7e46d0b8436d844d77f3ff580b6e1204e0407044 (diff)
On linux, -nostdlib was causing a --start-group with no --end-group to be passed
to the linker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132629 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Driver/Tools.cpp6
-rw-r--r--test/Driver/nostdlib.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 695077058b..87358cc4b0 100644
--- a/lib/Driver/Tools.cpp
+++ b/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/test/Driver/nostdlib.c b/test/Driver/nostdlib.c
new file mode 100644
index 0000000000..c73212f895
--- /dev/null
+++ b/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