Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
[build.env]
passthrough = ["JEMALLOC_SYS_WITH_LG_PAGE"]

# The default x86_64-unknown-linux-gnu cross image (Ubuntu 20.04) ships GCC 9.x,
# which is affected by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189 (a memcmp
# miscompilation). aws-lc-sys >= 0.33 hard-panics with "### COMPILER BUG DETECTED ###"
# when it finds this compiler, breaking the build. Install GCC 10 (10.3.0, in the
# "known to work" set) and point gcc/g++/cc at it so every C dependency builds with it.
# aarch64 is unaffected: it's a true cross-compile, so aws-lc-sys can't run its probe
# binary and skips the check entirely.
[target.x86_64-unknown-linux-gnu]
pre-build = [
"apt-get update && apt-get install --assume-yes gcc-10 g++-10",
"update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10",
"update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100",
]
Comment on lines +12 to +16

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Does update-alternatives --installswitch the active alternative when a group is already in manual mode, or is an explicit--set required?

💡 Result:

When a link group is in manual mode, the update-alternatives --install command will add the new alternative to the group's list of options, but it will not switch the active alternative [1][2]. The system respects the administrator's previous manual selection and will not automatically update the symlinks, even if the newly installed alternative has a higher priority [1][3][2]. To switch the active alternative in this scenario, you must either: 1. Use the --config command to interactively select the desired alternative [4]. 2. Use the --set command to explicitly define the active alternative [3]. In summary, an explicit action by the administrator is required to change the active link when the group is in manual mode [1][2].

Citations:


Force-select GCC 10 after registering the alternatives.

update-alternatives --install only adds the choice; if the group is already in manual mode, gcc/cc can stay on the previous compiler. Add explicit --set for both groups so the x86 build actually uses GCC 10.

Suggested patch
 pre-build = [
     "apt-get update && apt-get install --assume-yes gcc-10 g++-10",
     "update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10",
     "update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100",
+    "update-alternatives --set gcc /usr/bin/gcc-10",
+    "update-alternatives --set cc /usr/bin/gcc-10",
 ]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pre-build = [
"apt-get update && apt-get install --assume-yes gcc-10 g++-10",
"update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10",
"update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100",
]
pre-build = [
"apt-get update && apt-get install --assume-yes gcc-10 g++-10",
"update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10",
"update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100",
"update-alternatives --set gcc /usr/bin/gcc-10",
"update-alternatives --set cc /usr/bin/gcc-10",
]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Cross.toml` around lines 12 - 16, The Cross.toml pre-build setup only
registers GCC 10 with update-alternatives but does not force it to become the
active compiler. Update the pre-build commands so that after the existing
update-alternatives --install calls, both the gcc and cc groups are explicitly
selected to GCC 10 using --set, ensuring the x86 build uses the intended
compiler; keep the change within the pre-build array where the gcc/cc
alternatives are configured.

Loading