[LLD] [MinGW] Support dllexport on i386
ClosedPublic

Authored by mstorsjo on Sep 12 2017, 2:20 PM.

Details

Summary

In MinGW configurations (GCC, or clang with a *-windows-gnu target), the -export directives in the object file contains the undecorated symbol name, while it is decorated in MSVC configurations. (On the command line, link.exe takes an undecorated symbol name for the -export argument though.)

Diff Detail

Repository
rL LLVM
mstorsjo created this revision.Sep 12 2017, 2:20 PM
ruiu added inline comments.Sep 12 2017, 2:33 PM
COFF/Driver.cpp
237–242 ↗(On Diff #114909)

This is pretty hairy rule, but yeah, this is probably unavoidable.

728 ↗(On Diff #114909)

Since it is an internal flag, I'd like to name this /lldmingw.

COFF/Options.td
107 ↗(On Diff #114909)

We don't want to show a help message for an internal flag.

mstorsjo added inline comments.Sep 13 2017, 12:53 AM
COFF/Driver.cpp
237–242 ↗(On Diff #114909)

Yeah; this is the same logic as in the main handling of OPT_export on the command line though, modulo the extra && Config->MinGW.

728 ↗(On Diff #114909)

Ok, will change.

COFF/Options.td
107 ↗(On Diff #114909)

Removed

mstorsjo updated this revision to Diff 114988.Sep 13 2017, 12:54 AM

Renamed the internal option to -lldmingw and removed the help text.

ruiu accepted this revision.Sep 13 2017, 10:02 AM
ruiu added inline comments.
COFF/Config.h
176 ↗(On Diff #114988)

Remove the blank line.

MinGW/Driver.cpp
123 ↗(On Diff #114988)

Can you add a test for this to test/MinGW/driver.test?

This revision is now accepted and ready to land.Sep 13 2017, 10:02 AM
This revision was automatically updated to reflect the committed changes.