rust-lang / rust-lang/rustc_codegen_gcc

Add support for automatically building libgccjit from source

Open
#719 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
105
Avg merge
8h 20m
Merged PRs (30d)
14

Description

Currently, we only distribute a pre-built libgccjit for x86_64, requiring people to build it from scatch on other platforms.

We could add a y.sh gcc command, allowing people to easily clone GCC and build it from source with one command.

Doing so would reduce the barier to entry, and simplify testing on other platforms.

Furthermore, we could integrate this command with cross-ng, allowing people to build cross compilers more easily. We could provide some default configs for common platforms, and allow people to load custom ones.

With a bit more effort(particularly regarding the sysroot), we could even allow people to have multiple builds of libgccjit, stored somewhere like build/libgccjit/config_name. People could then select the libgccjit version they are using(for other commands), like this:

./y.sh rustc --gcc x86_64-linux test.rs # build for x86_64 Linux
./y.sh rustc --gcc dec-alpha-linux test.rs # build for Dec ALPHA Linux
./y.sh rustc --gcc my_config_for_a_very_specific_system # Build with a custom version of `libgccjit`, with some special configs / patches.

This feature could also be useful with Rustup distribution. Providing an easy way to build libgccjit for other platforms would make doing so automatically easier.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing y.sh command dispatch and the current libgccjit distribution/build logic. Review how ./y.sh rustc --gcc selects libgccjit, then determine the scope for a y.sh gcc command, cross-ng integration, and config-specific builds under build/libgccjit. Done would mean the proposed source builds and selection workflows are defined and implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, shell
Domain
build-system, cli, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.