This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] [test] [builtins] Pass the right parameters for linking with -nodefaultlibs on mingw targets
ClosedPublic

Authored by mstorsjo on Apr 5 2023, 11:48 AM.

Details

Summary

The clang-cl/MSVC case is handled above, thus consider win32 && !is_msvc
to be mingw.

This matches the list of libraries passed by e.g. the libcxx build, when
using -nodefaultlibs.

Diff Detail

Event Timeline

mstorsjo created this revision.Apr 5 2023, 11:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2023, 11:48 AM
Herald added subscribers: Enna1, dberris. · View Herald Transcript
mstorsjo requested review of this revision.Apr 5 2023, 11:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2023, 11:48 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
alvinhochun added inline comments.Apr 6 2023, 2:58 AM
compiler-rt/test/builtins/Unit/lit.cfg.py
51

Just wondering is this really needed? I had assumed that the lit test runner handles passing paths with backslashes just fine. Though I guess there is no harm in replacing them with forward slashes.

mstorsjo added inline comments.Apr 6 2023, 3:04 AM
compiler-rt/test/builtins/Unit/lit.cfg.py
51

See the top of the file, lines 8-17 - the user may ask to run the tests via bash instead of with lit's internal executor.

I guess the sys.platform in ['win32'] might be somehwat redundant here though - as these scripts don't really seem to be ready for cross testing anyway. (libcxx/libcxxabi/libunwind's test setup do support cross testing though.) But I'm keeping the style consistent with the other cases anyway.

I'm not sure what config.host_os refers to here - is it specifically the cross target OS, or the host running the testsuite? E.g. the asan tests use specifically the target triple, which should be unambiguous, and sys.platform also is unambiguously the host that is executing the python script.

Ping - @alvinhochun - is your comments thread completed? If there’s no further concerns, can someone approve it?

alvinhochun accepted this revision.Apr 13 2023, 1:14 AM

Sorry, I forgot about this. LGTM but I presume you already tested it and you are more familiar with it than me anyway.

This revision is now accepted and ready to land.Apr 13 2023, 1:14 AM