Skip to content

Cross compile build failure #766

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

Open
Yuri6037 opened this issue Dec 20, 2022 · 1 comment
Open

Cross compile build failure #766

Yuri6037 opened this issue Dec 20, 2022 · 1 comment

Comments

@Yuri6037
Copy link

When attempting to cross compile from aarch64-unknown-linux-gnu to x86_64-unknown-linux-musl this crate chooses a completely wrong compiler name: musl-gcc. The must-gcc compiler cannot be used to build x86_64 under an aarch64 machine.

Why is cc-rs not using RUSTC_LINKER in this case which points to a valid compiler/linker for the target platform?

@dot-asm
Copy link
Contributor

dot-asm commented Dec 22, 2022

In a way the question answers itself. I mean the answer to the "why" is obviously somebody asked the related "why" question before and came up with an answer that made sense in a specific situation:-) But on a serious note, a similar question was asked and even with a reference to musl. The suggestion was to scrap most of the mapping table, more specifically entries for targets that rely on cross-linker having to be specified (and as a result being passed as RUSTC_LINKER). As an alternative one can flip the priorities and use the table as a fallback. As opposed to using RUSTC_LINKER as fallback that is. (I also advocate for providing an interface to interrogate rustc for linker, so that we have something to work with in case RUSTC_LINKER is not set...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants