Commit Graph

15 Commits

Author SHA1 Message Date
Rui Ueyama 7d306a598e Move a piece of code above some local variable definitions to make their scope narrower.
llvm-svn: 313178
2017-09-13 19:40:07 +00:00
Martin Storsjo 2ba37d4b3e [MinGW] Only apply -Bstatic to following libraries
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
2017-09-13 19:29:44 +00:00
Martin Storsjo 31fe4cd25d [MinGW] Support dllexport on i386
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
2017-09-13 19:29:39 +00:00
Martin Storsjo 064b0fac93 [MinGW] Support creating DLLs with a def file
Differential Revision: https://reviews.llvm.org/D37761

llvm-svn: 313125
2017-09-13 07:28:13 +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
Martin Storsjo 6d8dace438 [MinGW] Pass the undecorated entry point name to the COFF linker
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
2017-09-12 19:23:54 +00:00
Rui Ueyama d2da71f971 Reorder functions so that related functions come closer.
llvm-svn: 312964
2017-09-11 22:04:37 +00:00
Rui Ueyama 447479677f Rename COFFLdOptTable MinGWOptTable for consistency.
llvm-svn: 312963
2017-09-11 22:04:25 +00:00
Rui Ueyama c16fd25c29 Make the scope of an anonymous namespace as narrow as possible.
llvm-svn: 312962
2017-09-11 22:04:13 +00:00
Rui Ueyama 95114b497f Remove unused includes and do not enclose the entire file with a namespace.
llvm-svn: 312961
2017-09-11 22:04:01 +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 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
Rui Ueyama 5941b0bb63 Improve readability of MinGW driver. NFC.
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
2017-09-11 20:14:47 +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