Skip to content

cargo should build for the host system #2898

Open
@tschwinge

Description

@tschwinge

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    miscupstreamIssue regarding upstreaming gccrs into GCC

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions