]> granicus.if.org Git - clang/commitdiff
[driver] Don't try to set the deployment target when there is no bound
authorChad Rosier <mcrosier@apple.com>
Fri, 27 Apr 2012 19:51:11 +0000 (19:51 +0000)
committerChad Rosier <mcrosier@apple.com>
Fri, 27 Apr 2012 19:51:11 +0000 (19:51 +0000)
architecture; this was happening for tools such as lipo and dsymutil.
Also, if no -arch option has been specified, set the architecture based
on the TC default.
rdar://11329656

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155730 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
lib/Driver/ToolChains.cpp
test/Driver/altivec.cpp

index 7874a48cde7c7166f42cf362fc7258a48cb62a96..44521a1a595132a69a1f99a5b39d8b538c7ba283 100644 (file)
@@ -763,8 +763,7 @@ static unsigned PrintActions1(const Compilation &C, Action *A,
   if (InputAction *IA = dyn_cast<InputAction>(A)) {
     os << "\"" << IA->getInputArg().getValue(C.getArgs()) << "\"";
   } else if (BindArchAction *BIA = dyn_cast<BindArchAction>(A)) {
-    os << '"' << (BIA->getArchName() ? BIA->getArchName() :
-                  C.getDefaultToolChain().getArchName()) << '"'
+    os << '"' << BIA->getArchName() << '"'
        << ", {" << PrintActions1(C, *BIA->begin(), Ids) << "}";
   } else {
     os << "{";
@@ -838,7 +837,7 @@ void Driver::BuildUniversalActions(const ToolChain &TC,
   // When there is no explicit arch for this platform, make sure we still bind
   // the architecture (to the default) so that -Xarch_ is handled correctly.
   if (!Archs.size())
-    Archs.push_back(0);
+    Archs.push_back(Args.MakeArgString(TC.getArchName()));
 
   // FIXME: We killed off some others but these aren't yet detected in a
   // functional manner. If we added information to jobs about which "auxiliary"
index b56add3971756d4643d02f794f715baed789e569..c883e446dd2cc85e9cb3aa615091627d2df131ce 100644 (file)
@@ -956,7 +956,8 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args,
   // Add an explicit version min argument for the deployment target. We do this
   // after argument translation because -Xarch_ arguments may add a version min
   // argument.
-  AddDeploymentTarget(*DAL);
+  if (BoundArch)
+    AddDeploymentTarget(*DAL);
 
   // Validate the C++ standard library choice.
   CXXStdlibType Type = GetCXXStdlibType(*DAL);
index 6059ad09e7c55732b19b15d4a599b435fe7125ce..4c0b3e4e31bba97d84ce6666fd8365f8b7b11e6b 100644 (file)
@@ -1,6 +1,6 @@
 // Check that we error when -faltivec is specified on non-ppc platforms.
 
-// RUN: %clang -ccc-clang-archs powerpc -target powerpc-apple-darwin -faltivec -fsyntax-only %s
+// RUN: %clang -ccc-clang-archs powerpc -target powerpc-unk-unk -faltivec -fsyntax-only %s
 // RUN: %clang -ccc-clang-archs powerpc64 -target powerpc64-linux-gnu -faltivec -fsyntax-only %s
 
 // RUN: %clang -target i386-pc-win32 -faltivec -fsyntax-only %s 2>&1 | FileCheck %s