Skip to content

Commit

Permalink
[MinGW] Hook up the --export-all-symbols and --output-def options
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D38761

llvm-svn: 315563
  • Loading branch information
mstorsjo committed Oct 12, 2017
1 parent 7f71acd commit a84a477
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lld/MinGW/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ bool mingw::link(ArrayRef<const char *> ArgsArr, raw_ostream &Diag) {
Add("-implib:" + StringRef(A->getValue()));
if (auto *A = Args.getLastArg(OPT_stack))
Add("-stack:" + StringRef(A->getValue()));
if (auto *A = Args.getLastArg(OPT_output_def))
Add("-output-def:" + StringRef(A->getValue()));

if (auto *A = Args.getLastArg(OPT_o))
Add("-out:" + StringRef(A->getValue()));
Expand All @@ -148,6 +150,8 @@ bool mingw::link(ArrayRef<const char *> ArgsArr, raw_ostream &Diag) {
Add("-dll");
if (Args.hasArg(OPT_verbose))
Add("-verbose");
if (Args.hasArg(OPT_export_all_symbols))
Add("-export-all-symbols");

if (auto *A = Args.getLastArg(OPT_m)) {
StringRef S = A->getValue();
Expand Down
3 changes: 3 additions & 0 deletions lld/MinGW/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
HelpText<"Add a directory to the library search path">;
def entry: S<"entry">, MetaVarName<"<entry>">,
HelpText<"Name of entry point symbol">;
def export_all_symbols: F<"export-all-symbols">,
HelpText<"Export all symbols even if a def file or dllexport attributes are used">;
def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">,
HelpText<"Root name of library to use">;
def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">;
Expand All @@ -17,6 +19,7 @@ def no_whole_archive: F<"no-whole-archive">,
def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
HelpText<"Path to file to write output">;
def out_implib: Separate<["--"], "out-implib">, HelpText<"Import library name">;
def output_def: S<"output-def">, HelpText<"Output def file">;
def shared: F<"shared">, HelpText<"Build a shared object">;
def subs: S<"subsystem">, HelpText<"Specify subsystem">;
def stack: S<"stack">;
Expand Down
6 changes: 6 additions & 0 deletions lld/test/MinGW/driver.test
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,9 @@ WHOLE-ARCHIVE: foo.o -wholearchive:bar.a baz.a

RUN: ld.lld -### -m i386pep foo.o | FileCheck -check-prefix MINGW-FLAG %s
MINGW-FLAG: -lldmingw

RUN: ld.lld -### -m i386pep foo.o --export-all-symbols | FileCheck -check-prefix EXPORT-ALL %s
EXPORT-ALL: -export-all-symbols

RUN: ld.lld -### -m i386pep foo.o --output-def out.def | FileCheck -check-prefix OUTPUT-DEF %s
OUTPUT-DEF: -output-def:out.def

0 comments on commit a84a477

Please sign in to comment.