Bug: rust_binary linking fails for linux_aarch64_score_gcc_12_2_0_posix with non-PIC and missing outline atomic symbols
@dcalavrezo-qorix is already working on this.
Since Jul 17, 2026.
Assessment
This issue has not been assessed yet.
Description
Description
Building any rust_binary that depends on C++ static libraries fails when using --config linux_aarch64_score_gcc_12_2_0_posix.
Root Causes (two distinct issues):
- Non-PIC static libraries + PIE linker default
The score_gcc_aarch64_toolchain (GCC 12.2.0) is built without --enable-default-pie, meaning its static C++ and system libraries (e.g. libacl) are compiled without -fPIC
The Rust linker defaults to -pie (Position Independent Executable) on Linux for security
Linking non-PIC objects with -pie causes relocation errors against symbols.
- Missing aarch64 outline atomic helpers
GCC 12.2.0 generates calls to outline atomic helper functions (__aarch64_ldadd4_acq_rel, __aarch64_cas2_acq_rel, __aarch64_swp4_acq_rel, __aarch64_ldset4_acq_rel) for aarch64.
Analysis results
No response
Solution
We need to add - --@rules_rust//:extra_rustc_flags=-Clink-arg=-no-pie, -Clink-arg=-lgcc
Error Occurrence Rate
None
How to reproduce
bazel build //score/mw/com/example/com-api-example --config linux_aarch64_score_gcc_12_2_0_posix
Supporting Information
No response
Classification
Minor
First Affected Release
not released (main)
Last Affected Release
not released (main)
Expected Fixed Release
before release (main)
Category
- Safety Relevant
- Security Relevant
- Dominant language
- Starlark
- Stars
- 1
- Forks
- 11
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-score/toolchains_rust
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
bug
eclipse-score/toolchains_rust#33 · 1 comment · 1 assignee ·