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

Fix ABI detection for empty 'os.platform' #283

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

iv-m
Copy link
Contributor

@iv-m iv-m commented Jan 23, 2025

in operator in bjam always returns true if its first argument has no elements[1]. This means that if os.platform is empty (not detected), the construction introduced in commit 9084161 sets ABI to aapcs on all platforms where os.platform is empty, including, e.g. loongarch64, and breaks build there.

This commit refactors the condition to use '=' operator, to make sure that when os.platform is empty we get the default ABI value, and thus fixes build on loongarch64.

See also 819c2d6 for similar fix that was somehow lost in refactorings. This time a comment is added near the condition in hope that future edits will not reintroduce the issue.

[1] https://www.boost.org/doc/libs/1_83_0/tools/build/doc/html/index.html#jam.language.flow_of_control

Fixes: 9084161

`in` operator in bjam always returns true if its first
argument has no elements[1]. This means that if `os.platform`
is empty (not detected), the construction introduced
in commit 9084161 sets
ABI to `aapcs` on all platforms where `os.platform` is
empty, including, e.g. loongarch64, and breaks build there.

This commit refactors the condition to use '=' operator,
to make sure that when `os.platform` is empty we get
the default ABI value, and thus fixes build on loongarch64.

See also 819c2d6 for
similar fix that was somehow lost in refactorings. This
time a comment is added near the condition in hope
that future edits will not reintroduce the issue.

[1] https://www.boost.org/doc/libs/1_83_0/tools/build/doc/html/index.html#jam.language.flow_of_control

Fixes: 9084161
@iv-m
Copy link
Contributor Author

iv-m commented Jan 23, 2025

I faced this issue when building boost 1.87.0 on loongarch64. The b2 output and fix are similar to #234:

error: No best alternative for /usr/src/RPM/BUILD/boost-1.87.0/libs/context/build/asm_sources with <abi>aapcs <address-model>64 <architecture>loongarch <asynch-exceptions>off <binary-format>elf <boost.beast.allow-deprecated>on <boost.beast.separate-compilation>on <boost.cobalt.executor>any_io_executor <boost.cobalt.pmr>std <boost.process.fs>boost <context-impl>fcontext <coverage>off <debug-symbols>off <exception-handling>on <extern-c-nothrow>off <inlining>full <known-warnings>hide <link>shared <optimization>off <os>LINUX <pch>off <preserve-test-targets>on <profiling>off <python-debugging>off <python>3.12 <relevant>abi <relevant>address-model <relevant>architecture <relevant>binary-format <relevant>toolset <rtti>on <runtime-debugging>off <runtime-link>shared <stdlib>native <strip>off <target-os>linux <testing.execute>on <threadapi>pthread <threading>multi <toolset-gcc:version>14 <toolset>gcc <variant>release <vectorize>off <visibility>hidden <warnings-as-errors>off <warnings>on <x-deduced-platform>loongarch_64

@olk
Copy link
Member

olk commented Jan 24, 2025

ty

@olk olk merged commit 1cfab77 into boostorg:develop Jan 24, 2025
20 of 23 checks passed
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