rust: update to 1.21.0.

Disable building docs for now, broken __rde_oom?
This commit is contained in:
Leah Neukirchen 2017-10-16 14:51:57 +02:00
parent a70d363409
commit 2257b4b6a1
3 changed files with 142 additions and 76 deletions

View file

@ -1,16 +1,52 @@
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -21,3 +21,2 @@
use std::ffi::{OsStr, OsString};
--- rustc-1.21.0-src/src/liblibc/src/unix/mod.rs.orig
+++ rustc-1.21.0-src/src/liblibc/src/unix/mod.rs
@@ -228,10 +228,6 @@
} 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(any(all(target_env = "musl", not(target_arch = "mips"))))] {
- #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
- #[link(name = "c", cfg(not(target_feature = "crt-static")))]
- extern {}
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
--- rustc-1.21.0-src/src/bootstrap/compile.rs.orig
+++ rustc-1.21.0-src/src/bootstrap/compile.rs
@@ -127,9 +127,6 @@
fn copy_musl_third_party_objects(build: &Build,
target: Interned<String>,
into: &Path) {
- for &obj in &["crt1.o", "crti.o", "crtn.o"] {
- copy(&build.musl_root(target).unwrap().join("lib").join(obj), &into.join(obj));
- }
}
/// Configure cargo to compile the standard library, adding appropriate env vars
--- rustc-1.21.0-src/src/bootstrap/sanity.rs.orig
+++ rustc-1.21.0-src/src/bootstrap/sanity.rs
@@ -21,7 +21,6 @@
use std::collections::HashMap;
use std::env;
use std::ffi::{OsString, OsStr};
-use std::fs;
use std::process::Command;
@@ -132,27 +132,6 @@
panic!("the iOS target is only supported on OSX");
use std::path::PathBuf;
@@ -168,34 +167,6 @@
panic!("the iOS target is only supported on macOS");
}
- // Make sure musl-root is valid if specified
- // Make sure musl-root is valid
- if target.contains("musl") && !target.contains("mips") {
- match build.musl_root(target) {
- // If this is a native target (host is also musl) and no musl-root is given,
- // fall back to the system toolchain in /usr before giving up
- if build.musl_root(*target).is_none() && build.config.build == *target {
- let target = build.config.target_config.entry(target.clone())
- .or_insert(Default::default());
- target.musl_root = Some("/usr".into());
- }
- match build.musl_root(*target) {
- Some(root) => {
- if fs::metadata(root.join("lib/libc.a")).is_err() {
- panic!("couldn't find libc.a in musl dir: {}",
@ -32,69 +68,99 @@
if target.contains("msvc") {
// There are three builds of cmake on windows: MSVC, MinGW, and
// Cygwin. The Cygwin build does not have generators for Visual
--- a/src/liblibc/src/unix/mod.rs
+++ b/src/liblibc/src/unix/mod.rs
@@ -209,10 +209,6 @@
} else if #[cfg(all(not(stdbuild), feature = "use_std"))] {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
- } else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] {
- #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
- #[link(name = "c", cfg(not(target_feature = "crt-static")))]
- extern {}
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
--- a/src/librustc_back/target/x86_64_unknown_linux_musl.rs
+++ b/src/librustc_back/target/x86_64_unknown_linux_musl.rs
@@ -11,7 +11,7 @@
--- rustc-1.21.0-src/src/librustc_back/target/x86_64_unknown_linux_musl.rs.orig
+++ rustc-1.21.0-src/src/librustc_back/target/x86_64_unknown_linux_musl.rs
@@ -12,7 +12,7 @@
use target::{Target, TargetResult};
pub fn target() -> TargetResult {
- let mut base = super::linux_musl_base::opts();
+ let mut base = super::linux_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = 64;
base.pre_link_args.push("-m64".to_string());
--- a/src/libunwind/build.rs
+++ b/src/libunwind/build.rs
@@ -16,9 +16,7 @@
let target = env::var("TARGET").unwrap();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
--- rustc-1.21.0-src/src/libunwind/build.rs.orig
+++ rustc-1.21.0-src/src/libunwind/build.rs
@@ -15,9 +15,7 @@
let target = env::var("TARGET").expect("TARGET was not set");
if target.contains("linux") {
- if target.contains("musl") && !target.contains("mips") {
- println!("cargo:rustc-link-lib=static=unwind");
- // musl is handled in lib.rs
- } else if !target.contains("android") {
+ if !target.contains("android") {
println!("cargo:rustc-link-lib=gcc_s");
}
} else if target.contains("freebsd") {
--- rustc-1.19.0-src/src/bootstrap/compile.rs.orig
+++ rustc-1.19.0-src/src/bootstrap/compile.rs
@@ -114,10 +114,6 @@
let libdir = build.sysroot_libdir(target_compiler, target);
add_to_sysroot(&libdir, &libstd_stamp(build, compiler, target));
--- rustc-1.21.0-src/src/libunwind/lib.rs.orig
+++ rustc-1.21.0-src/src/libunwind/lib.rs
@@ -28,7 +28,3 @@
#[cfg(not(target_env = "msvc"))]
pub use libunwind::*;
- if target.contains("musl") && !target.contains("mips") {
- 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
@@ -126,15 +122,6 @@
-#[cfg(all(target_env = "musl", not(target_arch = "mips")))]
-#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))]
-#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
-extern {}
--- rustc-1.21.0-src/src/bootstrap/compile.rs.orig
+++ rustc-1.21.0-src/src/bootstrap/compile.rs
@@ -82,7 +82,6 @@
// still contain the musl startup objects.
if target.contains("musl") && !target.contains("mips") {
let libdir = builder.sysroot_libdir(compiler, target);
- copy_musl_third_party_objects(build, target, &libdir);
}
builder.ensure(StdLink {
@@ -99,7 +98,6 @@
if target.contains("musl") && !target.contains("mips") {
let libdir = builder.sysroot_libdir(compiler, target);
- copy_musl_third_party_objects(build, target, &libdir);
}
let out_dir = build.cargo_out(compiler, Mode::Libstd, target);
@@ -118,17 +116,6 @@
}
}
-/// Copies the crt(1,i,n).o startup objects
-///
-/// Only required for musl targets that statically link to libc
-fn copy_musl_third_party_objects(build: &Build, target: &str, into: &Path) {
- for &obj in &["crt1.o", "crti.o", "crtn.o"] {
- copy(&build.musl_root(target).unwrap().join("lib").join(obj), &into.join(obj));
- }
-/// 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.
-fn copy_musl_third_party_objects(build: &Build,
- target: Interned<String>,
- into: &Path) {
-}
-
fn copy_apple_sanitizer_dylibs(native_dir: &Path, platform: &str, into: &Path) {
for &sanitizer in &["asan", "tsan"] {
let filename = format!("libclang_rt.{}_{}_dynamic.dylib", sanitizer, platform);
/// Configure cargo to compile the standard library, adding appropriate env vars
/// and such.
pub fn std_cargo(build: &Build,
--- rustc-1.21.0-src/src/bootstrap/compile.rs.orig
+++ rustc-1.21.0-src/src/bootstrap/compile.rs
@@ -78,12 +78,6 @@
});
println!("Uplifting stage1 std ({} -> {})", from.host, target);
- // Even if we're not building std this stage, the new sysroot must
- // still contain the musl startup objects.
- if target.contains("musl") && !target.contains("mips") {
- let libdir = builder.sysroot_libdir(compiler, target);
- }
-
builder.ensure(StdLink {
compiler: from,
target_compiler: compiler,
@@ -96,10 +90,6 @@
println!("Building stage{} std artifacts ({} -> {})", compiler.stage,
&compiler.host, target);
- if target.contains("musl") && !target.contains("mips") {
- let libdir = builder.sysroot_libdir(compiler, target);
- }
-
let out_dir = build.cargo_out(compiler, Mode::Libstd, target);
build.clear_if_dirty(&out_dir, &builder.rustc(compiler));
let mut cargo = builder.cargo(compiler, Mode::Libstd, target, "build");

View file

@ -1,9 +1,9 @@
--- rustc-1.12.0/src/librustc_llvm/lib.rs.orig
+++ rustc-1.12.0/src/librustc_llvm/lib.rs
@@ -481,3 +481,6 @@
mod llvmdeps {
include! { env!("CFG_LLVM_LINKAGE_FILE") }
--- rustc-1.21.0-src/src/librustc_llvm/lib.rs.orig
+++ rustc-1.21.0-src/src/librustc_llvm/lib.rs
@@ -425,3 +425,6 @@
}
}
}
+
+#[link(name = "ffi")]
+extern {}
+#[link(name = "ffi")]
+extern {}

View file

@ -1,6 +1,6 @@
# Template file for 'rust'
pkgname=rust
version=1.20.0
version=1.21.0
revision=1
# NB. if you push any(!) new version, don't forget to put a build
# output of musl to https://repo.voidlinux.eu/distfiles/
@ -17,40 +17,40 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
homepage="http://www.rust-lang.org/"
license="MIT, Apache-2.0"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
checksum=2aa4875ff4472c6e35262bbb9052cb2623da3dae6084a858cc59d36f33f18214
checksum=1707c142244b5bd909993559c6116c81987c1de21d6207c05d3ecbe5bba548fa
case "$XBPS_MACHINE" in
x86_64-musl)
hostmakedepends+=" libcurl libgit2"
distfiles+="
https://repo.voidlinux.eu/distfiles/rustc-1.19.0-x86_64-unknown-linux-musl.tar.gz
https://repo.voidlinux.eu/distfiles/rust-std-1.19.0-x86_64-unknown-linux-musl.tar.gz
https://repo.voidlinux.eu/distfiles/rustc-1.20.0-x86_64-unknown-linux-musl.tar.gz
https://repo.voidlinux.eu/distfiles/rust-std-1.20.0-x86_64-unknown-linux-musl.tar.gz
https://repo.voidlinux.eu/distfiles/cargo-0.18.0-x86_64-unknown-linux-musl.tar.gz"
checksum+="
28aa0f1335fad547072602520a773d29000785aceaed9ec71b1b207256b31d1f
4e9e92c56708cccc5f567058b21bc62cb0a40bf2ed38466f0dc28eac64aae7d2
34b84dc375ef8fb9261762e548b49c4e4c652b5cf3696e6a41a110512c3f2471
a5b14cf320e3ead97b2afdd9b5df21fa05515ff5d52d19fc7691b377ad6cc968
28f2ee839f14f8b3edf3f4e4cc8600ac99ea50905ee8fb91116bba676728c2e9"
;;
x86_64)
# extract from src/stage0.txt
distfiles+="
https://static.rust-lang.org/dist/2017-07-20/rustc-1.19.0-x86_64-unknown-linux-gnu.tar.gz
https://static.rust-lang.org/dist/2017-07-20/rust-std-1.19.0-x86_64-unknown-linux-gnu.tar.gz
https://static.rust-lang.org/dist/2017-08-31/rustc-1.20.0-x86_64-unknown-linux-gnu.tar.gz
https://static.rust-lang.org/dist/2017-08-31/rust-std-1.20.0-x86_64-unknown-linux-gnu.tar.gz
https://s3.amazonaws.com/rust-lang-ci/cargo-builds/6b05583d71f982bcad049b9fa094c637c062e751/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz"
checksum+="
4c8df3088d17c8e06bf58d453d39bd521487defcefc8193203b80f0fb797d6fe
5905803e8a127f656bf253978692f0d6cf6c9206c527e4d6d7e981980618d1b6
000e776431718a32b5d40c4aa6e09b3425f0b71dea8c95e718d29b8c0f5b35d3
a1b3e13b9d6f9aa713783145cb83070b1dabbe17349043b3528031d7712ca929
d9e69d2b87dc0cf7fafe0e0eb64f82fe3414ef14fcb27f5eeff34df860e459d9"
;;
i686)
# extract from src/stage0.txt
distfiles+="
https://static.rust-lang.org/dist/2017-07-20/rustc-1.19.0-i686-unknown-linux-gnu.tar.gz
https://static.rust-lang.org/dist/2017-07-20/rust-std-1.19.0-i686-unknown-linux-gnu.tar.gz
https://static.rust-lang.org/dist/2017-08-31/rustc-1.20.0-i686-unknown-linux-gnu.tar.gz
https://static.rust-lang.org/dist/2017-08-31/rust-std-1.20.0-i686-unknown-linux-gnu.tar.gz
https://s3.amazonaws.com/rust-lang-ci/cargo-builds/6b05583d71f982bcad049b9fa094c637c062e751/cargo-nightly-i686-unknown-linux-gnu.tar.gz"
checksum+="
33377c93d8afc08f3f211adcfb88b0e9bb0fba5af2ee52016293921c14aa355c
7cdc76ef163050e9bc352d0ffc48d7d40ae66be0eb1fa1295e0635665c6e32ef
f8ee3a910df757b071472146f7c9ed70b0990f20e7a623cf16c8ada4f6e4e620
f18fbdc7217f9b014a823c7308407ef30610ebf32f76d879bfa3e3f6937079df
863a4f92bbeec76257403fd571a90b90bd759ec8bcaddb7517fb89d40959e9e5"
;;
esac
@ -111,6 +111,7 @@ do_configure() {
--build=${_triplet}
--release-channel=stable
--disable-rpath
--disable-docs
--enable-ccache
--llvm-root=/usr
--enable-local-rust
@ -128,7 +129,6 @@ do_install() {
vmkdir usr
tar xf build/dist/rustc-*-*-*.tar.gz -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in
tar xf build/dist/rust-std-*-*-*.tar.gz -C "$DESTDIR/usr/lib" --strip-components=3 --exclude=manifest.in
tar xf build/dist/rust-docs-*-*-*.tar.gz -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in
vlicense COPYRIGHT
vlicense LICENSE-APACHE