From 7686d9a7c0bcdaf63fcb4207505c13a12a97a526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 9 Oct 2023 14:01:26 +0300 Subject: [PATCH] [LLD] [MinGW] Handle the --dll option 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. --- lld/MinGW/Options.td | 1 + lld/test/MinGW/driver.test | 1 + 2 files changed, 2 insertions(+) diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td index f59bd5bc38a8d..fa4c4ecc75d65 100644 --- a/lld/MinGW/Options.td +++ b/lld/MinGW/Options.td @@ -203,6 +203,7 @@ def alias_Bdynamic_dy: Flag<["-"], "dy">, Alias; def alias_Bstatic_dn: Flag<["-"], "dn">, Alias; def alias_Bstatic_non_shared: Flag<["-"], "non_shared">, Alias; def alias_Bstatic_static: Flag<["-"], "static">, Alias; +def alias_dll: F<"dll">, Alias; def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias; def alias_no_dynamicbase: F<"no-dynamicbase">, Alias; def alias_strip_s: Flag<["-"], "s">, Alias; diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test index 2893f8c66fd12..1fdd494754af4 100644 --- a/lld/test/MinGW/driver.test +++ b/lld/test/MinGW/driver.test @@ -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