[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
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index ecdf7d0..eab917c 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -154,6 +154,8 @@
Add("-export-all-symbols");
if (!Args.hasArg(OPT_strip_all))
Add("-debug:dwarf");
+ if (Args.hasArg(OPT_large_address_aware))
+ Add("-largeaddressaware");
if (auto *A = Args.getLastArg(OPT_m)) {
StringRef S = A->getValue();
diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index 595a083..dca7de1 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -15,6 +15,8 @@
def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">;
def no_whole_archive: F<"no-whole-archive">,
HelpText<"No longer include all object files for following archives">;
+def large_address_aware: Flag<["--"], "large-address-aware">,
+ HelpText<"Enable large addresses">;
def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
HelpText<"Path to file to write output">;
def out_implib: Separate<["--"], "out-implib">, HelpText<"Import library name">;