]> granicus.if.org Git - llvm/commit
Merging r310990:
authorHans Wennborg <hans@hanshq.net>
Mon, 21 Aug 2017 23:26:07 +0000 (23:26 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 21 Aug 2017 23:26:07 +0000 (23:26 +0000)
commitef21e43d69b7dae3cff0f0524f53bf6821951dd6
tree938fae543a34d3513420e3387f7760dc69b58b50
parent28646d0ecb24d118d16314e8e930f5b06423056b
Merging r310990:
------------------------------------------------------------------------
r310990 | mstorsjo | 2017-08-15 22:18:36 -0700 (Tue, 15 Aug 2017) | 18 lines

[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
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@311408 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Object/COFFModuleDefinition.cpp
lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
lib/ToolDrivers/llvm-dlltool/Options.td
test/DllTool/coff-decorated.def [new file with mode: 0644]