thepowersgang / mrustc

Alternative rust compiler (re-implementation)
MIT License
2.18k stars 109 forks source link

f5b9cbb7 cannot build rust 1.54 due to missing macro panic. #333

Closed gmatht closed 2 months ago

gmatht commented 2 months ago

I understand that Rust 1.29 is inappropriate for use with #[no_std]. So, I changed the default to 1.54.0. However, now Rust libcore won't build. This seems to be related to a macro panic that is required by assert!.

$ make -f minicargo.mk
make -f Makefile all
make[1]: Entering directory '/home/john/src/mrustc1.59'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/john/src/mrustc1.59'
test -e bin/mrustc
make -C tools/minicargo/
make[1]: Entering directory '/home/john/src/mrustc1.59/tools/minicargo'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/john/src/mrustc1.59/tools/minicargo'
test -e bin/minicargo
bin/minicargo --vendor-dir rustc-1.54.0-src/vendor --script-overrides script-overrides/stable-1.54.0-linux/ --output-dir output/ --manifest-overrides rustc-1.54.0-overrides.toml rustc-1.54.0-src/mrustc-stdlib/
--- BUILDING core v0.0.0 (0.0% 1r,0w,19b/20t)
> /home/john/src/mrustc1.59/bin/mrustc rustc-1.54.0-src/library/core/src/lib.rs -o output/libcore.rlib -C emit-depfile=output/libcore.rlib.d --cfg debug_assertions -O -L output --crate-name core --crate-type rlib --crate-tag 0_0_0 --edition 2018 > output/libcore.rlib_dbg.txt
 (0.0% 1r,0w,19b/20t): core v0.0.0
:0:0 error:0:Unknown macro {}panic/*?*/
rustc-1.54.0-src/library/core/src/num/f64.rs:1029: note: From here
Process was terminated with signal 6
FAILING COMMAND: /home/john/src/mrustc1.59/bin/mrustc rustc-1.54.0-src/library/core/src/lib.rs -o output/libcore.rlib -C emit-depfile=output/libcore.rlib.d --cfg debug_assertions -O -L output --crate-name core --crate-type rlib --crate-tag 0_0_0 --edition 2018
Env:  OUT_DIR=/home/john/src/mrustc1.59/output/build_core CARGO_MANIFEST_DIR=/home/john/src/mrustc1.59/rustc-1.54.0-src/library/core CARGO_PKG_NAME=core CARGO_PKG_VERSION=0.0.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=0 CARGO_PKG_VERSION_PATCH=0
 (5.0% 0r,0w,19b/20t):
BUILD FAILED
make: *** [minicargo.mk:225: LIBS] Error 1
thepowersgang commented 2 months ago

Was MRUSTC_TARGET_VER=1.54 set?

gmatht commented 2 months ago

No. Setting MRUSTC_TARGET_VER=1.54 fixes the issue.

thepowersgang commented 2 months ago

There is a script - build-1.54.0.sh that handles fully setting the environment to build that version. The default is 1.29 for backwards compatibility reasons.