Owner of platform runtime ordering after trailing C/C++ static archives on aarch64 Linux
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- build-system, tooling
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Starlark
- スター
- 857
- フォーク
- 701
- 平均マージ
- 4日 7時間
- マージ済み PR(30日)
- 46
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bazelbuild/rules_rust のほかの issue
-
`rust_test(crate = ...)` does not stage the crate's transitive dynamic libraries into runfiles対応中かも @Wito-1 が 65 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
bazelbuild/rules_rust#4309 ·
メンテナーはふだん 3 日以内に返信
-
Windows (no-symlink path): drain_runfiles_dir_windows deletes retained runfiles — inverted filename_suffixes_to_retain condition対応中かも @Mattbusel が 17 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
bazelbuild/rules_rust#4266 ·
メンテナーはふだん 3 日以内に返信
-
rust.toolchain(strip_level = ...) is silently ignored対応中かも @Mattbusel が 17 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
bazelbuild/rules_rust#4223 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
bazelbuild/rules_rust#4152 · リアクション 1 件 ·
メンテナーはふだん 3 日以内に返信
-
awaiting-response
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bazelbuild/rules_rust#3599 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
bazelbuild/rules_rust の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
bazelbuild/apple_support#707 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
out-of-date
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CachyOS/CachyOS-PKGBUILDS#2232 ·
メンテナーはふだん 1 日以内に返信
-
blast/large refactor risk/low spend-dem
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
chriskelly/MusicWall#87 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
neilotoole/sq#1503 ·
メンテナーはふだん 1 日以内に返信