`cargo` should build for the host system
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
As of #2822 "Start reusing rustc's format_args parser", we invoke cargo to produce object files to be linked into GCC. I've not yet run into the following -- but I suspect that cargo by default builds for the system it's currently running on: the GCC build system. However, these object files are to be linked into the compiler we're building, the GCC host system.
Therefore, I suspect, we should pass:
--target <TRIPLE> Build for the target triple
In the Makefile, we do have the GCC host system available in $(host) (or is $(host_noncanonical) applicable here?) -- but how to programmatically translate that into the corresponding Rust target triple, https://doc.rust-lang.org/cargo/appendix/glossary.html#target, https://doc.rust-lang.org/nightly/rustc/platform-support.html?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the Makefile and the cargo invocation introduced for producing object files. Determine how the GCC host system maps to a Rust target triple, then verify that cargo builds objects for the host system and that they can be linked into the compiler.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100