[ATfL][build] Have the clang binary bolted#832
Open
pawosm-arm wants to merge 1 commit intoarm-softwarefrom
Open
[ATfL][build] Have the clang binary bolted#832pawosm-arm wants to merge 1 commit intoarm-softwarefrom
pawosm-arm wants to merge 1 commit intoarm-softwarefrom
Conversation
004afc5 to
3e38929
Compare
This patch tries to reuse the available stage2 mechanism for bolting the clang binary. As the currently available mechanism has its limitations, we had to introduce a lot of glue in order to make it certain that the effective clang binary is functionally the same as the one we were shipping thus far. Also we wanted it to be linked against the prebuilt libc++ binary. Some of the points to notice: - Currently clang with the assertions turned on cannot be bolted; subject to ongoing investigation. - To make it easier to inject our CMake settings into the BOLT.cmake file, they had to be rearranged into several BASH associative arrays. - The stage2 build has no install target and no proper testing target, therefore the bolted clang binary replaces the one produced in the product_build stage, and then it participates in the check-all round of tests. - The COMMON_CMAKE_FLAGS variable should not be passed to the build.sh script anymore. A check for this has been added.
3e38929 to
9f839f8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the ATfL Linux build script to reuse LLVM’s existing stage2 (PGO/BOLT) mechanism to produce a bolted clang binary, ensuring it matches the previously shipped behavior and links against the prebuilt libc++.
Changes:
- Add a
product_boltedstage that builds a bolted clang via the stage2/PGO+BOLT cache mechanism, and swaps it intoproduct_buildprior tocheck-alland install. - Refactor CMake configuration from positional arrays into multiple bash associative arrays and generate
-C flags.cmakecache files to inject settings consistently across stages. - Fail early if the obsolete
COMMON_CMAKE_FLAGSenvironment variable is set.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| print_forced_cmake_flags_cache() | ||
| { | ||
| declare -A arr="${1#*=}" |
|
|
||
| mkdir -p "${BUILD_DIR}/stage/product_bolted" | ||
| cd "${BUILD_DIR}/stage/product_bolted" | ||
| mkdir cmake-caches |
| run_command cmake --build . ${CMAKE_BUILD_ARGS} 2>&1 | tee -a "${LOGS_DIR}/product.txt" | ||
| if [[ "${ATFL_ASSERTIONS}" == "OFF" ]]; then | ||
| local clang_name | ||
| clang_name="$(readlink bin/clang)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch tries to reuse the available stage2 mechanism for bolting the clang binary. As the currently available mechanism has its limitations, we had to introduce a lot of glue in order to make it certain that the effective clang binary is functionally the same as the one we were shipping thus far. Also we wanted it to be linked against the prebuilt libc++ binary.
Some of the points to notice:
Currently clang with the assertions turned on cannot be bolted; subject to ongoing investigation.
To make it easier to inject our CMake settings into the BOLT.cmake file, they had to be rearranged into several BASH associative arrays.
The stage2 build has no install target and no proper testing target, therefore the bolted clang binary replaces the one produced in the product_build stage, and then it participates in the check-all round of tests.
The COMMON_CMAKE_FLAGS variable should not be passed to the build.sh script anymore. A check for this has been added.