]> granicus.if.org Git - clang/commitdiff
[driver] Do not add -kext to the link command line when compiling with
authorChad Rosier <mcrosier@apple.com>
Thu, 25 Aug 2011 17:33:03 +0000 (17:33 +0000)
committerChad Rosier <mcrosier@apple.com>
Thu, 25 Aug 2011 17:33:03 +0000 (17:33 +0000)
-fapple-kext.
Fixes <rdar://problem/10013310>. Reverts <rdar://problem/7809940>.

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

lib/Driver/Driver.cpp
test/Driver/apple-kext-Xlinker-kext.cpp [deleted file]

index 12ad1b783805d431df6865d297063e5e8fb1d9c8..2baed75e0c19ac828774a715306ed1fd43ea2d3d 100644 (file)
@@ -234,23 +234,6 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const {
   }
 #endif
 
-  // If -fapple-kext has been specified, add -kext to linker command if not
-  // already done so.  Also check to make sure we're actually linking.
-  if (Args.hasArg(options::OPT_fapple_kext) && getFinalPhase(*DAL) ==
-      phases::Link) {
-    bool add_kext = true;
-    std::vector<std::string> LinkerArgs =
-      Args.getAllArgValues(options::OPT_Xlinker);
-    for (std::vector<std::string>::iterator it = LinkerArgs.begin(),
-           ie = LinkerArgs.end(); it != ie; it++)
-      if (*it == "-kext") {
-        add_kext = false;
-        break;
-      }
-    if (add_kext)
-      DAL->AddSeparateArg(0, Opts->getOption(options::OPT_Xlinker), "-kext");
-  }
-
   return DAL;
 }
 
diff --git a/test/Driver/apple-kext-Xlinker-kext.cpp b/test/Driver/apple-kext-Xlinker-kext.cpp
deleted file mode 100644 (file)
index 75d0356..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// When -fapple-kext is specified, make sure we add -kext to the linker command.
-
-// RUN: %clang -### -fapple-kext %s 2> %t1
-// RUN: FileCheck --check-prefix=CHECK1 < %t1 %s
-
-// CHECK1: "-fapple-kext"
-// CHECK1: "-kext"
-
-// RUN: %clang -### -fapple-kext -Xlinker -kext %s 2> %t2
-// RUN: FileCheck --check-prefix=CHECK2 < %t2 %s
-
-// CHECK2: "-fapple-kext"
-// CHECK2: "-kext"
-// CHECK2-NOT: "-kext"
-