-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[libcxx] Fix include directory order #65859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tzdb is currently broken when cross compiling from non Linux to Linux. Lets just disable it totally in our toolchain for now. We should remove this when llvm#65859 lands.
tzdb is currently broken when cross compiling from non Linux to Linux. Lets just disable it totally in our toolchain for now. We should remove this when #65859 lands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abrachet Can you write a more descriptive commit message. Please explain why the current order is wrong.
Requesting changes since I want to understand the patch before it's merged. When it's important it should be commented in the code too.
55f2ae4
to
5c19cb8
Compare
Updated the commit message |
Can you add this part as comment in the code too? |
It's important that the arch directory be included first so that its header files which interpose on the default include dir be included instead of the default ones. The clang driver [1] does this when not building with -nostdinc, the libcxx build should do the same. We found this after https://reviews.llvm.org/D154282 when cross compiling from non Linux to Linux. If the host machine was not Linux, _LIBCPP_HAS_NO_TIME_ZONE_DATABASE would be defined in the default include dir __config_site, while it was undefined in the arch specific one causing build failures.
5c19cb8
to
e88e2a8
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please make sure that when landing the PR message is updated to the message of the commit. (I'm not sure whether GitHub does that automatically.)
It was my understanding that libc++ didn't have any duplicate headers in the include/ and target include directory. Are you guys doing something weird? |
When [1] https://github.com/llvm/llvm-project/blob/main/libcxx/CMakeLists.txt#L438 |
This is only an issue on Darwin; on other platforms we install the target specific files such as |
tzdb is currently broken when cross compiling from non Linux to Linux. Lets just disable it totally in our toolchain for now. We should remove this when llvm#65859 lands.
It's important that the arch directory be included first so that its header files which interpose on the default include dir be included instead of the default ones. The clang driver [1] does this when not building with -nostdinc, the libcxx build should do the same. We found this after https://reviews.llvm.org/D154282 when cross compiling from non Linux to Linux. If the host machine was not Linux, _LIBCPP_HAS_NO_TIME_ZONE_DATABASE would be defined in the default include dir __config_site, while it was undefined in the arch specific one causing build failures.
Arch dir needs to go first.