[PATCH] D86512: [LLD][MinGW] Handle allow-multiple-definition flag
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 25 23:38:57 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc82078b5d761: [LLD][MinGW] Handle allow-multiple-definition flag (authored by mati865, committed by mstorsjo).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86512/new/
https://reviews.llvm.org/D86512
Files:
lld/MinGW/Driver.cpp
lld/MinGW/Options.td
lld/test/MinGW/driver.test
Index: lld/test/MinGW/driver.test
===================================================================
--- lld/test/MinGW/driver.test
+++ lld/test/MinGW/driver.test
@@ -260,3 +260,11 @@
RUN: ld.lld -### -m i386pe foo.o -no-seh | FileCheck -check-prefix NOSEH %s
RUN: ld.lld -### -m i386pe foo.o --no-seh | FileCheck -check-prefix NOSEH %s
NOSEH: -noseh
+
+RUN: ld.lld -### -m i386pep foo.o --no-allow-multiple-definition --allow-multiple-definition | FileCheck -check-prefix ALLOW_MULTIPLE_DEFINITION %s
+RUN: ld.lld -### -m i386pep foo.o -no-allow-multiple-definition -allow-multiple-definition | FileCheck -check-prefix ALLOW_MULTIPLE_DEFINITION %s
+ALLOW_MULTIPLE_DEFINITION: -force:multiple
+
+RUN: ld.lld -### -m i386pep foo.o --allow-multiple-definition --no-allow-multiple-definition | FileCheck -check-prefix NO_ALLOW_MULTIPLE_DEFINITION %s
+RUN: ld.lld -### -m i386pep foo.o -allow-multiple-definition -no-allow-multiple-definition | FileCheck -check-prefix NO_ALLOW_MULTIPLE_DEFINITION %s
+NO_ALLOW_MULTIPLE_DEFINITION-NOT: -force:multiple
Index: lld/MinGW/Options.td
===================================================================
--- lld/MinGW/Options.td
+++ lld/MinGW/Options.td
@@ -23,6 +23,9 @@
def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
HelpText<"Add a directory to the library search path">;
+defm allow_multiple_definition: B<"allow-multiple-definition",
+ "Allow multiple definitions",
+ "Do not allow multiple definitions (default)">;
def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries">;
def Bstatic: F<"Bstatic">, HelpText<"Do not link against shared libraries">;
def disable_auto_import: F<"disable-auto-import">,
Index: lld/MinGW/Driver.cpp
===================================================================
--- lld/MinGW/Driver.cpp
+++ lld/MinGW/Driver.cpp
@@ -313,6 +313,10 @@
else
add("-runtime-pseudo-reloc:no");
+ if (args.hasFlag(OPT_allow_multiple_definition,
+ OPT_no_allow_multiple_definition, false))
+ add("-force:multiple");
+
if (auto *a = args.getLastArg(OPT_icf)) {
StringRef s = a->getValue();
if (s == "all")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86512.287840.patch
Type: text/x-patch
Size: 2151 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200826/286ba6cb/attachment.bin>
More information about the llvm-commits
mailing list