rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.58k stars 12.62k forks source link

Cross compile to ppc fails #98134

Open TuxThePenguin0 opened 2 years ago

TuxThePenguin0 commented 2 years ago

I have been trying to get rust to cross-compile from an x86 system to a ppc32 host/target but the build process errors out in the stage1 phase. My experience is fairly limited but it looks like it might be trying to use x86 headers for a ppc compile?

Meta

Version being built is 1.60.0 through the Alpine Linux aports repo and using abuild

Error

``` Copying stage1 std from stage1 (i586-alpine-linux-musl -> i586-alpine-linux-musl / i586-alpine-linux-musl) Building stage1 compiler artifacts (i586-alpine-linux-musl -> powerpc-alpine-linux-musl) Compiling libc v0.2.116 Compiling proc-macro2 v1.0.30 ... Compiling gimli v0.26.1 Compiling tracing v0.1.29 error: Error relocating /home/tux/aports/community/rust/src/rustc-1.60.0-src/build/i586-alpine-linux-musl/stage1-rustc/release/deps/libtracing_attributes-a36eb84df63ddcba.so: __mulodi4: symbol not found --> /home/tux/aports/community/rust/src/rustc-1.60.0-src/vendor/tracing-0.1.29/src/lib.rs:913:9 | 913 | pub use tracing_attributes::instrument; | ^^^^^^^^^^^^^^^^^^ error: could not compile `tracing` due to previous error warning: build failed, waiting for other jobs to finish... error: build failed ```

compiler-errors commented 2 years ago

but it looks like it might be trying to use x86 headers for a ppc compile?

tracing_attributes is a proc-macro, so it should be compiling for the host architecture.

TuxThePenguin0 commented 2 years ago

I tried again with rust 1.61.0 and got pretty much the exact same error

Error

``` Copying stage1 std from stage1 (i586-alpine-linux-musl -> i586-alpine-linux-musl / i586-alpine-linux-musl) Building stage1 compiler artifacts (i586-alpine-linux-musl -> powerpc-alpine-linux-musl) Compiling proc-macro2 v1.0.30 Compiling libc v0.2.116 ... Compiling rustc_macros v0.1.0 (/home/tux/aports/community/rust/src/rustc-1.61.0-src/compiler/rustc_macros) Compiling chalk-derive v0.80.0 Compiling tracing v0.1.29 error: Error relocating /home/tux/aports/community/rust/src/rustc-1.61.0-src/build/i586-alpine-linux-musl/stage1-rustc/release/deps/libtracing_attributes-77686163bd4c6e7a.so: __mulodi4: symbol not found --> /home/tux/aports/community/rust/src/rustc-1.61.0-src/vendor/tracing-0.1.29/src/lib.rs:913:9 | 913 | pub use tracing_attributes::instrument; | ^^^^^^^^^^^^^^^^^^ Compiling chalk-ir v0.80.0 error: could not compile `tracing` due to previous error warning: build failed, waiting for other jobs to finish... error: Error relocating /home/tux/aports/community/rust/src/rustc-1.61.0-src/build/i586-alpine-linux-musl/stage1-rustc/release/deps/libchalk_derive-1dc68cf7ceee1d83.so: __mulodi4: symbol not found --> /home/tux/aports/community/rust/src/rustc-1.61.0-src/vendor/chalk-ir-0.80.0/src/lib.rs:13:5 | 13 | use chalk_derive::{Fold, HasInterner, SuperVisit, Visit, Zip}; | ^^^^^^^^^^^^ ```

compiler-errors commented 2 years ago

does the compiler let you build itself? like not targeting ppc32, but the host architecture?

TuxThePenguin0 commented 2 years ago

Yes rust builds fine when targeting the host architecture