[llvm] 4bf50e0 - [llvm-dlltool] Use -N for input native def option to avoid conflict with GNU dlltool --no-delete option. (#81847)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 15 14:11:47 PST 2024
Author: Jacek Caban
Date: 2024-02-15T23:11:43+01:00
New Revision: 4bf50e02554460df86903791380fb5ca17a28bdc
URL: https://github.com/llvm/llvm-project/commit/4bf50e02554460df86903791380fb5ca17a28bdc
DIFF: https://github.com/llvm/llvm-project/commit/4bf50e02554460df86903791380fb5ca17a28bdc.diff
LOG: [llvm-dlltool] Use -N for input native def option to avoid conflict with GNU dlltool --no-delete option. (#81847)
Added:
Modified:
llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
llvm/lib/ToolDrivers/llvm-dlltool/Options.td
llvm/test/tools/llvm-dlltool/arm64ec.test
Removed:
################################################################################
diff --git a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
index fa716a281a69fc..d5fa05606d7f82 100644
--- a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
@@ -205,12 +205,12 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
std::vector<COFFShortExport> Exports, NativeExports;
- if (Args.hasArg(OPT_n)) {
+ if (Args.hasArg(OPT_N)) {
if (!isArm64EC(Machine)) {
llvm::errs() << "native .def file is supported only on arm64ec target\n";
return 1;
}
- if (!parseModuleDefinition(Args.getLastArg(OPT_n)->getValue(),
+ if (!parseModuleDefinition(Args.getLastArg(OPT_N)->getValue(),
IMAGE_FILE_MACHINE_ARM64, AddUnderscores,
NativeExports, OutputFile))
return 1;
diff --git a/llvm/lib/ToolDrivers/llvm-dlltool/Options.td b/llvm/lib/ToolDrivers/llvm-dlltool/Options.td
index ba94aed067e6ad..7810694c98e363 100644
--- a/llvm/lib/ToolDrivers/llvm-dlltool/Options.td
+++ b/llvm/lib/ToolDrivers/llvm-dlltool/Options.td
@@ -12,8 +12,8 @@ def D_long : JoinedOrSeparate<["--"], "dllname">, Alias<D>;
def d: JoinedOrSeparate<["-"], "d">, HelpText<"Input .def File">;
def d_long : JoinedOrSeparate<["--"], "input-def">, Alias<d>;
-def n: JoinedOrSeparate<["-"], "n">, HelpText<"Input native .def File on ARM64EC">;
-def n_long : JoinedOrSeparate<["--"], "input-native-def">, Alias<d>;
+def N: JoinedOrSeparate<["-"], "N">, HelpText<"Input native .def File on ARM64EC">;
+def N_long : JoinedOrSeparate<["--"], "input-native-def">, Alias<N>;
def k: Flag<["-"], "k">, HelpText<"Kill @n Symbol from export">;
def k_alias: Flag<["--"], "kill-at">, Alias<k>;
diff --git a/llvm/test/tools/llvm-dlltool/arm64ec.test b/llvm/test/tools/llvm-dlltool/arm64ec.test
index 77cef16a5fb193..e742a77ff78a52 100644
--- a/llvm/test/tools/llvm-dlltool/arm64ec.test
+++ b/llvm/test/tools/llvm-dlltool/arm64ec.test
@@ -16,7 +16,7 @@ ARMAP-NEXT: __imp_aux_func in test.dll
ARMAP-NEXT: __imp_func in test.dll
ARMAP-NEXT: func in test.dll
-RUN: llvm-dlltool -m arm64ec -d test.def -n test2.def -l test2.lib
+RUN: llvm-dlltool -m arm64ec -d test.def -N test2.def -l test2.lib
RUN: llvm-nm --print-armap test2.lib | FileCheck --check-prefix=ARMAP2 %s
ARMAP2: Archive map
@@ -32,7 +32,10 @@ ARMAP2-NEXT: __imp_aux_func in test.dll
ARMAP2-NEXT: __imp_func in test.dll
ARMAP2-NEXT: func in test.dll
-RUN: not llvm-dlltool -m arm64 -d test.def -n test2.def -l test2.lib 2>&1 | FileCheck --check-prefix=ERR %s
+RUN: llvm-dlltool -m arm64ec -d test.def --input-native-def test2.def -l test3.lib
+RUN: llvm-nm --print-armap test3.lib | FileCheck --check-prefix=ARMAP2 %s
+
+RUN: not llvm-dlltool -m arm64 -d test.def -N test2.def -l test4.lib 2>&1 | FileCheck --check-prefix=ERR %s
ERR: native .def file is supported only on arm64ec target
#--- test.def
More information about the llvm-commits
mailing list