This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [COFF] Require an explicit -implib option for creating implibs in mingw mode
ClosedPublic

Authored by mstorsjo on Aug 16 2019, 1:54 PM.

Details

Summary

GNU ld doesn't produce implibs unless explicitly requested.

Is the test command ok to use in lit tests, is that one of the commands that can be assumed to be available for all users, or is there a better way for testing whether a file exists? (I guess some other dummy command that inspects the file also would work...)

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Aug 16 2019, 1:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2019, 1:54 PM
ruiu accepted this revision.Aug 18 2019, 11:48 PM

LGTM

COFF/Driver.cpp
1852 ↗(On Diff #215670)

... In MinGW mode, we do that only when -implib option is explicitly given for compatibility with GNU ld.

test/COFF/implib-name-mingw.test
13 ↗(On Diff #215670)

I believe using test command is OK, as we are already using some other basic commands such as tar.

This revision is now accepted and ready to land.Aug 18 2019, 11:48 PM
rnk accepted this revision.Aug 19 2019, 2:02 PM

I checked, and the test command is in Chromium's gnuwin tools package. There must be an existing test that uses it, since we wouldn't have added it for any other reason. :)

mstorsjo marked an inline comment as done.Aug 20 2019, 3:14 AM
mstorsjo added inline comments.
COFF/Driver.cpp
1862 ↗(On Diff #215670)

Committed this with a minor twek here; we still need to run fixupExports and assignExportOrdinals, even if we aren't writing the import library.

This revision was automatically updated to reflect the committed changes.