This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Don't pass INCLUDE to clang via -isystem
ClosedPublic

Authored by mstorsjo on Feb 21 2021, 3:30 PM.

Details

Summary

Passing the MSVC include dirs via -isystem makes them included before clang's own include resource dir (<prefix>/lib/clang/<version>/include). This causes includes of stddef.h to bypass clang's stddef.h which defines max_align_t, which libc++ needs defined.

Diff Detail

Event Timeline

mstorsjo created this revision.Feb 21 2021, 3:30 PM
mstorsjo requested review of this revision.Feb 21 2021, 3:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2021, 3:30 PM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
mstorsjo added a reviewer: rnk.

To follow up on the commit description: Manually passing these via -isystem isn't needed as the compiler driver itself picks up the include directories (and places them at the correct place in the include order!) from the INCLUDE variable.

Fwiw, I traced this code back to rG4372f06d0fcaba1a6913e2f37be064e06a7b5b5b where the initial windows testing support was added - unsure if it really was needed back then; right now it isn't - and since libc++ started depending on max_align_t, it became an issue.

ldionne accepted this revision.Feb 23 2021, 6:31 AM
This revision is now accepted and ready to land.Feb 23 2021, 6:31 AM
This revision was automatically updated to reflect the committed changes.