rust-lang / rustc_codegen_gcc

libgccjit AOT codegen for rustc
Apache License 2.0
905 stars 60 forks source link

Some UI tests that used to pass now fail sync the last sync #542

Open antoyo opened 1 month ago

antoyo commented 1 month ago

The following UI tests now fail since the last sync:

sum12 commented 1 month ago

how do I run these tests locally ? ( in order to try and fix them ) running ./y.sh test --test-failing-ui-pattern-tests I get

Testing stage0 compiletest suite=ui mode=ui (aarch64-unknown-linux-gnu)
Build completed unsuccessfully in 0:00:00
./x.py test --run always --stage 0 tests/ui --rustc-args  -Zcodegen-backend=<path>/rustc_codegen_gcc/target/debug/librustc_codegen_gcc.so --sysroot <path>/rustc_codegen_gcc/build/build_sysroot/sysroot`

I did build libgccjit.so and the gcc-path is pointing to the folder with that file

antoyo commented 1 month ago

Are you on Asahi Linux?

sum12 commented 1 month ago

would love to but not yet. fedora vm on M2

antoyo commented 1 month ago

Hum, I can try on a M1 with Asahi Linux to see if it still works, but the support for it is currently WIP.

Are you able to compile a simple project with rustc_codegen_gcc?

sum12 commented 1 month ago

I guess it does ?

➜ ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
[BUILD] build system
    Finished `release` profile [optimized] target(s) in 0.02s
warning: no edition set: defaulting to the 2015 edition while the latest is 2021
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s
sum12 commented 1 month ago

nope,

✗ tests/hello-world/target/debug/hello_world 
[1]    1944449 segmentation fault (core dumped)  tests/hello-world/target/debug/hello_world
antoyo commented 1 month ago

Did you build the sysroot --release-sysroot? There's a bug because the naked attributed is not supported on AArch64 in GCC and compiling the sysroot in release mode workarounds the issue. See more info here.