This is an archive of the discontinued LLVM Phabricator instance.

[clang][driver][AIX] Add system libc++ header paths to driver
ClosedPublic

Authored by daltenty on Sep 1 2021, 11:19 AM.

Details

Summary

This change adds the system libc++ header location to the driver. As well we define
the __LIBC_NO_CPP_MATH_OVERLOADS__ macro when using those headers, in order to suppress
conflicting C++ overloads in the system libc headers that were used by XL C++.

Diff Detail

Event Timeline

daltenty requested review of this revision.Sep 1 2021, 11:19 AM
daltenty created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2021, 11:19 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
daltenty edited the summary of this revision. (Show Details)Sep 1 2021, 11:19 AM
ZarkoCA added inline comments.Sep 2 2021, 9:40 AM
clang/lib/Driver/ToolChains/AIX.cpp
237

Maybe a comment as to why we need this, something like:

// Required  order to suppress conflicting C++ overloads in the system libc headers that were used by XL C++
240–242

nit: it would be my preference to have the error case first but I also that AIX::AddCXXStdlibLibArgs is set up the same way so keeping them consistent may be more important.

daltenty added inline comments.Sep 7 2021, 7:49 AM
clang/lib/Driver/ToolChains/AIX.cpp
240–242

Flipping the cases in both places for consistency should be fairly straight forward, so I think that's ok.

daltenty updated this revision to Diff 371078.Sep 7 2021, 7:52 AM
  • Address review comments
ZarkoCA added inline comments.Sep 10 2021, 7:41 AM
clang/test/Driver/aix-toolchain-include.cpp
31

It looks like this test is failing the pre-merge check on the x86 bot because this variable isn't captured correctly.
From what I can see, I think you can fix this by capturing it in the RUN line instead.

Eg. I found this test/Driver/darwin-header-search-libcxx.cpp and https://llvm.org/docs/CommandGuide/FileCheck.html#cmdoption-filecheck-d-var.

daltenty added inline comments.Sep 14 2021, 2:26 PM
clang/test/Driver/aix-toolchain-include.cpp
31

Hmm, it seems it's not so much that the capture isn't working, but likely that we don't expect windows directory separators in the match. Regardless, I'll update the test.

daltenty updated this revision to Diff 372566.Sep 14 2021, 2:28 PM
  • Update check patttern to allow windows directory seperators
daltenty updated this revision to Diff 372570.Sep 14 2021, 3:05 PM
  • Fix additional test cases
ZarkoCA accepted this revision.Sep 15 2021, 5:25 AM

Thanks, LGTM.

This revision is now accepted and ready to land.Sep 15 2021, 5:25 AM