rust: update

This commit is contained in:
Ella-0 2021-07-31 11:32:52 +00:00
parent 64d1875926
commit e0ecfd3071
7 changed files with 47 additions and 83 deletions

View file

@ -2,15 +2,14 @@ diff --git a/library/unwind/build.rs b/library/unwind/build.rs
index 24bcd40c..51777664 100644 index 24bcd40c..51777664 100644
--- a/library/unwind/build.rs --- a/library/unwind/build.rs
+++ b/library/unwind/build.rs +++ b/library/unwind/build.rs
@@ -14,7 +14,7 @@ fn main() { @@ -19,7 +19,7 @@
} else if target.contains("linux") { } else if target.contains("linux") {
// linking for Linux is handled in lib.rs // linking for Linux is handled in lib.rs
if target.contains("musl") { if target.contains("musl") {
- llvm_libunwind::compile(); - llvm_libunwind::compile();
+ println!("cargo:rustc-link-lib=unwind"); + println!("cargo:rustc-link-lib=unwind");
} } else if target.contains("android") {
} else if target.contains("freebsd") { let build = cc::Build::new();
println!("cargo:rustc-link-lib=gcc_s");
diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs
index dbdefa47..dca1897b 100644 index dbdefa47..dca1897b 100644
--- a/library/unwind/src/lib.rs --- 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 // not needed and contains symlinks which rustup currently
// chokes on when unpacking. // chokes on when unpacking.

File diff suppressed because one or more lines are too long

View file

@ -17,43 +17,29 @@
pkgname=rust pkgname=rust
pkgver=beta pkgver=beta
_clear_vendor_checksums() { _clear_vendor_checksums() {
sed -i 's/\("files":{\)[^}]*/\1/' vendor/$1/.cargo-checksum.json sed -i 's/\("files":{\)[^}]*/\1/' vendor/$1/.cargo-checksum.json
} }
# export RUSTROOT="/usr"
export RUSTROOT="/usr/src/rust-bootstrap/build/rust-root"
fetch() { fetch() {
curl "https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz" -o $pkgname-$pkgver.tar.xz 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 $pkgname-$pkgver.tar.xz
tar -xf rust-openssl.tar.gz
mv rustc-$pkgver-src $pkgname-$pkgver 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 . cp ../*.patch .
cd $pkgname-$pkgver cd $pkgname-$pkgver
patch -p1 < ../alpine-move-py.patch patch -p1 < ../alpine-move-py.patch
patch -p1 < ../abyss-install-template-shebang.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 < ../alpine-crt.patch
patch -p1 < ../libexec.patch patch -p1 < ../libexec.patch
patch -p1 < ../llvm_crt.patch patch -p1 < ../llvm_crt.patch
patch -p1 < ../unfreeze.patch patch -p1 < ../unfreeze.patch
patch -p1 < ../libresslssl.patch
sed -i /LD_LIBRARY_PATH/d src/bootstrap/bootstrap.py sed -i /LD_LIBRARY_PATH/d src/bootstrap/bootstrap.py
_clear_vendor_checksums libc _clear_vendor_checksums libc
@ -61,12 +47,6 @@ fetch() {
_clear_vendor_checksums openssl-src _clear_vendor_checksums openssl-src
_clear_vendor_checksums openssl _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/ rm -rf src/llvm-project/
cd .. cd ..
@ -77,13 +57,14 @@ build() {
cd $pkgname-$pkgver cd $pkgname-$pkgver
OPENSSL_LIB_DIR=/usr/lib/ ./configure \ OPENSSL_LIB_DIR=/usr/lib/ ./configure \
--build="x86_64-unknown-linux-musl" \ --build="$TRIPLE" \
--host="x86_64-unknown-linux-musl" \ --host="$TRIPLE" \
--target="x86_64-unknown-linux-musl" \ --target="$TRIPLE" \
--prefix="/usr" \ --prefix="/usr" \
--musl-root="/usr" \
--release-channel="beta" \ --release-channel="beta" \
--enable-local-rust \ --enable-local-rust \
--local-rust-root="/usr" \ --local-rust-root=$RUSTROOT \
--disable-docs \ --disable-docs \
--enable-extended \ --enable-extended \
--tools="cargo,rls,rustfmt,src" \ --tools="cargo,rls,rustfmt,src" \
@ -92,26 +73,26 @@ build() {
--enable-option-checking \ --enable-option-checking \
--python="python" \ --python="python" \
--llvm-root="/usr" \ --llvm-root="/usr" \
--llvm-libunwind="system" \
--enable-llvm-link-shared \ --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="rust.musl-root=/usr" \
--set="target.x86_64-unknown-linux-musl.musl-root=/usr" \ --set="target.$TRIPLE.musl-root=/usr" \
--set="target.x86_64-unknown-linux-musl.crt-static=false" \ --set="target.$TRIPLE.crt-static=false" \
--set="target.x86_64-unknown-linux-musl.cc=cc" \ --set="target.$TRIPLE.cc=cc" \
--set="target.x86_64-unknown-linux-musl.cxx=c++" \ --set="target.$TRIPLE.cxx=c++" \
--set="target.x86_64-unknown-linux-musl.ar=ar" \ --set="target.$TRIPLE.ar=ar" \
--set="target.x86_64-unknown-linux-musl.linker=cc" \ --set="target.$TRIPLE.linker=cc" \
--set="target.x86_64-unknown-linux-musl.musl-root=/usr" \ --set="target.$TRIPLE.crt-static=false" \
--set="target.x86_64-unknown-linux-musl.crt-static=false" \ --set="target.$TRIPLE.cc=cc" \
--set="target.x86_64-unknown-linux-musl.cc=cc" \ --set="target.$TRIPLE.cxx=c++" \
--set="target.x86_64-unknown-linux-musl.cxx=c++" \ --set="target.$TRIPLE.ar=ar" \
--set="target.x86_64-unknown-linux-musl.ar=ar" \ --set="target.$TRIPLE.linker=cc"
--set="target.x86_64-unknown-linux-musl.linker=cc"
sed 's/#deny-warnings = .*/deny-warnings = false/' -i config.toml 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() { package() {

10
pkgs/rust/libressl.patch Normal file
View 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(),
};

View file

@ -1,18 +1,14 @@
--- a/src/bootstrap/compile.rs --- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs
@@ -197,12 +197,6 @@ @@ -185,7 +185,7 @@
DependencyType::TargetSelfContained, // 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.
- for &obj in &["crtbegin.o", "crtbeginS.o", "crtend.o", "crtendS.o"] { - if target.contains("musl") {
- let src = compiler_file(builder, builder.cc(target), target, obj); + if false {
- let target = libdir_self_contained.join(obj); let srcdir = builder.musl_libdir(target).unwrap_or_else(|| {
- builder.copy(&src, &target); panic!("Target {:?} does not have a \"musl-libdir\" key", target.triple)
- target_deps.push((target, DependencyType::TargetSelfContained)); });
- }
} else if target.ends_with("-wasi") {
let srcdir = builder
.wasi_root(target)
--- a/compiler/rustc_target/src/spec/crt_objects.rs --- a/compiler/rustc_target/src/spec/crt_objects.rs
+++ b/compiler/rustc_target/src/spec/crt_objects.rs +++ b/compiler/rustc_target/src/spec/crt_objects.rs
@@ -64,24 +64,17 @@ @@ -64,24 +64,17 @@

View file

@ -1 +0,0 @@
/usr/bin/gmake

View file

@ -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");