[lld] 3548b79 - [LLD] [MinGW] Handle the --dll option (#68575)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 13:19:45 PDT 2023


Author: Martin Storsjö
Date: 2023-10-09T23:19:41+03:00
New Revision: 3548b79557d193d5bb2acaf8f443a07846f1e14a

URL: https://github.com/llvm/llvm-project/commit/3548b79557d193d5bb2acaf8f443a07846f1e14a
DIFF: https://github.com/llvm/llvm-project/commit/3548b79557d193d5bb2acaf8f443a07846f1e14a.diff

LOG: [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.

Added: 
    

Modified: 
    lld/MinGW/Options.td
    lld/test/MinGW/driver.test

Removed: 
    


################################################################################
diff  --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index f59bd5bc38a8db8..fa4c4ecc75d6543 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -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>;

diff  --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test
index 2893f8c66fd122c..1fdd494754af4bf 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
 


        


More information about the llvm-commits mailing list