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

rust: fix musl build #3548

Merged
merged 1 commit into from
Oct 9, 2018
Merged

rust: fix musl build #3548

merged 1 commit into from
Oct 9, 2018

Conversation

Cogitri
Copy link
Contributor

@Cogitri Cogitri commented Oct 8, 2018

No description provided.

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

Currently testing this...

Got further than the builder, but I guess it's better to let this compile once for good.

@Gottox
Copy link
Member

Gottox commented Oct 8, 2018

I'm test compiling aarch64 atm.

@Gottox
Copy link
Member

Gottox commented Oct 8, 2018

Native testbuilding afterwards and merging if it succeeds.

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

works for me on x86_64-musl.

=> Creating rust-1.28.0_2.x86_64-musl.xbps for repository /host/binpkgs/rust-cross ...

@Gottox
Copy link
Member

Gottox commented Oct 8, 2018

okay 👍

@Gottox
Copy link
Member

Gottox commented Oct 8, 2018

error: cannot produce dylib for `rustc_driver v0.0.0 (file:///builddir/rustc-1.28.0-src/src/librustc_driver)` as the target `aarch64-unknown-linux-musl` does not support these crate types

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

Mind giving uploading the whole log?

@Gottox
Copy link
Member

Gottox commented Oct 8, 2018

@atweiden
Copy link
Contributor

atweiden commented Oct 8, 2018

Could this have anything to do with it?

--set=target.${_host_triplet}.llvm-config="/usr/bin/llvm-config"

I believe it's erroneously double double-quoted.

@Gottox
Copy link
Member

Gottox commented Oct 8, 2018

rust-lang/rust#44991

@Gottox
Copy link
Member

Gottox commented Oct 8, 2018

@atweiden I don't think that makes any difference.

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

I believe it's erroneously double double-quoted.

It doesn't make a difference - although those double quotes are unnecessary.

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

rust-lang/rust#44991

Thanks for liking to that, found it already - currently testing some stuff.

@Gottox
Copy link
Member

Gottox commented Oct 8, 2018

@Gottox
Copy link
Member

Gottox commented Oct 8, 2018

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

Hm, curious why no other musl distro (e.g. alpine) carries a patch for that though...

Also, maybe I should just combine this with a rust bump to 1.29.1?

@jnbr
Copy link
Contributor

jnbr commented Oct 8, 2018

I think it is just a matter of disabling crt-static for musl - currently testing. We do this for x86_64-musl already. Alpine does this for all architectures.

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

@jnbr
Copy link
Contributor

jnbr commented Oct 8, 2018

aarch64-musl build completed with crt_static_default = false. I've set it in src/librustc_target/spec/linux_musl_base.rs, can as well be done in the architecture specific profiles.

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

Alright, mind leaving a patch here then?

@jnbr
Copy link
Contributor

jnbr commented Oct 8, 2018

--- rustc-1.28.0-src/src/librustc_target/spec/linux_musl_base.rs.orig   2018-10-08 21:02:21.588611506 +0200
+++ rustc-1.28.0-src/src/librustc_target/spec/linux_musl_base.rs        2018-10-08 21:02:40.846454873 +0200
@@ -61,7 +61,7 @@
     base.post_link_objects_crt.push("crtn.o".to_string());

     // These targets statically link libc by default
-    base.crt_static_default = true;
+    base.crt_static_default = false;
     // These targets allow the user to choose between static and dynamic linking.
     base.crt_static_respected = true;

This is redundant to srcpkgs/rust/files/musl.patch.

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

Testing...

@Cogitri
Copy link
Contributor Author

Cogitri commented Oct 8, 2018

Works, thanks @jnbr.

@maxice8
Copy link
Contributor

maxice8 commented Oct 8, 2018

good to merge ?

@Gottox Gottox merged commit 0fbec08 into void-linux:master Oct 9, 2018
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

Successfully merging this pull request may close these issues.

5 participants