In GNU ld, this option is enabled by default, but can be set
to reduce some warnings.
For lld, ignore the flag (for now); in case linking still succeeds
everything should be fine, if not, it should be clear to the user
what part failed (possibly requiring adjusting the user project
to not rely on this feature), instead of straight out failing due to
an unknown flag.
Differential Revision: https://reviews.llvm.org/D39330
llvm-svn: 316693
Previously, the COFF driver would call exit(0) when called
as a library. Now it takes `ExitEarly` option, and if it
is false, it doesn't exit. So it is now more library-friendly.
Furthermore, link() calls freeArena() before returning, to
clean up resources.
Based on an Andrew Kelley's patch.
Differential Revision: https://reviews.llvm.org/D39202
llvm-svn: 316370
GNU ld manual says that multi-letter long option can be prefixed with
either -- or -. Therefore, we should accept not only --subsystem but
also -subsystem, for example.
There is one exception. If an option starts with "o", it should only be
prefixed with -- to avoid ambiguity with -o<filename> option.
Differential Revision: https://reviews.llvm.org/D37825
llvm-svn: 313286
Arg instances can be claimed. After claimed, its `isClaimed` function
returns true. We do not use that notion in lld, so using NoClaim
versions of functions is just confusing. This patch is to just use
hasArg instead of hasArgNoClaim.
llvm-svn: 313187
There are no alises handled by this switch, but getUnaliasesdOption is
preferred way of doing this. This is also consistent with ELF and COFF.
llvm-svn: 313180
This is how the flag is documented in GNU binutils ld; -Bstatic
only applies to -l options after it, until the next -Bdynamic.
Differential Revision: https://reviews.llvm.org/D37794
llvm-svn: 313175
In MinGW configurations (GCC, or clang with a *-windows-gnu target),
the -export directives in the object file contains the undecorated
symbol name, while it is decorated in MSVC configurations. (On the
command line, link.exe takes an undecorated symbol name for the
-export argument though.)
Differential Revision: https://reviews.llvm.org/D37772
llvm-svn: 313174
On i386, the --entry parameter to GNU ld is supposed to be a decorated
symbol name, while it is an undecorated name in link.exe.
Differential Revision: https://reviews.llvm.org/D37710
llvm-svn: 313066
We do not use "Shim" as a name of MinGW driver, so rename it MinGW.
I don't think the former dependency list was correct. MinGW driver
depends on COFF.
llvm-svn: 312960
This adds support for passing LTO flags to the MINGW driver
in GNU LD style i.e. -mllvm flag -> /mllvm:flag
Reviewers: ruiu, mstorsjo
Differential Revision: https://reviews.llvm.org/D37712
llvm-svn: 312956
If the sysroot parameter is passed to the clang frontend, clang
already uses it to find libraries and adds -L options for it, but
also passes it on to the linker. Therefore we can get pretty far
by just ignoring it altogether.
Differential Revision: https://reviews.llvm.org/D37707
llvm-svn: 312945
Pass the -verbose option through to the COFF linker, and show the
arguments passed to it. If the -### option is specified, just show
the produced argument list and exit, just like in clang.
Replace the first argument with "lld-link" in order to produce a
correct command line.
Differential Revision: https://reviews.llvm.org/D37706
llvm-svn: 312944
Summary:
In addition to removing a few global variables and functions, I believe
this patch improves code readability a bit in general.
Reviewers: mstorsjo, martell
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37699
llvm-svn: 312940
When building COFF programs many targets such as mingw prefer
to have a gnu ld frontend. Rather then having a fully fledged
standalone driver we wrap a shim around the LINK driver.
Extra tests were provided by mstorsjo
Reviewers: mstorsjo, ruiu
Differential Revision: https://reviews.llvm.org/D33880
llvm-svn: 312926