This is an archive of the discontinued LLVM Phabricator instance.

[asan] Don't use libstdc++ in test
ClosedPublic

Authored by abrachet on May 17 2023, 12:46 PM.

Details

Summary

It shouldn't be assumed that libstdc++ is always available even on Linux.
Just let the compiler pick the default

Diff Detail

Event Timeline

abrachet created this revision.May 17 2023, 12:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2023, 12:46 PM
Herald added a subscriber: Enna1. · View Herald Transcript
abrachet requested review of this revision.May 17 2023, 12:46 PM
vitalybuka added inline comments.May 17 2023, 3:32 PM
compiler-rt/test/asan/TestCases/throw_invoke_test.cpp
2

Why do we need static-libstdc?

abrachet added inline comments.May 17 2023, 3:42 PM
compiler-rt/test/asan/TestCases/throw_invoke_test.cpp
2

I've just left it because that is what %linux_static_libstdcplusplus used to expand to. Though clearly it should be fine without because non Linux platforms omit this flag. Do you reckon we should remove it entirely?

vitalybuka added inline comments.May 17 2023, 3:50 PM
compiler-rt/test/asan/TestCases/throw_invoke_test.cpp
2

this test runs on windows and osx, so you need some Linux specific substitution
not sure what happen if you remove this completly

phosek added inline comments.May 17 2023, 4:32 PM
compiler-rt/test/lit.common.cfg.py
653

-static-libstdc++ despite the name isn't specific to libstdc++, it applies to whichever -stdlib= is selected. I think it should be sufficient to just drop -stdlib=libstdc++.

abrachet marked an inline comment as done.May 18 2023, 3:00 PM
abrachet added inline comments.
compiler-rt/test/lit.common.cfg.py
653

Right, that is why I have just replaced the use of linux_static_libstdcplusplus with just -static-libstdc++ in the one place it was being used. On the other platforms that wasn't being used, but I doubt that it would make the test wrong on those platforms

vitalybuka accepted this revision.May 18 2023, 9:08 PM
This revision is now accepted and ready to land.May 18 2023, 9:08 PM
phosek accepted this revision.May 18 2023, 11:10 PM

LGTM

This revision was automatically updated to reflect the committed changes.
abrachet marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 8:18 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript