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

Wrong program interpreter on musl targets with cc #94864

Closed
Yuri6037 opened this issue Mar 11, 2022 · 1 comment
Closed

Wrong program interpreter on musl targets with cc #94864

Yuri6037 opened this issue Mar 11, 2022 · 1 comment

Comments

@Yuri6037
Copy link

When a cargo project, which depends on the cc crate and a C++ runtime, is built on an musl target, the generated binary is broken: the program interpreter is set to "/lib/ld-linux-aarch64.so.1" instead of "/lib/ld-musl-aarch64.so.1".

After having posted an issue in cc crate (rust-lang/cc-rs#635) it appears the problem is rustc choosing the wrong linker.

@nagisa
Copy link
Member

nagisa commented Jul 14, 2022

I believe this is a duplicate of #82519. rustc has no heuristics to select a target specific linker in cross-compilation scenarios and today it is the responsibility of the invoker to set up the environment, the flags and their build system accordingly to point them at the appropriate tools, including the linker.

There are some people who think adding such heuristics is a good idea. I don’t necessarily agree, but either way it would be a change worth an RFC.

@nagisa nagisa closed this as completed Jul 14, 2022
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