This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Don't include the device wrappers if -nostdinc is used
ClosedPublic

Authored by jhuber6 on May 9 2022, 12:55 PM.

Details

Summary

OpenMP uses several wrapper hearders to provide the definitions of
needed symbols contained in the host. However, some users may use the
-nostdinc option to override these definitions themselves. The OpenMP
wrapper headers are stored in the same location as the clang install. If
the user passes -nostdinc then this include directory is never looked
at by default which means that including these wrappers will always
fail. These headers should instead be included manually if they are
needed with a -nostdinc build.

Diff Detail

Event Timeline

jhuber6 created this revision.May 9 2022, 12:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2022, 12:55 PM
jhuber6 requested review of this revision.May 9 2022, 12:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2022, 12:55 PM
tra added inline comments.May 9 2022, 1:00 PM
clang/lib/Driver/ToolChains/Clang.cpp
1311

Did you mean nostdinc ?

jhuber6 added inline comments.May 9 2022, 1:02 PM
clang/lib/Driver/ToolChains/Clang.cpp
1311

Yes, thank you for catching that. That was an autocomplete mishap that I accidentally reintroduced from undoing too many times. I'll fix it.

jhuber6 updated this revision to Diff 428181.May 9 2022, 1:02 PM

Fix using nostdlib instead of nostdinc

tra accepted this revision.May 9 2022, 1:07 PM

LGTM in general.

clang/lib/Driver/ToolChains/Clang.cpp
1311

A test would be useful.

This revision is now accepted and ready to land.May 9 2022, 1:07 PM