Commit Graph

25 Commits

Author SHA1 Message Date
Martin Storsjo db62913f28 [MinGW] Hook up the --require-defined option to -include:
Differential Revision: https://reviews.llvm.org/D51840

llvm-svn: 341846
2018-09-10 17:41:40 +00:00
Martin Storsjo c0826745cf [MinGW] Implement the GNU ld options -S/--strip-debug
In this mode, we retain the symbol table, but skip the actual debug
information.

Differential Revision: https://reviews.llvm.org/D48745

llvm-svn: 335947
2018-06-29 06:08:31 +00:00
Martin Storsjo 0366155500 [MinGW] Handle the GNU ld option -Map for outputting a linker map
Differential Revision: https://reviews.llvm.org/D46872

llvm-svn: 332398
2018-05-15 21:12:29 +00:00
Martin Storsjo b7d50115ba [MinGW] Add a LLD specific option -pdb
This allows producing pdb debug info. This is an LLD specific option
since GCC and GNU binutils doesn't support the PDB file format.

Differential Revision: https://reviews.llvm.org/D46796

llvm-svn: 332327
2018-05-15 06:34:18 +00:00
Martin Storsjo fb36e6e82c [MinGW] Add support for the GNU ld flag --kill-at
llvm-svn: 327562
2018-03-14 20:17:24 +00:00
Rui Ueyama b34bd34fd2 [MinGW] Fix --{start,end}-group.
Currently --start-group=foo is accidentally accepted by the MinGW driver.

Differential Revision: https://reviews.llvm.org/D43836

llvm-svn: 326478
2018-03-01 20:38:38 +00:00
Martin Storsjo 41ffd96445 [MinGW] Ignore the --start-group --end-group parameters
These are required for handling circular dependencies between
static libraries, which is something that lld-link always does without
any extra parameters.

Differential Revision: https://reviews.llvm.org/D43786

llvm-svn: 326172
2018-02-27 06:26:35 +00:00
Martin Storsjo cf29eb8c22 [MinGW] Ignore the --no-seh flag
The COFF linker automatically sets the IMAGE_DLL_CHARACTERISTICS_NO_SEH
when suitable, similarly to link.exe.

Differential Revision: https://reviews.llvm.org/D41275

llvm-svn: 320861
2017-12-15 20:53:10 +00:00
Martin Storsjo a4eaf16d94 [MinGW] Ignore the --build-id, --pie-executable and --disable-auto-image-base options
LLD already writes a build id if debug info is enabled.

Some projects set --pie-executable to avoid GNU ld bugs about stripping
base relocations from an executable when they actually are used.
Since -fixed:no is the default (and we don't support setting the
-fixed option via the MinGW frontend), we don't need to handle this.

--disable-auto-image-base is ignored just like --enable-auto-image-base
(as we ignore from before).

Differential Revision: https://reviews.llvm.org/D40031

llvm-svn: 318285
2017-11-15 08:18:28 +00:00
Martin Storsjo b190fd2bb4 [MinGW] Implement the --[no-]gc-sections and --icf options
GNU ld doesn't seem to support --icf at all, but this was suggested
in D39885, and GNU gold seems to support it.

Differential Revision: https://reviews.llvm.org/D40019

llvm-svn: 318283
2017-11-15 08:18:20 +00:00
Martin Storsjo e916868269 [MinGW] Implement support for the --image-base option
Differential Revision: https://reviews.llvm.org/D40018

llvm-svn: 318282
2017-11-15 08:18:15 +00:00
Martin Storsjo 094d8c09e6 [MinGW] Add support for --dynamicbase, ignore --nxcompat, --tsaware and --high-entropy-va
All of these are disabled by default in GNU ld, but enabled by default
in lld.

Disable dynamicbase by default since it potentially could cause
compatibility issues, but just ignore the others since the lld
default should be fine for most concievable cases.

Differential Revision: https://reviews.llvm.org/D40017

llvm-svn: 318281
2017-11-15 08:18:11 +00:00
Martin Storsjo 3c8d4b5a73 [MinGW] Handle --large-address-aware
In GNU ld, this option is only available on i386, not on x86_64
(where it's enabled by default with no option to disable it either).

Differential Revision: https://reviews.llvm.org/D40015

llvm-svn: 318280
2017-11-15 08:18:06 +00:00
Martin Storsjo 068512dfb9 [MinGW] Output debug info by default, unless the -s parameter is passed
Differential Revision: https://reviews.llvm.org/D39541

llvm-svn: 317376
2017-11-03 22:10:37 +00:00
Martin Storsjo 107b548368 [MinGW] Add an option -Xlink for passing options through to lld-link
Also move the -mllvm option to the right section of the options
list.

Differential Revision: https://reviews.llvm.org/D39528

llvm-svn: 317302
2017-11-03 07:18:37 +00:00
Martin Storsjo ab9c98c70d [MinGW] Ignore the --enable-auto-import flag
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
2017-10-26 20:12:01 +00:00
Martin Storsjo 27af6b0082 [MinGW] Support --out-implib=name in addition to "--out-implib name"
Differential Revision: https://reviews.llvm.org/D39329

llvm-svn: 316692
2017-10-26 20:11:58 +00:00
Martin Storsjo a84a47741a [MinGW] Hook up the --export-all-symbols and --output-def options
Differential Revision: https://reviews.llvm.org/D38761

llvm-svn: 315563
2017-10-12 05:37:18 +00:00
Rui Ueyama 1f4cdcfec9 Accept not only --foo but also -foo.
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
2017-09-14 18:33:21 +00:00
Martin Storsjo 32e1626a2e [MinGW] Add support for the options --[no-]whole-archive
Differential Revision: https://reviews.llvm.org/D37769

llvm-svn: 313124
2017-09-13 07:28:09 +00:00
Martell Malone 0d17638b89 LLD: Add -mllvm flag to the MinGW driver.
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
2017-09-11 21:36:37 +00:00
Rui Ueyama c3e4602645 Sort options.
This patch also rename OPT_outlib OPT_out_implib for consistency.

llvm-svn: 312949
2017-09-11 20:54:51 +00:00
Martin Storsjo 5d5aa214d8 [MinGW] Ignore the sysroot parameter
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
2017-09-11 20:43:43 +00:00
Martin Storsjo a79762a32d [MinGW] Map the -verbose option, implement -### for showing the produced parameters
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
2017-09-11 20:43:39 +00:00
Martell Malone 894dbbe8eb LLD: Introduce a GNU LD style driver for COFF
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
2017-09-11 17:02:59 +00:00