Skip to content

Added '-Blinker' frontend driver option for cross-linker search path #2483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/swift/Option/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ def use_ld : Joined<["-"], "use-ld=">,
Flags<[DoesNotAffectIncrementalBuild]>,
HelpText<"Specifies the linker to be used">;

def ld_path : Separate<["-"], "Blinker">,
Flags<[FrontendOption, DoesNotAffectIncrementalBuild]>,
HelpText<"Specifies where to look for the linker">;

def Xlinker : Separate<["-"], "Xlinker">,
Flags<[DoesNotAffectIncrementalBuild]>,
HelpText<"Specifies an option which should be passed to the linker">;
Expand Down
6 changes: 6 additions & 0 deletions lib/Driver/ToolChains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,12 @@ toolchains::GenericUnix::constructInvocation(const LinkJobAction &job,
if (!Linker.empty()) {
Arguments.push_back(context.Args.MakeArgString("-fuse-ld=" + Linker));
}

// Add the linker search path
if (const Arg *A = context.Args.getLastArg(options::OPT_ld_path)) {
Arguments.push_back("-B");
Arguments.push_back(context.Args.MakeArgString(A->getValue()));
}

std::string Target = getTargetForLinker();
if (!Target.empty()) {
Expand Down