From: Chad Rosier Date: Thu, 25 Aug 2011 17:33:03 +0000 (+0000) Subject: [driver] Do not add -kext to the link command line when compiling with X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fab83b5e7cb9507c7775edb93ed84758df132285;p=clang [driver] Do not add -kext to the link command line when compiling with -fapple-kext. Fixes . Reverts . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138564 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 12ad1b7838..2baed75e0c 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -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 LinkerArgs = - Args.getAllArgValues(options::OPT_Xlinker); - for (std::vector::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 index 75d0356dbd..0000000000 --- a/test/Driver/apple-kext-Xlinker-kext.cpp +++ /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" -