Uh oh!
There was an error while loading. Please reload this page.
Install libgccjit into the compiler's sysroot when cg_gcc is enabled - #145341
Conversation
rustbot
commented
Aug 13, 2025
|
rustbot
commented
Aug 13, 2025
This PR changes how GCC is built. Consider updating src/bootstrap/download-ci-gcc-stamp. |
…ry when installing `libgccjit.so`
jieyouxu
commented
Aug 13, 2025
@bors r+ rollup=never |
bors
commented
Aug 13, 2025
Kobzol
commented
Aug 13, 2025
I don't think this needs rollup=never, tbh, as this code shouldn't even be exercised on CI, perhaps outside of one PR CI job (famous last words?). @bors r+ rollup |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
bors
commented
Aug 13, 2025
…ouxu Install libgccjit into the compiler's sysroot when cg_gcc is enabled This PR installs the `libgccjit.so` library (which is essentially GCC) into the rustc sysroot (`stageN/lib` on Linux) when the GCC codegen backend is enabled. This allows using the GCC codegen backend "out of the box" with the resulting rustc. It would be nice to get rid of the `libgccjit.so.0` alias (https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Forcing.20unversioned.20dylib.20dependencies.20on.20Linux/with/534180740), but it's not blocking for this change. You can try running `x build std --set 'rust.codegen-backends=["llvm", "gcc"]'` and then compiling a hello world with `rustc +stage1 -Zcodegen-backend=gcc main.rs`. It is now also possible to build stage2 rustc when the GCC is configured to be the default codegen backend, without any further `LD_LIBRARY_PATH` hacks: `./x build compiler --stage 2 --set 'rust.codegen-backends=["gcc"]'`. After this change, it should be pretty simple to add a dist/rustup step for actually shipping cg_gcc to end users. CC ``@GuillaumeGomez`` r? ``@jieyouxu``
Rollup of 9 pull requests Successful merges: - #144761 (aarch64: Make `outline-atomics` a known target feature) - #144949 (More `Printer` cleanups) - #144955 (search graph: lazily update parent goals) - #144962 (Add aarch64_be-unknown-none-softfloat target) - #145153 (Handle macros with multiple kinds, and improve errors) - #145241 ([AVR] Changed data_layout) - #145341 (Install libgccjit into the compiler's sysroot when cg_gcc is enabled) - #145349 (Correctly handle when there are no unstable items in the documented crate) - #145356 (Add another example for escaped `#` character in doctest in rustdoc book) r? `@ghost` `@rustbot` modify labels: rollup
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #145341 - Kobzol:codegen-backend-gcc, r=jieyouxu Install libgccjit into the compiler's sysroot when cg_gcc is enabled This PR installs the `libgccjit.so` library (which is essentially GCC) into the rustc sysroot (`stageN/lib` on Linux) when the GCC codegen backend is enabled. This allows using the GCC codegen backend "out of the box" with the resulting rustc. It would be nice to get rid of the `libgccjit.so.0` alias (https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Forcing.20unversioned.20dylib.20dependencies.20on.20Linux/with/534180740), but it's not blocking for this change. You can try running `x build std --set 'rust.codegen-backends=["llvm", "gcc"]'` and then compiling a hello world with `rustc +stage1 -Zcodegen-backend=gcc main.rs`. It is now also possible to build stage2 rustc when the GCC is configured to be the default codegen backend, without any further `LD_LIBRARY_PATH` hacks: `./x build compiler --stage 2 --set 'rust.codegen-backends=["gcc"]'`. After this change, it should be pretty simple to add a dist/rustup step for actually shipping cg_gcc to end users. CC ```@GuillaumeGomez``` r? ```@jieyouxu```
antoyo
commented
Aug 17, 2025
@Kobzol: With this PR, is it still possible to overwrite the |
Kobzol
commented
Aug 18, 2025
I would assume so. Can you please try? Add |
antoyo
commented
Oct 24, 2025
I've just tried setting I don't remember exactly why I thought this PR could break this. I don't see anything related to the environment variables handling that changed.
I remember some peculiarities about rustup not taking Do you have any ideas of what could have caused this? (It could be in a different PR, though.) And more generally, does setting |
Kobzol
commented
Oct 25, 2025
I would first try it manually, just to see if |
antoyo
commented
Oct 25, 2025
If manually running or: |
Kobzol
commented
Oct 25, 2025
Then I guess that bootstrap overrides this env. var. (which I indeed think is happening). |
antoyo
commented
Oct 25, 2025
My impression is that it doesn't use the environment in which it is called. But it could also override this specific var. |
This PR installs the
libgccjit.solibrary (which is essentially GCC) into the rustc sysroot (stageN/libon Linux) when the GCC codegen backend is enabled. This allows using the GCC codegen backend "out of the box" with the resulting rustc. It would be nice to get rid of thelibgccjit.so.0alias (https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Forcing.20unversioned.20dylib.20dependencies.20on.20Linux/with/534180740), but it's not blocking for this change.You can try running
x build std --set 'rust.codegen-backends=["llvm", "gcc"]'and then compiling a hello world withrustc +stage1 -Zcodegen-backend=gcc main.rs.It is now also possible to build stage2 rustc when the GCC is configured to be the default codegen backend, without any further
LD_LIBRARY_PATHhacks:./x build compiler --stage 2 --set 'rust.codegen-backends=["gcc"]'.After this change, it should be pretty simple to add a dist/rustup step for actually shipping cg_gcc to end users.
CC @GuillaumeGomez
r? @jieyouxu