Skip to content

[ATfL][build] Add the ability to bypass the bootstrap building with a provided bootstrap compiler - #941

Open
pawosm-arm wants to merge 1 commit into
arm-softwarefrom
users/pawosm-arm/atfl-build-no-bootstrap
Open

[ATfL][build] Add the ability to bypass the bootstrap building with a provided bootstrap compiler#941
pawosm-arm wants to merge 1 commit into
arm-softwarefrom
users/pawosm-arm/atfl-build-no-bootstrap

Conversation

@pawosm-arm

Copy link
Copy Markdown
Contributor

This is to avoid the issues caused by the aging GCC versions by removing the GCC compiler from the picture.

@pawosm-arm
pawosm-arm requested a review from a team as a code owner July 20, 2026 11:15
if [[ -e "${BOOTSTRAP_COMPILER_DIR}/bin/clang++" ]]; then
echo "Using the existing bootstrap compiler."
export PATH="${BOOTSTRAP_COMPILER_DIR}/bin:${PATH}"
bootstrap_compiler_default_config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think it is good practice to modify the configuration file of an externally provided toolchain. Also USE_BOOTSTRAP_CMAKE_FLAGS already uses the CMake setting -DLLVM_ENABLE_LLD=ON to ensure that the lld linker is used by the subsequent stages. So I think bootstrap_compiler_default_config is unnecessary and we can completely remove bootstrap_compiler_default_config from this script. That also will remove the requirement of the bootstrap compiler location having to be writable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sadly, this git log does not go that far back so there's no log of the justification behind forcing to use LLD the most brutal way ever. We may first try to introduce an PR which lifts that and see if anything fails (could be the reason behind it was to workaround some upstream issue haunting the building process at that time) and if it is not failing, we would effectively get rid of it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah that makes sense. Let's test that cleanup separately ASAP.

@pawosm-arm pawosm-arm Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BTW, this bootstrap compiler directory still needs to be writable, there's no way to pass LD_LIBRARY_PATH to lit tests executed by check-all anymore (there was an long an annoying discussion why there is no going back to this), so forcing the use of Rpath in the compiler's config file is the only way to do it:

    echo "-Wl,-rpath=${ATFL_DIR}/lib" >> "${BUILD_DIR}"/bootstrap_compiler/bin/clang++.cfg
    run_test_command "${LOGS_DIR}/product_check_all.xml" "${LOGS_DIR}/product.txt" check-all

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah that makes sense. Let's test that cleanup separately ASAP.

#1042

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Apparently, -DLLVM_ENABLE_LLD=ON applies only to build time, and the default linker (GNU ld) is being used when testing. And this reveals two problems in RHEL8: one is that GNU ld needs explicit -ldl for many of the libcxx test files, and second one is more worrying, the code linked with GNU ld fails with exceptions. And the second issue cannot be solved by adding any more flags, it just needs to be linked with lld to make it pass on RHEL8.

I'm not sure how much we want to invest in solving it. If not much, then we'd better revert it.

export PATH="${BUILD_DIR}/bootstrap_compiler/bin:${PATH}"
export PATH="${BOOTSTRAP_COMPILER_DIR}/bin:${PATH}"
bootstrap_compiler_default_config
run_test_command "${LOGS_DIR}/bootstrap_check_all.xml" "${LOGS_DIR}/bootstrap_compiler.txt" check-all

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On early return when an external bootstrap compiler is used, "${LOGS_DIR}/bootstrap_check_all.xml" will not be created. However check_lit_xml_results unconditionally expects "${LOGS_DIR}/bootstrap_check_all.xml" to be there and fails if it does not exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've added a line for XML file creation, and also rebased this PR so it could be merged cleanly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well, not rebased to the top, as the topmost change needs to be verified first.

@amilendra
amilendra removed the request for review from schander-arm September 7, 2026 10:07
… provided bootstrap compiler

This is to avoid the issues caused by the aging GCC versions by
removing the GCC compiler from the picture.
@pawosm-arm
pawosm-arm force-pushed the users/pawosm-arm/atfl-build-no-bootstrap branch from b24956a to ff30a97 Compare September 7, 2026 15:40
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.

2 participants