mrustc: Support PowerPC: mrustc itself builds fine, rust tries to build for x86 and fails

What is needed to support building for PowerPC? Currently mrustc builds, but rust tries to build for x86:

test -e bin/mrustc
/usr/bin/make -C tools/minicargo/
make[1]: Nothing to be done for `all'.
test -e bin/minicargo
bin/minicargo rustc-1.54.0-src/library/std --vendor-dir rustc-1.54.0-src/vendor --script-overrides script-overrides/stable-1.54.0-macos/ --output-dir output-1.54.0/  --manifest-overrides rustc-1.54.0-overrides.toml
> /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_mrustc/mrustc/work/mrustc-11a9c01119988e30ba40bab4ee5f60753c0c4b61/bin/mrustc -Z print-cfgs
(0/13) BUILDING core v0.0.0
> /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_mrustc/mrustc/work/mrustc-11a9c01119988e30ba40bab4ee5f60753c0c4b61/bin/mrustc rustc-1.54.0-src/library/core/src/lib.rs -o output-1.54.0/libcore.rlib --crate-name core --crate-type rlib -C emit-depfile=output-1.54.0/libcore.rlib.d --crate-tag 0_0_0 --cfg debug_assertions -O -L output-1.54.0 --edition 2018
rustc-1.54.0-src/library/core/src/../../stdarch/crates/core_arch/src/x86/avx2.rs:520: error:0:Type mismatch between [u32; 8] and [u32; 576460752303423488] - sizes differ
rustc-1.54.0-src/library/core/src/../../stdarch/crates/core_arch/src/x86/avx2.rs:520: note: From here
Process was terminated with signal 6
FAILING COMMAND:  /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_mrustc/mrustc/work/mrustc-11a9c01119988e30ba40bab4ee5f60753c0c4b61/bin/mrustc rustc-1.54.0-src/library/core/src/lib.rs -o output-1.54.0/libcore.rlib --crate-name core --crate-type rlib -C emit-depfile=output-1.54.0/libcore.rlib.d --crate-tag 0_0_0 --cfg debug_assertions -O -L output-1.54.0 --edition 2018
BUILD FAILED
make: *** [output-1.54.0/libstd.rlib] Error 1
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_mrustc/mrustc/work/mrustc-11a9c01119988e30ba40bab4ee5f60753c0c4b61" && /usr/bin/make -j2 -w -f minicargo.mk -j2 bin/mrustc bin/minicargo && /usr/bin/make -j2 -C tools/dump_hirfile && /usr/bin/make -j2 -C tools/standalone_miri && /usr/bin/make -j1 -f minicargo.mk LIBS 
Exit code: 2

See also: https://trac.macports.org/ticket/65942

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 23 (23 by maintainers)

Most upvoted comments

Big-endian support added in b57ddbfcf2d8736e27975762855f70a0da2eedd3

If you search for that message, you will find three locations for it - read_uint, write_uint, and write_sint - they will need endian flipping before the read/write

Ah, just looked at the source - the default for apple is x86. You will need to edit tools/common/target_detect.h to update the detection rules so it can identify a PPC target, and then add the triple to src/trans/target.cpp init_from_spec_name