rust: update
This commit is contained in:
parent
64d1875926
commit
e0ecfd3071
7 changed files with 47 additions and 83 deletions
|
@ -2,15 +2,14 @@ diff --git a/library/unwind/build.rs b/library/unwind/build.rs
|
|||
index 24bcd40c..51777664 100644
|
||||
--- a/library/unwind/build.rs
|
||||
+++ b/library/unwind/build.rs
|
||||
@@ -14,7 +14,7 @@ fn main() {
|
||||
@@ -19,7 +19,7 @@
|
||||
} else if target.contains("linux") {
|
||||
// linking for Linux is handled in lib.rs
|
||||
if target.contains("musl") {
|
||||
- llvm_libunwind::compile();
|
||||
+ println!("cargo:rustc-link-lib=unwind");
|
||||
}
|
||||
} else if target.contains("freebsd") {
|
||||
println!("cargo:rustc-link-lib=gcc_s");
|
||||
} else if target.contains("android") {
|
||||
let build = cc::Build::new();
|
||||
diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs
|
||||
index dbdefa47..dca1897b 100644
|
||||
--- a/library/unwind/src/lib.rs
|
||||
|
@ -36,3 +35,4 @@ diff -Naur rustc-1.48.0-src.orig/src/bootstrap/dist.rs rustc-1.48.0-src/src/boot
|
|||
&[
|
||||
// not needed and contains symlinks which rustup currently
|
||||
// chokes on when unpacking.
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -17,43 +17,29 @@
|
|||
pkgname=rust
|
||||
pkgver=beta
|
||||
|
||||
|
||||
_clear_vendor_checksums() {
|
||||
sed -i 's/\("files":{\)[^}]*/\1/' vendor/$1/.cargo-checksum.json
|
||||
}
|
||||
|
||||
# export RUSTROOT="/usr"
|
||||
export RUSTROOT="/usr/src/rust-bootstrap/build/rust-root"
|
||||
|
||||
fetch() {
|
||||
curl "https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz" -o $pkgname-$pkgver.tar.xz
|
||||
curl -L "https://github.com/sfackler/rust-openssl/archive/refs/tags/openssl-v0.10.34.tar.gz" -o rust-openssl.tar.gz
|
||||
# curl -L "https://github.com/sfackler/rust-openssl/archive/master.tar.gz" -o rust-openssl.tar.gz
|
||||
# curl "https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz" -o $pkgname-
|
||||
tar -xf $pkgname-$pkgver.tar.xz
|
||||
tar -xf rust-openssl.tar.gz
|
||||
|
||||
mv rustc-$pkgver-src $pkgname-$pkgver
|
||||
|
||||
# tar -xf rust-openssl.tar.gz
|
||||
|
||||
# cp rust-$pkgver/vendor/openssl/.cargo-checksum.json rust-openssl-master/openssl/
|
||||
# cp rust-$pkgver/vendor/openssl-sys/.cargo-checksum.json rust-openssl-master/openssl-sys/
|
||||
|
||||
# rm -r rust-$pkgver/vendor/openssl-sys
|
||||
# rm -r rust-$pkgver/vendor/openssl
|
||||
## cp -r rust-openssl-master/openssl rust-$pkgver/vendor/openssl
|
||||
# cp -r rust-openssl-master/openssl-sys rust-$pkgver/vendor/openssl-sys
|
||||
|
||||
cp ../*.patch .
|
||||
cd $pkgname-$pkgver
|
||||
patch -p1 < ../alpine-move-py.patch
|
||||
patch -p1 < ../abyss-install-template-shebang.patch
|
||||
patch -p1 < ../abyss-libunwind.patch
|
||||
patch -p1 < ../abyss-libz.patch
|
||||
# patch -p1 < ../vendored-ssl.patch
|
||||
# patch -p1 < ../openbsd-libressl.patch
|
||||
patch -p1 < ../alpine-crt.patch
|
||||
patch -p1 < ../libexec.patch
|
||||
patch -p1 < ../llvm_crt.patch
|
||||
patch -p1 < ../unfreeze.patch
|
||||
patch -p1 < ../libresslssl.patch
|
||||
|
||||
sed -i /LD_LIBRARY_PATH/d src/bootstrap/bootstrap.py
|
||||
_clear_vendor_checksums libc
|
||||
|
@ -61,12 +47,6 @@ fetch() {
|
|||
_clear_vendor_checksums openssl-src
|
||||
_clear_vendor_checksums openssl
|
||||
|
||||
cp -r ../rust-openssl-openssl-v0.10.34/openssl/ vendor/
|
||||
cp -r ../rust-openssl-openssl-v0.10.34/openssl-sys/ vendor/
|
||||
sed vendor/openssl/Cargo.toml -i -e 's/0.10.34/0.10.30/g'
|
||||
sed vendor/openssl/Cargo.toml -i -e 's/0.9.62/0.9.58/g'
|
||||
sed vendor/openssl-sys/Cargo.toml -i -e 's/0.9.62/0.9.58/g'
|
||||
|
||||
rm -rf src/llvm-project/
|
||||
|
||||
cd ..
|
||||
|
@ -77,13 +57,14 @@ build() {
|
|||
cd $pkgname-$pkgver
|
||||
|
||||
OPENSSL_LIB_DIR=/usr/lib/ ./configure \
|
||||
--build="x86_64-unknown-linux-musl" \
|
||||
--host="x86_64-unknown-linux-musl" \
|
||||
--target="x86_64-unknown-linux-musl" \
|
||||
--build="$TRIPLE" \
|
||||
--host="$TRIPLE" \
|
||||
--target="$TRIPLE" \
|
||||
--prefix="/usr" \
|
||||
--musl-root="/usr" \
|
||||
--release-channel="beta" \
|
||||
--enable-local-rust \
|
||||
--local-rust-root="/usr" \
|
||||
--local-rust-root=$RUSTROOT \
|
||||
--disable-docs \
|
||||
--enable-extended \
|
||||
--tools="cargo,rls,rustfmt,src" \
|
||||
|
@ -92,26 +73,26 @@ build() {
|
|||
--enable-option-checking \
|
||||
--python="python" \
|
||||
--llvm-root="/usr" \
|
||||
--llvm-libunwind="system" \
|
||||
--enable-llvm-link-shared \
|
||||
--set="target.x86_64-unknown-linux-musl.llvm-config=/usr/bin/llvm-config" \
|
||||
--set="target.$TRIPLE.llvm-config=/usr/bin/llvm-config" \
|
||||
--set="rust.musl-root=/usr" \
|
||||
--set="target.x86_64-unknown-linux-musl.musl-root=/usr" \
|
||||
--set="target.x86_64-unknown-linux-musl.crt-static=false" \
|
||||
--set="target.x86_64-unknown-linux-musl.cc=cc" \
|
||||
--set="target.x86_64-unknown-linux-musl.cxx=c++" \
|
||||
--set="target.x86_64-unknown-linux-musl.ar=ar" \
|
||||
--set="target.x86_64-unknown-linux-musl.linker=cc" \
|
||||
--set="target.x86_64-unknown-linux-musl.musl-root=/usr" \
|
||||
--set="target.x86_64-unknown-linux-musl.crt-static=false" \
|
||||
--set="target.x86_64-unknown-linux-musl.cc=cc" \
|
||||
--set="target.x86_64-unknown-linux-musl.cxx=c++" \
|
||||
--set="target.x86_64-unknown-linux-musl.ar=ar" \
|
||||
--set="target.x86_64-unknown-linux-musl.linker=cc"
|
||||
--set="target.$TRIPLE.musl-root=/usr" \
|
||||
--set="target.$TRIPLE.crt-static=false" \
|
||||
--set="target.$TRIPLE.cc=cc" \
|
||||
--set="target.$TRIPLE.cxx=c++" \
|
||||
--set="target.$TRIPLE.ar=ar" \
|
||||
--set="target.$TRIPLE.linker=cc" \
|
||||
--set="target.$TRIPLE.crt-static=false" \
|
||||
--set="target.$TRIPLE.cc=cc" \
|
||||
--set="target.$TRIPLE.cxx=c++" \
|
||||
--set="target.$TRIPLE.ar=ar" \
|
||||
--set="target.$TRIPLE.linker=cc"
|
||||
|
||||
sed 's/#deny-warnings = .*/deny-warnings = false/' -i config.toml
|
||||
sed 's|deny(warnings,|deny(|' -i src/bootstrap/lib.rs
|
||||
# sed 's|deny(warnings,|deny(|' -i src/bootstrap/lib.rs
|
||||
|
||||
PATH=$(pwd)"/..:$PATH" ./x.py build
|
||||
./x.py build
|
||||
}
|
||||
|
||||
package() {
|
||||
|
|
10
pkgs/rust/libressl.patch
Normal file
10
pkgs/rust/libressl.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- a/vendor/openssl-sys/build/main.rs
|
||||
+++ b/vendor/openssl-sys/build/main.rs
|
||||
@@ -232,6 +232,7 @@
|
||||
(3, 2, _) => ('3', '2', 'x'),
|
||||
(3, 3, 0) => ('3', '3', '0'),
|
||||
(3, 3, 1) => ('3', '3', '1'),
|
||||
+ (3, 3, 2) => ('3', '3', '2'),
|
||||
_ => version_error(),
|
||||
};
|
||||
|
|
@ -1,18 +1,14 @@
|
|||
--- a/src/bootstrap/compile.rs
|
||||
+++ b/src/bootstrap/compile.rs
|
||||
@@ -197,12 +197,6 @@
|
||||
DependencyType::TargetSelfContained,
|
||||
);
|
||||
}
|
||||
- for &obj in &["crtbegin.o", "crtbeginS.o", "crtend.o", "crtendS.o"] {
|
||||
- let src = compiler_file(builder, builder.cc(target), target, obj);
|
||||
- let target = libdir_self_contained.join(obj);
|
||||
- builder.copy(&src, &target);
|
||||
- target_deps.push((target, DependencyType::TargetSelfContained));
|
||||
- }
|
||||
} else if target.ends_with("-wasi") {
|
||||
let srcdir = builder
|
||||
.wasi_root(target)
|
||||
@@ -185,7 +185,7 @@
|
||||
// to using gcc from a glibc-targeting toolchain for linking.
|
||||
// To do that we have to distribute musl startup objects as a part of Rust toolchain
|
||||
// and link with them manually in the self-contained mode.
|
||||
- if target.contains("musl") {
|
||||
+ if false {
|
||||
let srcdir = builder.musl_libdir(target).unwrap_or_else(|| {
|
||||
panic!("Target {:?} does not have a \"musl-libdir\" key", target.triple)
|
||||
});
|
||||
--- a/compiler/rustc_target/src/spec/crt_objects.rs
|
||||
+++ b/compiler/rustc_target/src/spec/crt_objects.rs
|
||||
@@ -64,24 +64,17 @@
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
/usr/bin/gmake
|
|
@ -1,14 +0,0 @@
|
|||
$OpenBSD: patch-vendor_openssl-sys_build_main_rs,v 1.5 2020/11/05 09:21:34 semarie Exp $
|
||||
The LibreSSL version in -current isn't explicitly supported.
|
||||
Index: vendor/openssl-sys/build/main.rs
|
||||
--- a/vendor/openssl-sys/build/main.rs.orig
|
||||
+++ b/vendor/openssl-sys/build/main.rs
|
||||
@@ -221,7 +221,7 @@ See rust-openssl README for more information:
|
||||
(3, 1, 0) => ('3', '1', '0'),
|
||||
(3, 1, _) => ('3', '1', 'x'),
|
||||
(3, 2, 0) => ('3', '2', '0'),
|
||||
- _ => version_error(),
|
||||
+ _ => ('3', '2', '0'),
|
||||
};
|
||||
|
||||
println!("cargo:libressl=true");
|
Loading…
Reference in a new issue