[PATCH] -iframework option should be forwarded to linker

David Blaikie dblaikie at gmail.com
Wed Jan 21 12:18:08 PST 2015


On Wed, Jan 21, 2015 at 12:10 PM, Steven Wu <stevenwu at apple.com> wrote:

> Hi bob.wilson,
>
> -iframework option is used to specified System framework path so the
> path specified should be passed to linker as -F option
> rdar://problem/18234544
>
> http://reviews.llvm.org/D7106
>
> Files:
>   lib/Driver/Tools.cpp
>   test/Driver/darwin-ld.c
>
> Index: lib/Driver/Tools.cpp
> ===================================================================
> --- lib/Driver/Tools.cpp
> +++ lib/Driver/Tools.cpp
> @@ -5964,6 +5964,12 @@
>    Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
>    Args.AddAllArgs(CmdArgs, options::OPT_F);
>
> +  // -iframework should be forwarded as -F.
> +  for (arg_iterator it = Args.filtered_begin(options::OPT_iframework),
> +         ie = Args.filtered_end(); it != ie; ++it) {
>

If you like, you could use:

  for (const auto &thing :
make_range(Args.filtered_begin(options::OPT_iframework),
Args.filtered_end()))



> +    CmdArgs.push_back(Args.MakeArgString(std::string("-F") +
> (*it)->getValue()));
> +  }
>

& we usually omit the braces from single-line (or single statement,
depending on preference) blocks.


> +
>    const char *Exec =
>      Args.MakeArgString(getToolChain().GetLinkerPath());
>    std::unique_ptr<Command> Cmd =
> Index: test/Driver/darwin-ld.c
> ===================================================================
> --- test/Driver/darwin-ld.c
> +++ test/Driver/darwin-ld.c
> @@ -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"
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150121/725be908/attachment.html>


More information about the cfe-commits mailing list