[PATCH] D29892: ar: add llvm-dlltool support

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 13:23:28 PDT 2017


ruiu added inline comments.


================
Comment at: include/llvm/Object/COFFModuleDefinition.h:45
+parseCOFFModuleDefinition(MemoryBufferRef MB, COFF::MachineTypes Machine,
+                          bool MingwDef = false);
 
----------------
martell wrote:
> ruiu wrote:
> > martell wrote:
> > > ruiu wrote:
> > > > I don't like to add a magical boolean flag to slightly change the existing behavior. Why do you need this? This should be removed unless absolutely necessary.
> > > dlltool's defs are a little different then lib.exe's
> > > specifically mangling, see isDecorated.
> > > and the support for '==' for weak aliasing,
> > > although support for the latter won't hurt lib.exe
> > Why are they different?
> mingw and wine def files does not mangle `_` which is important for x86.
> It also does some weird things in the mingw crt like prepending `_` to all x86 crt functions so that they end up the same as x64 at link time.
> I would like to not do this but this is a legacy problem with binutils dlltool.
> I would have to update binutils to stop doing this before I could get mingw-w64 to change creating an abi breakage.
> Some time in the future we could have this behind some flag like `--legacy-mode` and encourage mingw-w64 and wine to recreate all their `.def` files.
Please add that as a comment, including the fact that what mingw does is weird and should be removed.


Repository:
  rL LLVM

https://reviews.llvm.org/D29892





More information about the llvm-commits mailing list