aboutsummaryrefslogtreecommitdiffstats
path: root/testing/rust/allow-crt-static-on-stable.patch
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-04-08 15:08:22 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-04-09 15:41:28 +0200
commit8c89e1295610fdb35dd125c2f7060e2e74c68527 (patch)
tree6bd5e94c2f58436db3341b9958354acc3a969d2c /testing/rust/allow-crt-static-on-stable.patch
parent997883d3a0f8c8c4a12b55f62643a26883d14507 (diff)
downloadaports-8c89e1295610fdb35dd125c2f7060e2e74c68527.tar.bz2
aports-8c89e1295610fdb35dd125c2f7060e2e74c68527.tar.xz
testing/rust: upgrade to 1.16.0 and properly fix dynamic linking
Diffstat (limited to 'testing/rust/allow-crt-static-on-stable.patch')
-rw-r--r--testing/rust/allow-crt-static-on-stable.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/rust/allow-crt-static-on-stable.patch b/testing/rust/allow-crt-static-on-stable.patch
new file mode 100644
index 0000000000..c193c0c0ac
--- /dev/null
+++ b/testing/rust/allow-crt-static-on-stable.patch
@@ -0,0 +1,32 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Sat, 08 Aug 2016 14:49:00 +0200
+Subject: [PATCH] Allow to use -C target-feature=+crt-static on stable rustc
+
+Rust links system libraries statically on musl by default, but we want to
+link dynamically. At the same time we would like to preserve this behaviour
+for consistency with other distros, to not confuse users.
+
+rustc already provides codegen option to change linking, but currently it's
+allowed only for nightly builds. This patch just removes this check and so
+allows to use it even on stable build.
+
+Build dynamically linked binary with rustc or cargo:
+
+ $ rustc -C target-feature=+crt-static hello_world.rs
+ $ RUSTFLAGS="-C target-feature=+crt-static" cargo build
+
+--- a/src/librustc/session/mod.rs
++++ b/src/librustc/session/mod.rs
+@@ -401,9 +401,9 @@
+ // If we switched from the default then that's only allowed on nightly, so
+ // gate that here.
+ if (found_positive || found_negative) && (!is_nightly || !unstable_options) {
+- self.fatal("specifying the `crt-static` target feature is only allowed \
+- on the nightly channel with `-Z unstable-options` passed \
+- as well");
++ //self.fatal("specifying the `crt-static` target feature is only allowed \
++ // on the nightly channel with `-Z unstable-options` passed \
++ // as well");
+ }
+
+ return crt_static;