Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo should build for the host system #2898

Open
tschwinge opened this issue Mar 1, 2024 · 0 comments
Open

cargo should build for the host system #2898

tschwinge opened this issue Mar 1, 2024 · 0 comments
Labels
misc upstream Issue regarding upstreaming gccrs into GCC

Comments

@tschwinge
Copy link
Member

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?

@tschwinge tschwinge changed the title cargo should build for the _host_ cargo should build for the host system Mar 1, 2024
@CohenArthur CohenArthur added the upstream Issue regarding upstreaming gccrs into GCC label Mar 26, 2024
hubot pushed a commit to gcc-mirror/gcc that referenced this issue Apr 16, 2024
…ations

..., until <Rust-GCC/gccrs#2898>
"'cargo' should build for the host system" is resolved.

Follow-up to commit 3e1e73f
"build: Check for cargo when building rust language".

	* configure.ac (have_cargo): Force to "no" in Canadian cross
	configurations
	* configure: Regenerate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc upstream Issue regarding upstreaming gccrs into GCC
Projects
None yet
Development

No branches or pull requests

2 participants