aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-04-13 00:23:56 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-04-13 00:29:51 +0200
commitf1119f039453b5ce6fa03ea7d1b8b13e04db2633 (patch)
treeb1368cbc5c35e81082e0f0700a200c3773afe501
parent0c9c5f8c93e636078d89eb27abc68b45306a16ce (diff)
downloadaports-f1119f039453b5ce6fa03ea7d1b8b13e04db2633.tar.bz2
aports-f1119f039453b5ce6fa03ea7d1b8b13e04db2633.tar.xz
testing/rust: force rpath on prefer-dynamic
-rw-r--r--testing/rust/APKBUILD2
-rw-r--r--testing/rust/force-rpath-on-prefer-dynamic.patch36
2 files changed, 38 insertions, 0 deletions
diff --git a/testing/rust/APKBUILD b/testing/rust/APKBUILD
index 3391da5364..2190fd8270 100644
--- a/testing/rust/APKBUILD
+++ b/testing/rust/APKBUILD
@@ -36,6 +36,7 @@ source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz
llvm-with-ffi.patch
move-py-scripts-to-share.patch
change-rpath-to-rustlib.patch
+ force-rpath-on-prefer-dynamic.patch
fix-jemalloc-musl.patch
check-rustc
"
@@ -190,5 +191,6 @@ f436fddf7ab70ca5f1424081f5b75450270b200b3d997231323863e11addf76e1d65831a7ca09e3a
37416e1fa0bc0c8651cd060a645d6245ff7e2082279ab5e13495c5ee412c71915469019cfbec95a0fd9a7fc144475079a3ad16f0eba7a2f5c8dd99e0002f3225 llvm-with-ffi.patch
19cc2725d68db3e359e0e3016028374e5818a97fdba24d0103f7d1706601c8b17c4dd95a3152e64f982f98e95ad3e949acddbea8a39ed0ba8dd4f702acc2704d move-py-scripts-to-share.patch
8d6206f8c50856724cf7b4c1854ec82547f040358a1c7d44abeacc27a5c205a963b1fec51e58ec06c68d85bd2f68a9e6e27ebe457f39e8dd043de17758f5063f change-rpath-to-rustlib.patch
+f230239d8de1b69536353e5735d3bf32f42a2715aefe4863622d9ab2b25d010209ed0bb38976eaa9302bce2eca6bd162abc8cefd71f689b65b3800920a50967b force-rpath-on-prefer-dynamic.patch
a330fa913faeadb98cb95e644f434ddef4fbbea32bcd11b6621fb9e08f7b0d8c71fae702207465489af3cf793eade0af694a8c515fc1bed49624da25103a4862 fix-jemalloc-musl.patch
37ece048cc4efac0f66e3f6e4cbb37f08fc0f8fe7af474a96e2c1d7400df773d9e33601b09feddae2a716e14fb98f8d8386504c4e36f86c699b6b785115c6bdb check-rustc"
diff --git a/testing/rust/force-rpath-on-prefer-dynamic.patch b/testing/rust/force-rpath-on-prefer-dynamic.patch
new file mode 100644
index 0000000000..3c3aced9bd
--- /dev/null
+++ b/testing/rust/force-rpath-on-prefer-dynamic.patch
@@ -0,0 +1,36 @@
+From: Shiz <hi@shiz.me>
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Wed, 12 Apr 2017 23:28:09 +0200
+Subject: [PATCH] Force rpath on prefer-dynamic
+
+When you build a dynamic binary with `-C prefer-dynamic`, rustc links
+dynamically even Rust libraries, built as shared objects. These are
+installed in /usr/lib/rustlib/<TARGET>/lib/, the location that is not
+on standard LD path, at least on Alpine.
+
+Therefore such binary would be unusable when not built with `-C rpath`
+(or manually specifying LD_LIBRARY_PATH). For that reason we implicitly
+enable rpath when `prefer-dynamic` is enabled.
+
+Also note that Rust normally installs identical copy of *.so files from
+/usr/lib/rustlib/<TARGET>/lib/, where <TARGET> equals host triple, to
+/usr/lib. That's why such fully dynamic binary may work on other
+systems even without rpath or having rustlib on the LD path. However,
+since these *.so libraries don't keep stable ABI, they should not be on
+LD path, and thus we do not install them here (see
+change-rpath-to-rustlib.patch).
+
+--- a/src/librustc/session/config.rs
++++ b/src/librustc/session/config.rs
+@@ -1368,6 +1368,11 @@
+
+ let mut cg = build_codegen_options(matches, error_format);
+
++ // Force rpath addition on prefer-dynamic output.
++ if cg.prefer_dynamic {
++ cg.rpath = true;
++ }
++
+ // Issue #30063: if user requests llvm-related output to one
+ // particular path, disable codegen-units.
+ if matches.opt_present("o") && cg.codegen_units != 1 {