r228413 - -iframework option should be forwarded to linker
Steven Wu
stevenwu at apple.com
Fri Feb 6 10:08:29 PST 2015
Author: steven_wu
Date: Fri Feb 6 12:08:29 2015
New Revision: 228413
URL: http://llvm.org/viewvc/llvm-project?rev=228413&view=rev
Log:
-iframework option should be forwarded to linker
Summary:
-iframework option is used to specified System framework path so the
path specified should be passed to linker as -F option
rdar://problem/18234544
Reviewers: bob.wilson
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D7106
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/darwin-ld.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=228413&r1=228412&r2=228413&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Feb 6 12:08:29 2015
@@ -6106,6 +6106,12 @@ void darwin::Link::ConstructJob(Compilat
Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
Args.AddAllArgs(CmdArgs, options::OPT_F);
+ // -iframework should be forwarded as -F.
+ for (auto it = Args.filtered_begin(options::OPT_iframework),
+ ie = Args.filtered_end(); it != ie; ++it)
+ CmdArgs.push_back(Args.MakeArgString(std::string("-F") +
+ (*it)->getValue()));
+
const char *Exec =
Args.MakeArgString(getToolChain().GetLinkerPath());
std::unique_ptr<Command> Cmd =
Modified: cfe/trunk/test/Driver/darwin-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-ld.c?rev=228413&r1=228412&r2=228413&view=diff
==============================================================================
--- cfe/trunk/test/Driver/darwin-ld.c (original)
+++ cfe/trunk/test/Driver/darwin-ld.c Fri Feb 6 12:08:29 2015
@@ -204,3 +204,9 @@
// RUN: FileCheck -check-prefix=LINK_IOS_SIMULATOR_VERSION_MIN %s < %t.log
// LINK_IPHONEOS_VERSION_MIN: -iphoneos_version_min
// LINK_IOS_SIMULATOR_VERSION_MIN: -ios_simulator_version_min
+
+// Check -iframework gets forward to ld as -F
+// RUN: %clang -target x86_64-apple-darwin %s -iframework Bar -framework Foo -### 2>&1 | \
+// RUN: FileCheck --check-prefix=LINK-IFRAMEWORK %s
+// LINK-IFRAMEWORK: {{ld(.exe)?"}}
+// LINK-IFRAMEWORK: "-FBar"
More information about the cfe-commits
mailing list