This is an archive of the discontinued LLVM Phabricator instance.

[clang] [MinGW] Add an implicit .exe suffix even when crosscompiling
ClosedPublic

Authored by mstorsjo on Sep 21 2020, 1:42 AM.

Details

Summary

GCC 8 changed behaviour wrt this, and made it consistent for cross compilation cases. While it's a change, it's a more sensible behaviour going forward.

Diff Detail

Event Timeline

mstorsjo created this revision.Sep 21 2020, 1:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2020, 1:42 AM
mstorsjo requested review of this revision.Sep 21 2020, 1:42 AM

LGTM
Confirmed that GCC 9 still adds .exe.

rnk accepted this revision.Sep 21 2020, 11:57 AM

lgtm

This revision is now accepted and ready to land.Sep 21 2020, 11:57 AM
dmajor added a subscriber: dmajor.Sep 25 2020, 8:31 PM

This change broke the configure step of Firefox mingw builds.

The build bot won't give me the full details, so I'll need to set up a local repro next week if needed, but my hunch is that we have some test like $CC $CFLAGS conftest.c -o conftest and then check for the existence of conftest.

Is that type of pattern an acceptable casualty of this change?

This change broke the configure step of Firefox mingw builds.

The build bot won't give me the full details, so I'll need to set up a local repro next week if needed, but my hunch is that we have some test like $CC $CFLAGS conftest.c -o conftest and then check for the existence of conftest.

Is that type of pattern an acceptable casualty of this change?

I presume that's to be expected - it's certainly a pain, but anybody crosscompiling with GCC and updating to 8 or newer is going to be running into the same there as well.

FWIW, the change in GCC that changes this was this one: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=5bc86b599054f494ec0a45e49b82749320eaa9c4;hp=77efd154f33154e819186de79687ea55552139f4

This at least clarifies the situation, because the inconsistency (which show up e.g. in handwritten makefiles) between compiling natively vs crosscompiling has been pretty weird.

clang/lib/Driver/ToolChains/MinGW.cpp