This is an archive of the discontinued LLVM Phabricator instance.

[profile] Build with -fms-extensions in MinGW mode
ClosedPublic

Authored by mstorsjo on Aug 5 2021, 11:26 PM.

Details

Summary

54902e00d1280785042e2c7ec71b25a949ade92c added a use of
/alternatename via a #pragma comment(linker); in MinGW mode, this
requires building with -fms-extensions. (This flag is added to
SANITIZER_COMMON_CFLAGS in the toplevel CMakeLists.txt.)

This avoids a warning when building in MinGW mode (about an unknown
pragma being ignored), and presumably also makes the code work as
intended.

Diff Detail

Event Timeline

mstorsjo created this revision.Aug 5 2021, 11:26 PM
mstorsjo requested review of this revision.Aug 5 2021, 11:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2021, 11:26 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
phosek accepted this revision.Aug 6 2021, 12:14 AM

LGTM

This revision is now accepted and ready to land.Aug 6 2021, 12:14 AM
This revision was landed with ongoing or failed builds.Aug 9 2021, 1:39 AM
This revision was automatically updated to reflect the committed changes.
nikic added a subscriber: nikic.Aug 15 2021, 1:43 PM

From what I can tell, this only works if clang is used as the compiler. While GCC also supports -fms-extensions, it does not support #pragma comment(linker, ...). We're seeing linker errors when linking against a gcc-built profiler runtime on mingw targets.

Is it possible to use the non-_WIN32 codepath on mingw?