Owner of platform runtime ordering after trailing C/C++ static archives on aarch64 Linux
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- build-system, tooling
Direzione di ricerca
Start by reading the issue’s reference cc_library and Rust targets, then compare the trailing archive and runtime library ordering in the rules_rust link arguments. The report confirms the workaround on a pinned ARM64 executor but says the original failure came from a full native archive and has no current upstream reproduction. Establish a minimal regression and determine which linking layer owns the ordering before proposing a fix.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On aarch64 Linux with rules_rust 0.74.0, a native static archive reached through a Rust rlib can appear in the trailing C/C++ linker arguments, after rustc's system libraries. Our distribution binaries then failed to resolve aarch64 outline-atomic helpers and the loader's stack-protector guard from the archive. Repeating -lgcc -lc after the archive fixes our pinned downstream builds and exact-image startup.
We would like to remove that target-specific workaround rather than make the Cargo-graph emitter choose platform runtime libraries. Is the intended owner the C++ toolchain, the Rust native-dependency ordering, or a supported interface we have missed?
The reference shape is:
cc_library(
name = "atomics",
srcs = ["atomics.c"],
copts = ["-fstack-protector-all", "-moutline-atomics"],
)
rust_library(name = "shim", srcs = ["shim.rs"], edition = "2024", deps = [":atomics"])
rust_test(
name = "canary",
srcs = ["canary.rs"],
edition = "2024",
deps = [":shim"],
rustc_flags = ["-Clink-arg=-lgcc", "-Clink-arg=-lc"],
)
The C object uses a local character buffer with strncpy/strlen, __atomic_compare_exchange_n on a uint16_t, __atomic_fetch_or on a uint8_t, and __atomic_fetch_and on a uint32_t. The Rust shim owns the extern "C" reference in an rlib; the test calls the shim. This preserves the trailing-archive shape that our V8 objects use, without V8's additional Rust Temporal dependencies.
The shim control with the repeated libraries has been executed successfully on the pinned Linux ARM64 executor. The original failures came from the full native archive. I am not claiming an executed negative shim control or a reproduction on current upstream main. Existing discussion #2458 concerns incompatible unwind/runtime selection; this question concerns ordering with the admitted GNU toolchain. #1488 may be related to the longer-term linking owner.
Would you prefer a targeted rules_rust regression first, a toolchain-level recipe, or investigation in rustc? We will retain the downstream workaround until its full native linking behavior is established.
Assisted-by: OpenAI Codex
- Lingua principale
- Starlark
- Stelle
- 857
- Fork
- 701
- Merge medio
- 4g 7h
- PR unite (30g)
- 46
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bazelbuild/rules_rust
-
`rust_test(crate = ...)` does not stage the crate's transitive dynamic libraries into runfilesForse già presa @Wito-1 l’ha presa 66 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
bazelbuild/rules_rust#4309 ·
I maintainer di solito rispondono entro 3 giorni
-
Windows (no-symlink path): drain_runfiles_dir_windows deletes retained runfiles — inverted filename_suffixes_to_retain conditionForse già presa @Mattbusel l’ha presa 17 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
bazelbuild/rules_rust#4266 ·
I maintainer di solito rispondono entro 3 giorni
-
rust.toolchain(strip_level = ...) is silently ignoredForse già presa @Mattbusel l’ha presa 17 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
bazelbuild/rules_rust#4223 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
bazelbuild/rules_rust#4152 · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
-
awaiting-response
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bazelbuild/rules_rust#3599 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di bazelbuild/rules_rust
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
bazelbuild/apple_support#707 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
blocky: new version 0.38.0Apertaout-of-date
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CachyOS/CachyOS-PKGBUILDS#2232 ·
I maintainer di solito rispondono entro 1 giorno
-
blast/large refactor risk/low spend-dem
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
chriskelly/MusicWall#87 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
neilotoole/sq#1503 ·
I maintainer di solito rispondono entro 1 giorno