Skip to content

Commit 3548b79

Browse files
authored
[LLD] [MinGW] Handle the --dll option (#68575)
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.
1 parent 5e3f43e commit 3548b79

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lld/MinGW/Options.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def alias_Bdynamic_dy: Flag<["-"], "dy">, Alias<Bdynamic>;
203203
def alias_Bstatic_dn: Flag<["-"], "dn">, Alias<Bstatic>;
204204
def alias_Bstatic_non_shared: Flag<["-"], "non_shared">, Alias<Bstatic>;
205205
def alias_Bstatic_static: Flag<["-"], "static">, Alias<Bstatic>;
206+
def alias_dll: F<"dll">, Alias<shared>;
206207
def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>;
207208
def alias_no_dynamicbase: F<"no-dynamicbase">, Alias<disable_dynamicbase>;
208209
def alias_strip_s: Flag<["-"], "s">, Alias<strip_all>;

lld/test/MinGW/driver.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ARM64-SAME: foo.o
2727

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

0 commit comments

Comments
 (0)