Skip to content
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

Backport clang resource-header fixes from next #5168

Merged

Conversation

etcwilde
Copy link

@etcwilde etcwilde commented Aug 20, 2022

Cherry-picking changes from next that remove the files that get installed by multiple targets.
This fixes the failing Xcode generator configuration failure for Swift.

@etcwilde etcwilde requested a review from compnerd August 20, 2022 06:32
@etcwilde
Copy link
Author

@swift-ci please test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that I am tempted to say that this is better done as cherry-picking the revert and re-application instead. I don't see anything egregiously incorrect in the application as done, but the serial cherry-picks makes it easier to associate the change with the upstream changes.

git cherry-pick -x 38822b98fa3b9d740b9a68b0de34296205d20819 a70cf56d20b956fc008d24420e14226127ba9f4a

would also make it easier to associate this this with the reported issue upstream at llvm#55002.

clang/lib/Headers/CMakeLists.txt Outdated Show resolved Hide resolved
ye-luo and others added 2 commits August 20, 2022 08:12
… Installation Targets"

Caused build failure see github issue llvm#55002

This reverts commit 2512a87.

(cherry picked from commit 38822b9)
… Installation Targets

The goal of this patch is to improve distribution build's flexibility to include only applicable header files.

Currently, the clang-resource-headers target contains nearly all the files in clang/lib/Headers. Most of these files are platform specific (e.g. immintrin.h is x86 specific). A distribution build will have to either include all the headers for all the platforms, or not include any headers. For example, if a distribution build for powerpc includes the clang-resource-headers target, it will include all the x86 specific headers, even-though the x86 specific headers cannot be used.

This patch breaks up the clang-resource-headers list to a core list and platform specific lists. With the patch, a distribution build can now include the ppc-resource-headers to include the headers applicable to the powerpc platform.

Specifically, one can now have

cmake ... LLVM_DISTRIBUTION_COMPONENTS="clang;ppc-resource-headers" ... ../llvm
ninja install-distribution then installs the powerpc headers.

Similarly, one can do

cmake ... LLVM_DISTRIBUTION_COMPONENTS="clang;x86-resource-headers" ... ../llvm
to include headers applicable to the x86 platform in a distribution installation.

To implement this behaviour, the patch does two things

It breaks up the long files header file list to a core list and platform specific lists.
It adds numerous platform specific installation targets.

Differential Revision: https://reviews.llvm.org/D123498

(cherry picked from commit a70cf56)
@etcwilde
Copy link
Author

@swift-ci please test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@etcwilde etcwilde merged commit 5b64671 into swiftlang:stable/20220421 Aug 20, 2022
@etcwilde etcwilde deleted the ewilde/fix-xcode-generator branch August 20, 2022 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants