aboutsummaryrefslogtreecommitdiffstats
path: root/community/rust/link-musl-dynamically.patch
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2019-06-26 17:58:04 +0200
committerLeo <thinkabit.ukim@gmail.com>2019-07-05 08:00:57 -0300
commit69851bdae1177246337f51a35734e93f1fd7e3d3 (patch)
tree27364818b059fe44e2645df7e9019a45be79f140 /community/rust/link-musl-dynamically.patch
parent819bd837a995659eaf0ecdca074b87ede3a7f99c (diff)
downloadaports-69851bdae1177246337f51a35734e93f1fd7e3d3.tar.bz2
aports-69851bdae1177246337f51a35734e93f1fd7e3d3.tar.xz
community/rust: build on arm{hf,v7}, ppc64le & x86
Also disable full bootstrapping. Since we always bootstrap from $pkgver minus one we don't need it and it increases buildtime considerably. Also keep in mind that we have to add new arches in multiple steps: 1. Compile with the upstream triplets, compiling alpine's triplets in 2. Compile again, now with our triplets selected as build/target, now that rustc knows about them This means that the produced compilers MUST ONLY be used to bootstrap the actual compilers with our triplets, DO NOT use these to compile packages! Since x86_64 still uses the usual triplets it's fine to upgrade/add packages for that arch though, please DO NOT do this for armhf,armv7,aarch64,ppc64le or x86 though!
Diffstat (limited to 'community/rust/link-musl-dynamically.patch')
-rw-r--r--community/rust/link-musl-dynamically.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/community/rust/link-musl-dynamically.patch b/community/rust/link-musl-dynamically.patch
new file mode 100644
index 0000000000..20a41fe3e7
--- /dev/null
+++ b/community/rust/link-musl-dynamically.patch
@@ -0,0 +1,41 @@
+We don't need those, we provide musl ourselves.
+--- rustc-1.35.0-src/src/bootstrap/compile.rs
++++ rustc-1.35.0-src/src/bootstrap/compile.rs
+@@ -114,20 +114,7 @@ impl Step for Std {
+ fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>) {
+ let libdir = builder.sysroot_libdir(*compiler, target);
+
+- // Copies the crt(1,i,n).o startup objects
+- //
+- // Since musl supports fully static linking, we can cross link for it even
+- // with a glibc-targeting toolchain, given we have the appropriate startup
+- // files. As those shipped with glibc won't work, copy the ones provided by
+- // musl so we have them on linux-gnu hosts.
+- if target.contains("musl") {
+- for &obj in &["crt1.o", "crti.o", "crtn.o"] {
+- builder.copy(
+- &builder.musl_root(target).unwrap().join("lib").join(obj),
+- &libdir.join(obj),
+- );
+- }
+- } else if target.ends_with("-wasi") {
++ if target.ends_with("-wasi") {
+ for &obj in &["crt1.o"] {
+ builder.copy(
+ &builder.wasi_root(target).unwrap().join("lib/wasm32-wasi").join(obj),
+--- rustc-1.35.0-src/vendor/libc/src/unix/mod.rs
++++ rustc-1.35.0-src/vendor/libc/src/unix/mod.rs
+@@ -306,13 +306,6 @@ cfg_if! {
+ } else if #[cfg(feature = "use_std")] {
+ // cargo build, don't pull in anything extra as the libstd dep
+ // already pulls in all libs.
+- } else if #[cfg(target_env = "musl")] {
+- #[cfg_attr(feature = "rustc-dep-of-std",
+- link(name = "c", kind = "static",
+- cfg(target_feature = "crt-static")))]
+- #[cfg_attr(feature = "rustc-dep-of-std",
+- link(name = "c", cfg(not(target_feature = "crt-static"))))]
+- extern {}
+ } else if #[cfg(target_os = "emscripten")] {
+ #[link(name = "c")]
+ extern {}