Skip to content

[rustbuild] fix cross compilation of std for mips(el)-linux-musl #32027

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

Merged
merged 1 commit into from
Mar 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/build/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn check(build: &mut Build) {
}

// Make sure musl-root is valid if specified
if target.contains("musl") {
if target.contains("musl") && target.contains("x86_64") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about i686-unknown-linux-musl?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we don't provide binaries releases of std for that target (yet). But I guess we probably want to use static linking for that target as well because is not memory constrained like the mips are. @alexcrichton ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, we'd want to use static linking if it worked, but I don't think it would even get past compiling libstd today.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll interpret that as: "let's add i686 here after we confirm we can cross compile std to it using rustbuild".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, that was indeed what I intended to convey :)

match build.config.musl_root {
Some(ref root) => {
if fs::metadata(root.join("lib/libc.a")).is_err() {
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() {
}

if target.contains("unknown-linux") {
if target.contains("musl") {
if target.contains("musl") && target.contains("x86_64") {
println!("cargo:rustc-link-lib=static=unwind");
} else {
println!("cargo:rustc-link-lib=dl");
Expand Down