This is an archive of the discontinued LLVM Phabricator instance.

[libc] Prevent system headers from being included for the GPU build
ClosedPublic

Authored by jhuber6 on Sep 5 2023, 6:17 AM.

Details

Summary

It's very important that the GPU build does not include any system
directories. We currently use -ffreestanding to disable a lot of these
features, but we can still accidentally include them if they are not
provided by libc yet. This patch changes this to use -nostdinc to
disable all standard search paths. Then we use the compiler's resource
directory to pick up the provided headers like stdint.h.

Diff Detail

Event Timeline

jhuber6 created this revision.Sep 5 2023, 6:17 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 5 2023, 6:17 AM
jhuber6 requested review of this revision.Sep 5 2023, 6:17 AM
JonChesterfield accepted this revision.Sep 5 2023, 6:20 AM

Fixes the build for me (previously, was trying to include inttypes from /usr)

This revision is now accepted and ready to land.Sep 5 2023, 6:20 AM
This revision was landed with ongoing or failed builds.Sep 5 2023, 6:45 AM
This revision was automatically updated to reflect the committed changes.