aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorMarat Safin <jeizsm@gmail.com>2017-10-23 16:30:50 +0300
committerJakub Jirutka <jakub@jirutka.cz>2017-10-24 19:15:53 +0200
commit864cff760f4be1e178c0f5f6a6385482ec6daa5c (patch)
tree4e7a9c710c3fa06e73a4f09ca73807df3d11dab9 /community
parenteed3f1e42bad7f8a63369246f2a366a6471ec06f (diff)
downloadaports-864cff760f4be1e178c0f5f6a6385482ec6daa5c.tar.bz2
aports-864cff760f4be1e178c0f5f6a6385482ec6daa5c.tar.xz
community/rust: upgrade to 1.19
Build fails when src/jemalloc is deleted, but it's really not used in binaries built by rustc, so it should be okay.
Diffstat (limited to 'community')
-rw-r--r--community/rust/APKBUILD16
-rw-r--r--community/rust/alpine-allow-crt-static.patch41
-rw-r--r--community/rust/fix-build.patch92
-rw-r--r--community/rust/musl-support-dynamic-linking.patch59
4 files changed, 20 insertions, 188 deletions
diff --git a/community/rust/APKBUILD b/community/rust/APKBUILD
index 62f9462f9c..0f4a237580 100644
--- a/community/rust/APKBUILD
+++ b/community/rust/APKBUILD
@@ -3,10 +3,10 @@
# Contributor: Jeizsm <jeizsm@gmail.com>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=rust
-pkgver=1.18.0
+pkgver=1.19.0
_llvmver=3.9
-_bootver=1.17.0
-pkgrel=1
+_bootver=1.18.0
+pkgrel=0
pkgdesc="The Rust Programming Language (compiler)"
url="http://www.rust-lang.org"
arch="x86_64"
@@ -34,11 +34,9 @@ source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz
static-pie.patch
need-rpath.patch
minimize-rpath.patch
- alpine-allow-crt-static.patch
alpine-move-py-scripts-to-share.patch
alpine-change-rpath-to-rustlib.patch
alpine-target.patch
- fix-build.patch
check-rustc
"
builddir="$srcdir/rustc-$pkgver-src"
@@ -54,7 +52,7 @@ prepare() {
cd "$builddir"
# Remove bundled dependencies.
- rm -Rf src/llvm/ src/jemalloc/
+ rm -Rf src/llvm/
# Make sure to use the system LLVM.
printf '[target.%s]\nllvm_config = "/usr/lib/llvm%s/bin/llvm-config"\n' \
@@ -170,17 +168,15 @@ _mv() {
mv $@
}
-sha512sums="eff0460b647dfb3490e28d4dec4f9781d31a942f22de75d9bd1ba31591597226b6862ec5132e8b4fcdbcf6e6ffa085ca5dda7ff8260cd82388fc13e8d3b4a2eb rustc-1.18.0-src.tar.gz
-b5db9ed04eac26c6fc62cde3f19d29837a5feea68e79165c23b5b5cade2e1d193f2399d27f7622b230996da9565f78825be154574f1cd59189ded8a03a766cfb musl-support-dynamic-linking.patch
+sha512sums="080a8625fc15bc4fc17ab910bdcc0d9a88ce8922f1a3eb241d0f956b5799e4db6df45ebabb5497295c198be08686e5a94dff65569582fc6a5ecb9200cfee5c24 rustc-1.19.0-src.tar.gz
+e797d4a21ffe5087e6a7c4d22302f0fbd8fdc2074195d7a0d22a8c52a1abe3269e14a3b865f26e13a4f70362922dd0dc5279d8a3d70617199705cc452181d889 musl-support-dynamic-linking.patch
d4d39514eca638852307f470250fd12a21781e1e7944377744b7d50290d3a2ab3776fbdfccb7a9221f5da00ca694ac3a5b8c05f72c5e1a0c8711b684b16b1084 musl-fix-static-linking.patch
9ebfb10abb50d74ff08d257d85257ce70ac3ce834aa95a8901808497b14acf3ea898fb197de64d13554eb5feedabe9fd04fec2cc6a7bea9b1335684bfcdcd88b musl-fix-linux_musl_base.patch
dc6432293bd060d5e3a73f25870867654fae61995dcd919e244a2dc686b6107556deed8c59ca6002182bfeff5ebc1ca2b89c4028ab0fbfb79e65defe47c9b4b0 llvm-with-ffi.patch
5aaf6715b27b8b786740a55b91216d47985fbef3ccb0ef7e6a81696a2823671f8306143f7ecf77e66af91ef1500072524b9b4c7569508922ad5268df6080fda1 static-pie.patch
ff633f2a46c683ad698d1c09c98c06ce9ee9b8d55fa5593cdd485b439ebca3273794d29b5ff32b887be8666f52913a23af6e133c782bd0c4e2c88e306dd3a494 need-rpath.patch
d352614e7c774e181decae210140e789de7fc090327ff371981ad28a11ce51c8c01b27c1101a24bb84d75ed2f706f67868f7dbc52196d4ccdf4ebd2d6d6b6b5e minimize-rpath.patch
-b00997c65d1a451fafae8b547893c5cbf03f028d2d70f6971aa670f34c2d6fc82728c740ac4a9909fc1999925ff300e4525cfec745cb9c9521e564eb166872a2 alpine-allow-crt-static.patch
498f4649163974afc4f042c43cd0c15d36784031514201a2962061f288a9336c2bc9749f8d2308b8ce3656f8097b5fc5bef505f61e2a6ed422ef4153f5339d77 alpine-move-py-scripts-to-share.patch
8d6206f8c50856724cf7b4c1854ec82547f040358a1c7d44abeacc27a5c205a963b1fec51e58ec06c68d85bd2f68a9e6e27ebe457f39e8dd043de17758f5063f alpine-change-rpath-to-rustlib.patch
e9935f88f959d37da9e696f2722569bc6da6ed17eddc8d496af4a2ee9a561d8e40bd7644089ee26114bb920e04ff05def18d70a6f2347545500d1a23ee96eefa alpine-target.patch
-5c1bcd78d2579e1aeacd4f20d849f75127111fb2f06124531af370c7afdcf9ae78d9e3952911197c02099cdedfeb2335699f98568123bdd83c7acc1ddbae7f54 fix-build.patch
79549055dea81379c890b495c82456ab497a9179ec6702c59e11d0748bc668f47fc3d6a69c27a0545bb87c01318631dffc69260bf2d4badc75f53cbf7fad7528 check-rustc"
diff --git a/community/rust/alpine-allow-crt-static.patch b/community/rust/alpine-allow-crt-static.patch
deleted file mode 100644
index 5e81671f60..0000000000
--- a/community/rust/alpine-allow-crt-static.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-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 want to allow users to optionally
-use static linking.
-
-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 staticaly 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;
---- a/src/test/compile-fail/crt-static-gated.rs
-+++ b/src/test/compile-fail/crt-static-gated.rs
-@@ -10,5 +10,6 @@
-
- // compile-flags:-C target-feature=+crt-static
- // error-pattern: specifying the `crt-static` target feature is only allowed
-+// ignore-test we just want this feature and no one will stop us!
-
- fn main() {}
diff --git a/community/rust/fix-build.patch b/community/rust/fix-build.patch
deleted file mode 100644
index 0a8482d731..0000000000
--- a/community/rust/fix-build.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
-index 56cbb4cecf2a..dc9dac736278 100644
---- a/src/bootstrap/flags.rs
-+++ b/src/bootstrap/flags.rs
-@@ -242,11 +242,18 @@ Arguments:
- let cwd = t!(env::current_dir());
- let paths = matches.free[1..].iter().map(|p| cwd.join(p)).collect::<Vec<_>>();
-
-+ let cfg_file = matches.opt_str("config").map(PathBuf::from).or_else(|| {
-+ if fs::metadata("config.toml").is_ok() {
-+ Some(PathBuf::from("config.toml"))
-+ } else {
-+ None
-+ }
-+ });
-
- // All subcommands can have an optional "Available paths" section
- if matches.opt_present("verbose") {
- let flags = Flags::parse(&["build".to_string()]);
-- let mut config = Config::default();
-+ let mut config = Config::parse(&flags.build, cfg_file.clone());
- config.build = flags.build.clone();
- let mut build = Build::new(flags, config);
- metadata::build(&mut build);
-@@ -307,14 +314,6 @@ Arguments:
- };
-
-
-- let cfg_file = matches.opt_str("config").map(PathBuf::from).or_else(|| {
-- if fs::metadata("config.toml").is_ok() {
-- Some(PathBuf::from("config.toml"))
-- } else {
-- None
-- }
-- });
--
- let mut stage = matches.opt_str("stage").map(|j| j.parse().unwrap());
-
- if matches.opt_present("incremental") {
-diff --git a/src/bootstrap/bin/main.rs b/src/bootstrap/bin/main.rs
-index 5ca5ce1648f2..5ef18b89841f 100644
---- a/src/bootstrap/bin/main.rs
-+++ b/src/bootstrap/bin/main.rs
-@@ -26,12 +26,6 @@ use bootstrap::{Flags, Config, Build};
- fn main() {
- let args = env::args().skip(1).collect::<Vec<_>>();
- let flags = Flags::parse(&args);
-- let mut config = Config::parse(&flags.build, flags.config.clone());
--
-- // compat with `./configure` while we're still using that
-- if std::fs::metadata("config.mk").is_ok() {
-- config.update_with_config_mk();
-- }
--
-+ let config = Config::parse(&flags.build, flags.config.clone());
- Build::new(flags, config).build();
- }
-diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
-index fd8aa320fb3d..902cd0997a8e 100644
---- a/src/bootstrap/config.rs
-+++ b/src/bootstrap/config.rs
-@@ -15,7 +15,7 @@
-
- use std::collections::HashMap;
- use std::env;
--use std::fs::File;
-+use std::fs::{self, File};
- use std::io::prelude::*;
- use std::path::PathBuf;
- use std::process;
-@@ -410,6 +410,12 @@ impl Config {
- set(&mut config.rust_dist_src, t.src_tarball);
- }
-
-+
-+ // compat with `./configure` while we're still using that
-+ if fs::metadata("config.mk").is_ok() {
-+ config.update_with_config_mk();
-+ }
-+
- return config
- }
-
-@@ -418,7 +424,7 @@ impl Config {
- /// While we still have `./configure` this implements the ability to decode
- /// that configuration into this. This isn't exactly a full-blown makefile
- /// parser, but hey it gets the job done!
-- pub fn update_with_config_mk(&mut self) {
-+ fn update_with_config_mk(&mut self) {
- let mut config = String::new();
- File::open("config.mk").unwrap().read_to_string(&mut config).unwrap();
- for line in config.lines() {
diff --git a/community/rust/musl-support-dynamic-linking.patch b/community/rust/musl-support-dynamic-linking.patch
index efbbd7f0b0..c6441272bb 100644
--- a/community/rust/musl-support-dynamic-linking.patch
+++ b/community/rust/musl-support-dynamic-linking.patch
@@ -16,18 +16,16 @@ diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 90fd31ecbd..28520a2c60 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
-@@ -205,6 +205,17 @@ fn main() {
+@@ -205,6 +205,15 @@ fn main() {
}
}
}
+
+ if let Ok(s) = env::var("RUST_CRT_STATIC") {
+ if s == "true" {
-+ cmd.arg("-Z").arg("unstable-options");
+ cmd.arg("-C").arg("target-feature=+crt-static");
+ }
+ if s == "false" {
-+ cmd.arg("-Z").arg("unstable-options");
+ cmd.arg("-C").arg("target-feature=-crt-static");
+ }
+ }
@@ -38,14 +36,21 @@ diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 7c35151a6d..c83b6cc24c 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
-@@ -94,14 +94,17 @@ pub fn std_link(build: &Build,
- t!(fs::create_dir_all(&libdir));
- add_to_sysroot(&out_dir, &libdir);
+@@ -94,21 +94,24 @@ pub fn std_link(build: &Build,
+ let libdir = build.sysroot_libdir(target_compiler, target);
+ add_to_sysroot(&libdir, &libstd_stamp(build, compiler, target));
- if target.contains("musl") && !target.contains("mips") {
+ if target.contains("musl") {
copy_musl_third_party_objects(build, target, &libdir);
}
+
+ if build.config.sanitizers && compiler.stage != 0 && target == "x86_64-apple-darwin" {
+ // The sanitizers are only built in stage1 or above, so the dylibs will
+ // be missing in stage0 and causes panic. See the `std()` function above
+ // for reason why the sanitizers are not built in stage0.
+ copy_apple_sanitizer_dylibs(&build.native_dir(target), "osx", &libdir);
+ }
}
/// Copies the crt(1,i,n).o startup objects
@@ -144,22 +149,12 @@ diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs
index 36a887e062..1075e4f0cf 100644
--- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs
-@@ -34,6 +34,7 @@ use syntax::parse::ParseSess;
- use syntax::symbol::Symbol;
- use syntax::{ast, codemap};
- use syntax::feature_gate::AttributeType;
-+use syntax::feature_gate::UnstableFeatures;
- use syntax_pos::{Span, MultiSpan};
-
- use rustc_back::PanicStrategy;
-@@ -380,6 +381,34 @@ impl Session {
+@@ -380,6 +381,24 @@ impl Session {
self.opts.debugging_opts.enable_nonzeroing_move_hints
}
+ pub fn crt_static(&self) -> bool {
+ let requested_features = self.opts.cg.target_feature.split(',');
-+ let unstable_options = self.opts.debugging_opts.unstable_options;
-+ let is_nightly = UnstableFeatures::from_environment().is_nightly_build();
+ let found_negative = requested_features.clone().any(|r| r == "-crt-static");
+ let found_positive = requested_features.clone().any(|r| r == "+crt-static");
+
@@ -173,14 +168,6 @@ index 36a887e062..1075e4f0cf 100644
+ found_positive
+ };
+
-+ // 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");
-+ }
-+
+ return crt_static;
+ }
+
@@ -235,21 +222,11 @@ diff --git a/src/librustc_driver/target_features.rs b/src/librustc_driver/target
index 124e7aafcc..492ceecaf1 100644
--- a/src/librustc_driver/target_features.rs
+++ b/src/librustc_driver/target_features.rs
-@@ -12,7 +12,6 @@ use syntax::ast;
- use llvm::LLVMRustHasFeature;
- use rustc::session::Session;
- use rustc_trans::back::write::create_target_machine;
--use syntax::feature_gate::UnstableFeatures;
- use syntax::symbol::Symbol;
- use libc::c_char;
-
-@@ -49,31 +48,7 @@ pub fn add_configuration(cfg: &mut ast::CrateConfig, sess: &Session) {
- }
+@@ -25,21 +25,7 @@ pub fn add_configuration(cfg: &mut ast::CrateConfig, sess: &Session) {
+ cfg.insert((tf, Some(feat)));
}
- let requested_features = sess.opts.cg.target_feature.split(',');
-- let unstable_options = sess.opts.debugging_opts.unstable_options;
-- let is_nightly = UnstableFeatures::from_environment().is_nightly_build();
- let found_negative = requested_features.clone().any(|r| r == "-crt-static");
- let found_positive = requested_features.clone().any(|r| r == "+crt-static");
-
@@ -263,14 +240,6 @@ index 124e7aafcc..492ceecaf1 100644
- found_positive
- };
-
-- // 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) {
-- sess.fatal("specifying the `crt-static` target feature is only allowed \
-- on the nightly channel with `-Z unstable-options` passed \
-- as well");
-- }
--
- if crt_static {
+ if sess.crt_static() {
cfg.insert((tf, Some(Symbol::intern("crt-static"))));