Skip to content

Commit 65d1a73

Browse files
committed
Auto merge of #125999 - XrXr:dist-aarch64-gcc-13, r=Kobzol
ci: use GCC 13 as cross compiler in `dist-aarch64-linux` I'm proposing this GCC upgrade since it addresses bug #125619. The regression in question affects stable release consumers who tend to have no exposure to Rust build tools, so if at all possible, I would like to have it resolved in the next stable release. I have tried to fix the bug in `compiler-builtins`, which led to submitting a PR for `compiler-rt` in upstream LLVM, but it may take a long time before these upstreams address this regression. A summary of why upgrading GCC solves the regression follows. `__multc3()` is a builtin function `compiler-builtins` exposes for specifically aarch64, non-Windows targets [1]. The object file for it is included in `staticlib` archives through `libstd`. The implementation for `__multc3()` is from `multc3.c`, part of LLVM's `compiler-rt`. Upstream `compiler-rt` normally builds the C file using the Clang from the same LLVM version. On the other hand, `compiler-builtins` builds the C file using GCC, outside of the usual LLVM build system. The upstream implementation doesn't have feature detection which works for GCC version older than 10, and ends up producing an unlinkable object. Upstream LLVM might be slow to respond to this issue as they might deem `compiler-builtin` as doing something out of the ordinary from their perspective. They might reasonably assume everyone builds `compiler-rt` through LLVM's build system. I have done the following to test this change: - verified that a local build without this patch exhibits the regression. - verified that with this patch, the object for `__multc3()` has no reference to undefined functions in the symbol table. - verified that with this patch, `rustc` is usable to build Ruby with YJIT, and that the reported regression is resolved. Since `loongarch64-linux-gnu` already uses GCC 13.2.0, I hope we can upgrade without issues. try-job: dist-aarch64-linux [1]: https://github.com/rust-lang/compiler-builtins/blob/c04eb9e1afb72bdf943f5e5d77b3812f40526602/build.rs#L524-L539
2 parents 7bb0ef4 + dca68e9 commit 65d1a73

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/ci/docker/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ For targets: `aarch64-unknown-linux-gnu`
233233
- Operating System > Linux kernel version = 4.1.49
234234
- Binary utilities > Version of binutils = 2.29.1
235235
- C-library > glibc version = 2.17 -- aarch64 support was introduced in this version
236-
- C compiler > gcc version = 8.5.0
236+
- C compiler > gcc version = 13.2.0
237237
- C compiler > C++ = ENABLE -- to cross compile LLVM
238238
239239
### `i586-linux-gnu.defconfig`

src/ci/docker/host-x86_64/dist-aarch64-linux/aarch64-linux-gnu.defconfig

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@ CT_ARCH_ARM=y
66
CT_ARCH_64=y
77
CT_KERNEL_LINUX=y
88
CT_LINUX_V_4_1=y
9-
CT_BINUTILS_V_2_29=y
109
CT_GLIBC_V_2_17=y
11-
CT_GCC_V_8=y
1210
CT_CC_LANG_CXX=y

0 commit comments

Comments
 (0)