Skip to content
Merged
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
3 changes: 3 additions & 0 deletions lld/COFF/DriverUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,9 @@ opt::InputArgList ArgParser::parse(ArrayRef<const char *> argv) {
<< "', did you mean '" << nearest << "'";
}

if (args.hasArg(OPT_link))
Warn(ctx) << "ignoring /link, did you pass it multiple times?";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any value for this message? We can silently ignore the flng and nothing bad will happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this to match link.exe which gives a warning.


if (args.hasArg(OPT_lib))
Warn(ctx) << "ignoring /lib since it's not the first argument";

Expand Down
1 change: 1 addition & 0 deletions lld/COFF/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def noimplib : F<"noimplib">,
def lib : F<"lib">,
HelpText<"Act like lib.exe; must be first argument if present">;
def libpath : P<"libpath", "Additional library search path">;
def link : F<"link">, HelpText<"Ignored for compatibility">;
def linkrepro : Joined<["/", "-", "/?", "-?"], "linkrepro:">,
MetaVarName<"directory">,
HelpText<"Write repro.tar containing inputs and command to reproduce link">;
Expand Down
3 changes: 3 additions & 0 deletions lld/test/COFF/driver.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ LIBHELP: OVERVIEW: LLVM Lib
# RUN: env LLD_IN_TEST=1 not lld-link /WX /lib 2>&1 | FileCheck -check-prefix=LIBBAD %s
LIBBAD: ignoring /lib since it's not the first argument

# RUN: env LLD_IN_TEST=1 not lld-link /link 2>&1 | FileCheck -check-prefix=LINKBAD %s
LINKBAD: ignoring /link, did you pass it multiple times?

# RUN: yaml2obj %p/Inputs/hello32.yaml -o %t.obj
# RUN: not lld-link /out:/ %t.obj 2>&1 | FileCheck -check-prefix=DIR %s
DIR: cannot open output file
Expand Down
Loading