summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ToolDrivers/llvm-dlltool/Options.td
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-08-16 05:18:36 +0000
committerMartin Storsjo <martin@martin.st>2017-08-16 05:18:36 +0000
commit58c9527eaf4f48f01718d5eea9409d1bf44878ce (patch)
treea0e97fcd4ed3b8d858be1f304ed072ccb96fba10 /llvm/lib/ToolDrivers/llvm-dlltool/Options.td
parenta50275cfe5236c39d284afae40866b0747e0bcc4 (diff)
downloadbcm5719-llvm-58c9527eaf4f48f01718d5eea9409d1bf44878ce.tar.gz
bcm5719-llvm-58c9527eaf4f48f01718d5eea9409d1bf44878ce.zip
[llvm-dlltool] Fix creating stdcall/fastcall import libraries for i386
Hook up the -k option (that in the original GNU dlltool removes the @n suffix from the symbol that the final executable ends up linked to). In llvm-dlltool, make sure that functions end up with the undecorate name type if this option is set and they are decorated. In mingw, when creating import libraries from def files instead of creating an import library as a side effect of linking a DLL, the symbol names in the def contain the stdcall/fastcall decoration (but no leading underscore). By setting the undecorate name type, a linker linking to the import library will omit the decoration from the DLL import entry. With this in place, mingw-w64 for i386 built with llvm-dlltool/clang produces import libraries that actually work. Differential Revision: https://reviews.llvm.org/D36548 llvm-svn: 310990
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-dlltool/Options.td')
-rw-r--r--llvm/lib/ToolDrivers/llvm-dlltool/Options.td6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/ToolDrivers/llvm-dlltool/Options.td b/llvm/lib/ToolDrivers/llvm-dlltool/Options.td
index 213c6a4d767..e78182ab813 100644
--- a/llvm/lib/ToolDrivers/llvm-dlltool/Options.td
+++ b/llvm/lib/ToolDrivers/llvm-dlltool/Options.td
@@ -12,13 +12,13 @@ def D_long : JoinedOrSeparate<["--"], "dllname">, Alias<D>;
def d: JoinedOrSeparate<["-"], "d">, HelpText<"Input .def File">;
def d_long : JoinedOrSeparate<["--"], "input-def">, Alias<d>;
+def k: Flag<["-"], "k">, HelpText<"Kill @n Symbol from export">;
+def k_alias: Flag<["--"], "kill-at">, Alias<k>;
+
//==============================================================================
// The flags below do nothing. They are defined only for dlltool compatibility.
//==============================================================================
-def k: Flag<["-"], "k">, HelpText<"Kill @n Symbol from export">;
-def k_alias: Flag<["--"], "kill-at">, Alias<k>;
-
def S: JoinedOrSeparate<["-"], "S">, HelpText<"Assembler">;
def S_alias: JoinedOrSeparate<["--"], "as">, Alias<S>;
OpenPOWER on IntegriCloud