This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Limit .exe extension addition to Windows hosts
AbandonedPublic

Authored by smeenai on Apr 15 2017, 12:04 AM.

Details

Summary

The driver should invoke lld as lld-link rather than lld-link.exe
when cross compiling.

The alternative would be to teach lld's build system to always produce
lld-link.exe even on non-Windows hosts, but I think it's cleaner to
change the driver to respect the host system's executable suffix (or
lack thereof).

Event Timeline

smeenai created this revision.Apr 15 2017, 12:04 AM
smeenai planned changes to this revision.Apr 15 2017, 12:26 AM

Forgot to fix a test

compnerd requested changes to this revision.Apr 24 2017, 5:42 PM

Why not always replace the extension? Windows doesnt require the .exe suffix IIRC.

Why not always replace the extension? Windows doesnt require the .exe suffix IIRC.

CreateProcess documentation says "This parameter must include the file name extension; no default extension is assumed.". That's kinda surprising to me, since LoadLibrary assumes a .dll extension.

smeenai abandoned this revision.Jun 5 2017, 5:42 PM

Will just drop the .exe entirely, since that works