This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Drop stdlib paths in freestanding tests
ClosedPublic

Authored by lichray on Nov 23 2021, 8:26 PM.

Details

Summary

When targeting FreeBSD on a Linux host with a copy
of system libc++, Clang prepends /usr/include/c++/v1
to the search paths even with -ffreestanding, and
fails to compile a program with a
single #include <xmmintrin.h>

Dropping the path with -nostdlibinc.

Diff Detail

Event Timeline

lichray created this revision.Nov 23 2021, 8:26 PM
lichray requested review of this revision.Nov 23 2021, 8:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2021, 8:26 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

GCC -ffreestanding doesn't change libstdc++ search paths. Clang's behavior matches GCC.

To drop /usr/include/c++/v1, you need -nostdinc++. If you want to drop /usr/include etc, you need to specify --sysroot=

lichray updated this revision to Diff 389391.Nov 23 2021, 10:06 PM
  • Adapt tests instead
lichray retitled this revision from [Driver] Stop adding stdlib paths in -ffreestanding to [PowerPC] Drop stdlib paths in freestanding tests.Nov 23 2021, 10:08 PM
lichray edited the summary of this revision. (Show Details)
nemanjai accepted this revision.Nov 30 2021, 4:02 AM

Seems fine to me but maybe give @MaskRay a couple of days to see if this adequately addresses his comment.

This revision is now accepted and ready to land.Nov 30 2021, 4:02 AM
This revision was automatically updated to reflect the committed changes.

LGTM (in a trip, slow to reply)