[cfe-commits] r79948 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/darwin-as.c
Daniel Dunbar
daniel at zuster.org
Mon Aug 24 15:26:16 PDT 2009
Author: ddunbar
Date: Mon Aug 24 17:26:16 2009
New Revision: 79948
URL: http://llvm.org/viewvc/llvm-project?rev=79948&view=rev
Log:
PR4766: Don't pass -static to 'as' on x86_64 on Darwin.
Also, do pass -static even with -dynamic on i386.
Added:
cfe/trunk/test/Driver/darwin-as.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=79948&r1=79947&r2=79948&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Aug 24 17:26:16 2009
@@ -1277,10 +1277,10 @@
CmdArgs.push_back(Args.MakeArgString(getToolChain().getArchName().c_str()));
CmdArgs.push_back("-force_cpusubtype_ALL");
- if ((Args.hasArg(options::OPT_mkernel) ||
+ if (getToolChain().getTriple().getArch() != llvm::Triple::x86_64 &&
+ (Args.hasArg(options::OPT_mkernel) ||
Args.hasArg(options::OPT_static) ||
- Args.hasArg(options::OPT_fapple_kext)) &&
- !Args.hasArg(options::OPT_dynamic))
+ Args.hasArg(options::OPT_fapple_kext)))
CmdArgs.push_back("-static");
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
Added: cfe/trunk/test/Driver/darwin-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-as.c?rev=79948&view=auto
==============================================================================
--- cfe/trunk/test/Driver/darwin-as.c (added)
+++ cfe/trunk/test/Driver/darwin-as.c Mon Aug 24 17:26:16 2009
@@ -0,0 +1,10 @@
+// RUN: clang -ccc-host-triple i386-apple-darwin10 -### -x assembler -c %s -static -dynamic 2>%t &&
+// RUN: FileCheck -check-prefix=STATIC_AND_DYNAMIC-32 --input-file %t %s
+
+// CHECK-STATIC_AND_DYNAMIC-32: as" "-arch" "i386" "-force_cpusubtype_ALL" "-static" "-o"
+
+// RUN: clang -ccc-host-triple x86_64-apple-darwin10 -### -x assembler -c %s -static 2>%t &&
+// RUN: FileCheck -check-prefix=STATIC-64 --input-file %t %s
+
+// CHECK-STATIC-64: as" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o"
+
More information about the cfe-commits
mailing list