Skip to content

Commit

Permalink
[LLD] [MinGW] Handle the --dll option (llvm#68575)
Browse files Browse the repository at this point in the history
Treat this as an alias for the --shared option.

In practice in GNU ld, they aren't exact aliases but there are small
subtle differences in what happens and what doesn't, when they are set,
but those differences are probably not intended by users who might be
using the --dll option (which gets passed by -mdll in the compiler
driver), and the differences are within the area where small details
differ between LLD and GNU ld anyway.
mstorsjo authored Oct 9, 2023
1 parent 5e3f43e commit 3548b79
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lld/MinGW/Options.td
Original file line number Diff line number Diff line change
@@ -203,6 +203,7 @@ def alias_Bdynamic_dy: Flag<["-"], "dy">, Alias<Bdynamic>;
def alias_Bstatic_dn: Flag<["-"], "dn">, Alias<Bstatic>;
def alias_Bstatic_non_shared: Flag<["-"], "non_shared">, Alias<Bstatic>;
def alias_Bstatic_static: Flag<["-"], "static">, Alias<Bstatic>;
def alias_dll: F<"dll">, Alias<shared>;
def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>;
def alias_no_dynamicbase: F<"no-dynamicbase">, Alias<disable_dynamicbase>;
def alias_strip_s: Flag<["-"], "s">, Alias<strip_all>;
1 change: 1 addition & 0 deletions lld/test/MinGW/driver.test
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ ARM64-SAME: foo.o

RUN: ld.lld -### foo.o -m i386pep -shared 2>&1 | FileCheck -check-prefix=SHARED %s
RUN: ld.lld -### foo.o -m i386pep --shared 2>&1 | FileCheck -check-prefix=SHARED %s
RUN: ld.lld -### foo.o -m i386pep --dll 2>&1 | FileCheck -check-prefix=SHARED %s
SHARED: -out:a.dll
SHARED-SAME: -dll

0 comments on commit 3548b79

Please sign in to comment.