[cfe-commits] r132629 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/nostdlib.c

Nick Lewycky nicholas at mxc.ca
Fri Jun 3 23:27:06 PDT 2011


Author: nicholas
Date: Sat Jun  4 01:27:06 2011
New Revision: 132629

URL: http://llvm.org/viewvc/llvm-project?rev=132629&view=rev
Log:
On linux, -nostdlib was causing a --start-group with no --end-group to be passed
to the linker.

Added:
    cfe/trunk/test/Driver/nostdlib.c
Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=132629&r1=132628&r2=132629&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Jun  4 01:27:06 2011
@@ -3945,10 +3945,10 @@
     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");
 

Added: cfe/trunk/test/Driver/nostdlib.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/nostdlib.c?rev=132629&view=auto
==============================================================================
--- cfe/trunk/test/Driver/nostdlib.c (added)
+++ cfe/trunk/test/Driver/nostdlib.c Sat Jun  4 01:27:06 2011
@@ -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





More information about the cfe-commits mailing list