Index: cfe/trunk/lib/Driver/Tools.cpp =================================================================== --- cfe/trunk/lib/Driver/Tools.cpp +++ cfe/trunk/lib/Driver/Tools.cpp @@ -6138,6 +6138,16 @@ CmdArgs.push_back(Args.MakeArgString(std::string("-F") + (*it)->getValue())); + if (!Args.hasArg(options::OPT_nostdlib) && + !Args.hasArg(options::OPT_nodefaultlibs)) { + if (Arg *A = Args.getLastArg(options::OPT_fveclib)) { + if (A->getValue() == StringRef("Accelerate")) { + CmdArgs.push_back("-framework"); + CmdArgs.push_back("Accelerate"); + } + } + } + const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath()); std::unique_ptr Cmd = Index: cfe/trunk/test/Driver/fveclib.c =================================================================== --- cfe/trunk/test/Driver/fveclib.c +++ cfe/trunk/test/Driver/fveclib.c @@ -6,3 +6,12 @@ // CHECK-ACCELERATE: "-fveclib=Accelerate" // CHECK-INVALID: error: invalid value 'something' in '-fveclib=something' + +// RUN: %clang -fveclib=Accelerate %s -target arm64-apple-ios8.0.0 -### 2>&1 | FileCheck --check-prefix=CHECK-LINK %s +// CHECK-LINK: "-framework" "Accelerate" + +// RUN: %clang -fveclib=Accelerate %s -nostdlib -target arm64-apple-ios8.0.0 -### 2>&1 | FileCheck --check-prefix=CHECK-LINK-NOSTDLIB %s +// CHECK-LINK-NOSTDLIB-NOT: "-framework" "Accelerate" + +// RUN: %clang -fveclib=Accelerate %s -nodefaultlibs -target arm64-apple-ios8.0.0 -### 2>&1 | FileCheck --check-prefix=CHECK-LINK-NODEFAULTLIBS %s +// CHECK-LINK-NODEFAULTLIBS-NOT: "-framework" "Accelerate"