rust-lang / rust-lang/rustc_codegen_gcc

`y` sets `LIBRARY_PATH` which confuses gcc when compiling for a different target

Open
#638 1 comment 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

https://github.com/rust-lang/rustc_codegen_gcc/blob/fcac22978ad507b8a7124f0a1600ff55417a34a7/build_system/src/build.rs#L194

Linkers (both rust-lld and ld) attempt to link against the built GCC's crtbegin.o, which may not match the host architecture. Locally I've solved this by commenting out the LIBRARY_PATH environment variable then specifying RUSTFLAGS="-Lgcc-install/lib" to link against libgccjit.

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

Open build_system/src/build.rs around line 194 and inspect how y sets LIBRARY_PATH. Reproduce a different-target compilation and verify that the linker no longer selects an incompatible built GCC crtbegin.o while libgccjit remains linkable through the documented RUSTFLAGS approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.