Pick llvm-ar when using clang and present#602
Merged
Conversation
Signed-off-by: Uilian Ries <uilianries@gmail.com>
grafikrobot
approved these changes
Jul 9, 2026
Contributor
Author
|
Thank you for your quick review! 👏 |
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.
Proposed changes
Greetings! 👋
During a few and less intrusive scenario validations using Boost 1.91.0 on Windows x86_64, when trying to cross-build to Android ARMv8, was found a gap in
clang-linux.jamwhen building a static library (Boost.Context, for instance) withtoolset=clang(NDK's unified LLVM toolchain, r23+), the archive step fails:You can observe my full build log (without Conan) here: boost-1.91.0-windows-android.log
The
clang-linux.jamfalls back to.AR = ar ;fromgcc.jamwhen no<archiver>option or<root>-derived path is configured. It works okay on Linux, wherearis available, but on Windows, users will need to consume from thellvm-aravailable in the NDK.This PR makes
clang-linux.jamsearch forllvm-arnext to the resolved compiler before falling back to theardefault, so Windows to Android scenario (and any other LLVM-only, no-artoolchain) cross-builds work without requiring an explicit<archiver>option.I applied this patch directly to boost-1.91.0 for validation. I know it's not same commit as the latest release in b2, but this behavior is still the same in both b2 5.5.1 and that version in boost 1.91.0.
After applying my patch I can build on Windows with success: boost-1.91.0-windows-android-patched.log
Environment
Steps to Reproduce
user-config.jam:b2 install --user-config=user-config.jam toolset=clang link=static target-os=android architecture=arm address-model=64 abi=aapcs binary-format=elf --with-context -j1Archiver should fail with "
arisn't found anywhere onPATH"Types of changes
What types of changes does your code introduce?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If you are okay with this PR. Just let me know how to add a new test in case wanting to cover a regression. Regards!