[PATCH] D39528: [LLD] [MinGW] Add an option -Xlink for passing options through to lld-link
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 3 00:19:23 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL317302: [MinGW] Add an option -Xlink for passing options through to lld-link (authored by mstorsjo).
Changed prior to commit:
https://reviews.llvm.org/D39528?vs=121373&id=121436#toc
Repository:
rL LLVM
https://reviews.llvm.org/D39528
Files:
lld/trunk/MinGW/Driver.cpp
lld/trunk/MinGW/Options.td
lld/trunk/test/MinGW/driver.test
Index: lld/trunk/MinGW/Options.td
===================================================================
--- lld/trunk/MinGW/Options.td
+++ lld/trunk/MinGW/Options.td
@@ -13,7 +13,6 @@
def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">,
HelpText<"Root name of library to use">;
def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">;
-def mllvm: S<"mllvm">;
def no_whole_archive: F<"no-whole-archive">,
HelpText<"No longer include all object files for following archives">;
def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
@@ -31,6 +30,9 @@
// LLD specific options
def _HASH_HASH_HASH : Flag<["-"], "###">,
HelpText<"Print (but do not run) the commands to run for this compilation">;
+def mllvm: S<"mllvm">;
+def Xlink : J<"Xlink=">, MetaVarName<"<arg>">,
+ HelpText<"Pass <arg> to the COFF linker">;
// Currently stubs to avoid errors
def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries">;
Index: lld/trunk/MinGW/Driver.cpp
===================================================================
--- lld/trunk/MinGW/Driver.cpp
+++ lld/trunk/MinGW/Driver.cpp
@@ -170,6 +170,9 @@
for (auto *A : Args.filtered(OPT_mllvm))
Add("-mllvm:" + StringRef(A->getValue()));
+ for (auto *A : Args.filtered(OPT_Xlink))
+ Add(A->getValue());
+
if (Args.getLastArgValue(OPT_m) == "i386pe")
Add("-alternatename:__image_base__=___ImageBase");
else
Index: lld/trunk/test/MinGW/driver.test
===================================================================
--- lld/trunk/test/MinGW/driver.test
+++ lld/trunk/test/MinGW/driver.test
@@ -79,3 +79,6 @@
RUN: ld.lld -### -m i386pep foo.o --output-def out.def | FileCheck -check-prefix OUTPUT-DEF %s
OUTPUT-DEF: -output-def:out.def
+
+RUN: ld.lld -### -m i386pep foo.o -Xlink=-lldmap | FileCheck -check-prefix XLINK %s
+XLINK: -lldmap
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39528.121436.patch
Type: text/x-patch
Size: 1863 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171103/0c8110dc/attachment.bin>
More information about the llvm-commits
mailing list