You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quickstart can't build hello world: librustc_codegen_gcc.so not found #930
I'm trying to build librustc_codegen_gcc.so from this repo (rather than from Rust) to make it easier to upstream patches. However, the Quickstart instructions do not appear to work.
Following the instructions, I've:
Copied config.example.toml to config.toml
Ran ./y.sh prepare
Ran ./y.sh build --sysroot --release
Now I'm trying to run the fourth step:
$ ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
[BUILD] build system
Finished [`release` profile [optimized]](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles) target(s) in 0.01s
Using `/home/seancross/Code/rustc_codegen_gcc/build/libgccjit/b794cb99508e7eccd40fa42bb310d5781e09899b` as path for libgccjit
Compiling hello_world v0.0.0 (/home/seancross/Code/rustc_codegen_gcc/tests/hello-world)
error: couldn't load codegen backend /home/seancross/Code/rustc_codegen_gcc/target/debug/librustc_codegen_gcc.so: cannot open shared object file: No such file or directory
error: could not compile `hello_world` (bin "hello_world") due to 1 previous error
$
It appears to be looking for something under target/debug even though the instructions say to run ./y.sh build --sysroot --release. If I re-run step 3 with ./y.sh build --sysroot without --release, then attempting to build hello-world gives a different error:
$ ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
[BUILD] build system
Finished [`release` profile [optimized]](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles) target(s) in 0.00s
Using `/home/seancross/Code/rustc_codegen_gcc/build/libgccjit/b794cb99508e7eccd40fa42bb310d5781e09899b` as path for libgccjit
Compiling hello_world v0.0.0 (/home/seancross/Code/rustc_codegen_gcc/tests/hello-world)
error[E0463]: can't find crate for `mylib`
--> src/main.rs:1:5
|
1 | use mylib::my_func;
| ^^^^^ can't find crate
For more information about this error, try `rustc --explain E0463`.
error: could not compile `hello_world` (bin "hello_world") due to 1 previous error
$
If I re-run step 3 with ./y.sh build --sysroot without --release, then attempting to build hello-world gives a different error:
This project uses LTO, so it might be problematic to run. Please try with another project that does not use LTO and tell me if you still have an issue.
I'm able to run rustc directly (which is how I'm writing my testcases), but I'm not able to run the test suite since even CHANNEL=release ./y.sh test --release fails with the error.
If I omit the --release flags mentioned in the README.md it does work, yes.
Is t here any way to run just a single test? The whole suite takes a while. That'd be nice to include in the README as well. I'm interested in just running int tests right now, for example.
EDIT: I see from the CI directory I'd want to run ./y.sh test --cargo-tests -- int
Activity
antoyo commentedon Jul 26, 2026
Yeah, I guess the instructions are confusing. It says later to specify the
CHANNEL.This project uses LTO, so it might be problematic to run. Please try with another project that does not use LTO and tell me if you still have an issue.
xobs commentedon Jul 26, 2026
I'm able to run
rustcdirectly (which is how I'm writing my testcases), but I'm not able to run the test suite since evenCHANNEL=release ./y.sh test --releasefails with the error.What's the correct way to run the test suite?
antoyo commentedon Jul 26, 2026
I usually do not use
--releaseorCHANNEL=release, so please try dropping both.If that does not work, please post the complete error.
xobs commentedon Jul 26, 2026
If I omit the
--releaseflags mentioned in the README.md it does work, yes.Is t here any way to run just a single test? The whole suite takes a while. That'd be nice to include in the README as well. I'm interested in just running
inttests right now, for example.EDIT: I see from the CI directory I'd want to run
./y.sh test --cargo-tests -- intantoyo commentedon Jul 26, 2026
./y.sh test --helpshows the different tests you can run.