-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid aarch64-unknown-none
target produced if the CC_aarch64_unknown_none
env var is not set
#111142
Labels
A-cross
Area: Cross compilation
C-bug
Category: This is a bug.
O-AArch64
Armv8-A or later processors in AArch64 mode
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Comments
@rustbot label O-AArch64 |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 9, 2023
…r-ozkan Prevent using the default `cc` when that'd result in a broken build This PR adds a check in bootstrap to prevent issues like rust-lang#111142 to happen. What happened there is, no compiler for `aarch64-unknown-none` was detected by bootstrap, and so the `cc` crate defaulted to the system host C compiler. That resulted in a broken target, as `libcompiler_builtins.rlib` (or well anything compiling C code in its build script) contained half the object files compiled for aarch64 and half of them compiled for x86_64. The check added in the PR ensures that, for cross-compilation, the detected C compiler is not the same one as the host compiler, unless the detected compiler is clang (as it supports all targets from a single binary). This should not cause too many false positives, as for example a `./x build library --target i686-unknown-linux-gnu` still works from a x86_64 host. If a false positive occurs, the error message still explains the workaround. Example error message: ``` running: "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" cargo:warning= cargo:warning= Error: the automatic detection of the C compiler for cross-compiled cargo:warning= target aarch64-unknown-none returned the compiler also used for the cargo:warning= current host platform. cargo:warning= cargo:warning= This is likely wrong, and will likely result in a broken compilation cargo:warning= artifact. Please specify the correct compiler for that target, either cargo:warning= with environment variables: cargo:warning= cargo:warning= CC_aarch64_unknown_none=path/to/cc cargo:warning= CXX_aarch64_unknown_none=path/to/cxx cargo:warning= cargo:warning= ...or in config.toml: cargo:warning= cargo:warning= [target."aarch64-unknown-none"] cargo:warning= cc = "path/to/cc" cargo:warning= cxx = "path/to/cxx" cargo:warning= cargo:warning= The detected C compiler was: cargo:warning= cargo:warning= cc cargo:warning= exit status: 1 --- stderr error occurred: Command "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" with args "broken-cc" did not execute successfully (status code exit status: 1). Build completed unsuccessfully in 0:00:02 ``` Fixes rust-lang#111142 r? `@jyn514`
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 10, 2023
…r-ozkan Prevent using the default `cc` when that'd result in a broken build This PR adds a check in bootstrap to prevent issues like rust-lang#111142 to happen. What happened there is, no compiler for `aarch64-unknown-none` was detected by bootstrap, and so the `cc` crate defaulted to the system host C compiler. That resulted in a broken target, as `libcompiler_builtins.rlib` (or well anything compiling C code in its build script) contained half the object files compiled for aarch64 and half of them compiled for x86_64. The check added in the PR ensures that, for cross-compilation, the detected C compiler is not the same one as the host compiler, unless the detected compiler is clang (as it supports all targets from a single binary). This should not cause too many false positives, as for example a `./x build library --target i686-unknown-linux-gnu` still works from a x86_64 host. If a false positive occurs, the error message still explains the workaround. Example error message: ``` running: "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" cargo:warning= cargo:warning= Error: the automatic detection of the C compiler for cross-compiled cargo:warning= target aarch64-unknown-none returned the compiler also used for the cargo:warning= current host platform. cargo:warning= cargo:warning= This is likely wrong, and will likely result in a broken compilation cargo:warning= artifact. Please specify the correct compiler for that target, either cargo:warning= with environment variables: cargo:warning= cargo:warning= CC_aarch64_unknown_none=path/to/cc cargo:warning= CXX_aarch64_unknown_none=path/to/cxx cargo:warning= cargo:warning= ...or in config.toml: cargo:warning= cargo:warning= [target."aarch64-unknown-none"] cargo:warning= cc = "path/to/cc" cargo:warning= cxx = "path/to/cxx" cargo:warning= cargo:warning= The detected C compiler was: cargo:warning= cargo:warning= cc cargo:warning= exit status: 1 --- stderr error occurred: Command "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" with args "broken-cc" did not execute successfully (status code exit status: 1). Build completed unsuccessfully in 0:00:02 ``` Fixes rust-lang#111142 r? `@jyn514`
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 13, 2023
…r-ozkan Prevent using the default `cc` when that'd result in a broken build This PR adds a check in bootstrap to prevent issues like rust-lang#111142 to happen. What happened there is, no compiler for `aarch64-unknown-none` was detected by bootstrap, and so the `cc` crate defaulted to the system host C compiler. That resulted in a broken target, as `libcompiler_builtins.rlib` (or well anything compiling C code in its build script) contained half the object files compiled for aarch64 and half of them compiled for x86_64. The check added in the PR ensures that, for cross-compilation, the detected C compiler is not the same one as the host compiler, unless the detected compiler is clang (as it supports all targets from a single binary). This should not cause too many false positives, as for example a `./x build library --target i686-unknown-linux-gnu` still works from a x86_64 host. If a false positive occurs, the error message still explains the workaround. Example error message: ``` running: "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" cargo:warning= cargo:warning= Error: the automatic detection of the C compiler for cross-compiled cargo:warning= target aarch64-unknown-none returned the compiler also used for the cargo:warning= current host platform. cargo:warning= cargo:warning= This is likely wrong, and will likely result in a broken compilation cargo:warning= artifact. Please specify the correct compiler for that target, either cargo:warning= with environment variables: cargo:warning= cargo:warning= CC_aarch64_unknown_none=path/to/cc cargo:warning= CXX_aarch64_unknown_none=path/to/cxx cargo:warning= cargo:warning= ...or in config.toml: cargo:warning= cargo:warning= [target."aarch64-unknown-none"] cargo:warning= cc = "path/to/cc" cargo:warning= cxx = "path/to/cxx" cargo:warning= cargo:warning= The detected C compiler was: cargo:warning= cargo:warning= cc cargo:warning= exit status: 1 --- stderr error occurred: Command "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" with args "broken-cc" did not execute successfully (status code exit status: 1). Build completed unsuccessfully in 0:00:02 ``` Fixes rust-lang#111142 r? `@jyn514`
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 14, 2023
…r-ozkan Prevent using the default `cc` when that'd result in a broken build This PR adds a check in bootstrap to prevent issues like rust-lang#111142 to happen. What happened there is, no compiler for `aarch64-unknown-none` was detected by bootstrap, and so the `cc` crate defaulted to the system host C compiler. That resulted in a broken target, as `libcompiler_builtins.rlib` (or well anything compiling C code in its build script) contained half the object files compiled for aarch64 and half of them compiled for x86_64. The check added in the PR ensures that, for cross-compilation, the detected C compiler is not the same one as the host compiler, unless the detected compiler is clang (as it supports all targets from a single binary). This should not cause too many false positives, as for example a `./x build library --target i686-unknown-linux-gnu` still works from a x86_64 host. If a false positive occurs, the error message still explains the workaround. Example error message: ``` running: "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" cargo:warning= cargo:warning= Error: the automatic detection of the C compiler for cross-compiled cargo:warning= target aarch64-unknown-none returned the compiler also used for the cargo:warning= current host platform. cargo:warning= cargo:warning= This is likely wrong, and will likely result in a broken compilation cargo:warning= artifact. Please specify the correct compiler for that target, either cargo:warning= with environment variables: cargo:warning= cargo:warning= CC_aarch64_unknown_none=path/to/cc cargo:warning= CXX_aarch64_unknown_none=path/to/cxx cargo:warning= cargo:warning= ...or in config.toml: cargo:warning= cargo:warning= [target."aarch64-unknown-none"] cargo:warning= cc = "path/to/cc" cargo:warning= cxx = "path/to/cxx" cargo:warning= cargo:warning= The detected C compiler was: cargo:warning= cargo:warning= cc cargo:warning= exit status: 1 --- stderr error occurred: Command "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" with args "broken-cc" did not execute successfully (status code exit status: 1). Build completed unsuccessfully in 0:00:02 ``` Fixes rust-lang#111142 r? `@jyn514`
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 15, 2023
…r-ozkan Prevent using the default `cc` when that'd result in a broken build This PR adds a check in bootstrap to prevent issues like rust-lang#111142 to happen. What happened there is, no compiler for `aarch64-unknown-none` was detected by bootstrap, and so the `cc` crate defaulted to the system host C compiler. That resulted in a broken target, as `libcompiler_builtins.rlib` (or well anything compiling C code in its build script) contained half the object files compiled for aarch64 and half of them compiled for x86_64. The check added in the PR ensures that, for cross-compilation, the detected C compiler is not the same one as the host compiler, unless the detected compiler is clang (as it supports all targets from a single binary). This should not cause too many false positives, as for example a `./x build library --target i686-unknown-linux-gnu` still works from a x86_64 host. If a false positive occurs, the error message still explains the workaround. Example error message: ``` running: "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" cargo:warning= cargo:warning= Error: the automatic detection of the C compiler for cross-compiled cargo:warning= target aarch64-unknown-none returned the compiler also used for the cargo:warning= current host platform. cargo:warning= cargo:warning= This is likely wrong, and will likely result in a broken compilation cargo:warning= artifact. Please specify the correct compiler for that target, either cargo:warning= with environment variables: cargo:warning= cargo:warning= CC_aarch64_unknown_none=path/to/cc cargo:warning= CXX_aarch64_unknown_none=path/to/cxx cargo:warning= cargo:warning= ...or in config.toml: cargo:warning= cargo:warning= [target."aarch64-unknown-none"] cargo:warning= cc = "path/to/cc" cargo:warning= cxx = "path/to/cxx" cargo:warning= cargo:warning= The detected C compiler was: cargo:warning= cargo:warning= cc cargo:warning= exit status: 1 --- stderr error occurred: Command "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" with args "broken-cc" did not execute successfully (status code exit status: 1). Build completed unsuccessfully in 0:00:02 ``` Fixes rust-lang#111142 r? `@jyn514`
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 8, 2023
…r-ozkan Prevent using the default `cc` when that'd result in a broken build This PR adds a check in bootstrap to prevent issues like rust-lang#111142 to happen. What happened there is, no compiler for `aarch64-unknown-none` was detected by bootstrap, and so the `cc` crate defaulted to the system host C compiler. That resulted in a broken target, as `libcompiler_builtins.rlib` (or well anything compiling C code in its build script) contained half the object files compiled for aarch64 and half of them compiled for x86_64. The check added in the PR ensures that, for cross-compilation, the detected C compiler is not the same one as the host compiler, unless the detected compiler is clang (as it supports all targets from a single binary). This should not cause too many false positives, as for example a `./x build library --target i686-unknown-linux-gnu` still works from a x86_64 host. If a false positive occurs, the error message still explains the workaround. Example error message: ``` running: "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" cargo:warning= cargo:warning= Error: the automatic detection of the C compiler for cross-compiled cargo:warning= target aarch64-unknown-none returned the compiler also used for the cargo:warning= current host platform. cargo:warning= cargo:warning= This is likely wrong, and will likely result in a broken compilation cargo:warning= artifact. Please specify the correct compiler for that target, either cargo:warning= with environment variables: cargo:warning= cargo:warning= CC_aarch64_unknown_none=path/to/cc cargo:warning= CXX_aarch64_unknown_none=path/to/cxx cargo:warning= cargo:warning= ...or in config.toml: cargo:warning= cargo:warning= [target."aarch64-unknown-none"] cargo:warning= cc = "path/to/cc" cargo:warning= cxx = "path/to/cxx" cargo:warning= cargo:warning= The detected C compiler was: cargo:warning= cargo:warning= cc cargo:warning= exit status: 1 --- stderr error occurred: Command "/home/pietro/r/github/rust-lang/rust/2/build/bootstrap/debug/broken-cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "--broken-cc-target=aarch64-unknown-none" "--broken-cc-detected=cc" "-I" "/home/pietro/r/github/rust-lang/rust/2/src/llvm-project/compiler-rt/lib/builtins" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/ea072bc2688e9ac2-lse_cas1_relax.o" "-c" "/home/pietro/r/github/rust-lang/rust/2/build/x86_64-unknown-linux-gnu/stage0-std/aarch64-unknown-none/release/build/compiler_builtins-13da5a491a5cb882/out/lse_cas1_relax.S" with args "broken-cc" did not execute successfully (status code exit status: 1). Build completed unsuccessfully in 0:00:02 ``` Fixes rust-lang#111142 r? `@jyn514`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-cross
Area: Cross compilation
C-bug
Category: This is a bug.
O-AArch64
Armv8-A or later processors in AArch64 mode
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
If you try to compile the core library for the
aarch64-unknown-none
target, and theCC_aarch64_unknown_none
environment variable is not set, you will end up with a broken target that can't link any basic program:Inspecting the
libcompiler_builtins-5d101b3353699a4d.rlib
file, we can see that the codegen units produced by rustc are indeed aarch64, but the object files produced by the compiler_builtins's build script are x86_64:Having a "polyglot"
libcompiler_builtins.rlib
makes the linker sad, and results in the confusing linker error messages above. Setting theCC_aarch64_unknown_none
environment variable pointing to a valid compiler for the target fixes the problem.CI-built tarballs are not affected by this (as it sets the
CC_aarch64_unknown_none
environment variable), but right now this is a huge footgun for anyone trying to build the target locally.We should add some safeguards to prevent this from happening. Ideally we would change the build script of
compiler_builtins
not to YOLO and use the host compiler if it doesn't find the target compiler. If that doesn't work, bootstrap should abort the build if thec
feature ofcompiler_builtins
is enabled and the correspondingCC_*
environment variable isn't set.The text was updated successfully, but these errors were encountered: