rust fixes
This commit is contained in:
		
							parent
							
								
									c5f93c496e
								
							
						
					
					
						commit
						af9e8fe900
					
				
					 7 changed files with 23 additions and 160 deletions
				
			
		|  | @ -1,10 +0,0 @@ | ||||||
| The script seems to be POSIX-sh (+ local) compatible. |  | ||||||
| 
 |  | ||||||
| --- a/src/tools/rust-installer/install-template.sh
 |  | ||||||
| +++ b/src/tools/rust-installer/install-template.sh
 |  | ||||||
| @@ -1,4 +1,4 @@
 |  | ||||||
| -#!/bin/bash
 |  | ||||||
| +#!/bin/sh
 |  | ||||||
|  # Copyright 2014 The Rust Project Developers. See the COPYRIGHT |  | ||||||
|  # file at the top-level directory of this distribution and at |  | ||||||
|  # http://rust-lang.org/COPYRIGHT. |  | ||||||
|  | @ -1,38 +0,0 @@ | ||||||
| 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
 |  | ||||||
| @@ -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("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
 |  | ||||||
| +++ b/library/unwind/src/lib.rs
 |  | ||||||
| @@ -39,7 +39,7 @@ cfg_if::cfg_if! {
 |  | ||||||
|   |  | ||||||
|  #[cfg(target_env = "musl")] |  | ||||||
|  #[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))] |  | ||||||
| -#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
 |  | ||||||
| +#[link(name = "unwind", cfg(not(target_feature = "crt-static")))]
 |  | ||||||
|  extern "C" {} |  | ||||||
|   |  | ||||||
|  // When building with crt-static, we get `gcc_eh` from the `libc` crate, since |  | ||||||
| diff -Naur rustc-1.48.0-src.orig/src/bootstrap/dist.rs rustc-1.48.0-src/src/bootstrap/dist.rs
 |  | ||||||
| --- rustc-1.48.0-src.orig/src/bootstrap/dist.rs		2020-12-22 16:39:30.504249113 +0100
 |  | ||||||
| +++ rustc-1.48.0-src/src/bootstrap/dist.rs			2020-12-22 16:42:08.663006830 +0100
 |  | ||||||
| @@ -1016,7 +1016,7 @@
 |  | ||||||
|          copy_src_dirs( |  | ||||||
|              builder, |  | ||||||
|              &builder.src, |  | ||||||
| -            &["library", "src/llvm-project/libunwind"],
 |  | ||||||
| +            &["library"],
 |  | ||||||
|              &[ |  | ||||||
|                  // not needed and contains symlinks which rustup currently |  | ||||||
|                  // chokes on when unpacking. |  | ||||||
| 
 |  | ||||||
|  | @ -1,23 +0,0 @@ | ||||||
| --- a/src/etc/rust-gdb
 |  | ||||||
| +++ b/src/etc/rust-gdb
 |  | ||||||
| @@ -12,7 +12,7 @@
 |  | ||||||
|   |  | ||||||
|  # Find out where the pretty printer Python module is |  | ||||||
|  RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" |  | ||||||
| -GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
 |  | ||||||
| +GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/share/rust/etc"
 |  | ||||||
|   |  | ||||||
|  # Run GDB with the additional arguments that load the pretty printers |  | ||||||
|  # Set the environment variable `RUST_GDB` to overwrite the call to a |  | ||||||
|  # Set the environment variable `RUST_GDB` to overwrite the call to a |  | ||||||
| --- a/src/etc/rust-lldb
 |  | ||||||
| +++ b/src/etc/rust-lldb
 |  | ||||||
| @@ -8,7 +8,7 @@
 |  | ||||||
|   |  | ||||||
|  # Find out where to look for the pretty printer Python module |  | ||||||
|  RUSTC_SYSROOT=$(rustc --print sysroot) |  | ||||||
| -RUST_LLDB="$RUSTC_SYSROOT/lib/rustlib/$host/bin/lldb"
 |  | ||||||
| +RUST_LLDB="$RUSTC_SYSROOT/share/rust/etc"
 |  | ||||||
|   |  | ||||||
|  lldb=lldb |  | ||||||
|  if [ -f "$RUST_LLDB" ]; then |  | ||||||
|  | @ -21,10 +21,10 @@ _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" | ||||||
| export RUSTROOT="/usr/src/rust-bootstrap/build/rust-root" |  | ||||||
| 
 | 
 | ||||||
| fetch() { | fetch() { | ||||||
|  | 	return | ||||||
| 	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 | ||||||
| 	tar -xf $pkgname-$pkgver.tar.xz | 	tar -xf $pkgname-$pkgver.tar.xz | ||||||
| 
 | 
 | ||||||
|  | @ -33,26 +33,18 @@ fetch() { | ||||||
| 
 | 
 | ||||||
| 	cp ../*.patch . | 	cp ../*.patch . | ||||||
| 	cd $pkgname-$pkgver | 	cd $pkgname-$pkgver | ||||||
| 	# patch -p1 < ../alpine-move-py.patch |  | ||||||
| 	# patch -p1 < ../abyss-install-template-shebang.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 < ../fix-curl.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 curl | ||||||
| 	_clear_vendor_checksums openssl-sys | 	_clear_vendor_checksums curl-sys | ||||||
| 	_clear_vendor_checksums openssl-src |  | ||||||
| 	_clear_vendor_checksums openssl |  | ||||||
| 
 |  | ||||||
| 	cd .. |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| build() { | build() { | ||||||
| 	cd $pkgname-$pkgver | 	cd $pkgname-$pkgver | ||||||
| 
 | 	return | ||||||
|     #	--tools="cargo,rls,rustfmt,src" \ |     #	--tools="cargo,rls,rustfmt,src" \ | ||||||
| 	OPENSSL_LIB_DIR=/usr/lib/ ./configure \ | 	OPENSSL_LIB_DIR=/usr/lib/ ./configure \ | ||||||
| 		--build="$TRIPLE" \ | 		--build="$TRIPLE" \ | ||||||
|  | @ -98,6 +90,10 @@ package() { | ||||||
| 	DESTDIR="$pkgdir" ./x.py install | 	DESTDIR="$pkgdir" ./x.py install | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | backup() { | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  | 
 | ||||||
| license() { | license() { | ||||||
| 	cd $pkgname-$pkgver | 	cd $pkgname-$pkgver | ||||||
| 	cat LICENSE-MIT | 	cat LICENSE-MIT | ||||||
|  |  | ||||||
							
								
								
									
										13
									
								
								extra/rust/fix-curl.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								extra/rust/fix-curl.patch
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | ||||||
|  | diff --git a/vendor/curl-sys/build.rs b/vendor/curl-sys/build.rs
 | ||||||
|  | index 24475cc..3249440 100644
 | ||||||
|  | --- a/vendor/curl-sys/build.rs
 | ||||||
|  | +++ b/vendor/curl-sys/build.rs
 | ||||||
|  | @@ -111,6 +111,8 @@ fn main() {
 | ||||||
|  |          .include("curl/lib") | ||||||
|  |          .include("curl/include") | ||||||
|  |          .define("BUILDING_LIBCURL", None) | ||||||
|  | +        .define("CURL_CA_BUNDLE", "\"/etc/ssl/cert.pem\"")
 | ||||||
|  | +        .define("CURL_CA_PATH", "\"/etc/ssl/certs\"")
 | ||||||
|  |          .define("CURL_DISABLE_DICT", None) | ||||||
|  |          .define("CURL_DISABLE_GOPHER", None) | ||||||
|  |          .define("CURL_DISABLE_IMAP", None) | ||||||
|  | @ -1,10 +0,0 @@ | ||||||
| --- 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,65 +0,0 @@ | ||||||
| --- a/vendor/openssl-sys/Cargo.toml
 |  | ||||||
| +++ b/vendor/openssl-sys/Cargo.toml
 |  | ||||||
| @@ -33,12 +33,11 @@
 |  | ||||||
| 
 |  | ||||||
|  [build-dependencies.openssl-src] |  | ||||||
|  version = "111.0.1" |  | ||||||
| -optional = true
 |  | ||||||
| 
 |  | ||||||
|  [build-dependencies.pkg-config] |  | ||||||
|  version = "0.3.9" |  | ||||||
| 
 |  | ||||||
|  [features] |  | ||||||
| -vendored = ["openssl-src"]
 |  | ||||||
| +vendored = []
 |  | ||||||
|  [target."cfg(target_env = \"msvc\")".build-dependencies.vcpkg] |  | ||||||
|  version = "0.2.8" |  | ||||||
| Only in ../../rust-1.49.0/vendor/openssl-sys: Cargo.toml.1 |  | ||||||
| --- a/vendor/openssl-sys/build/main.rs
 |  | ||||||
| +++ b/vendor/openssl-sys/build/main.rs
 |  | ||||||
| @@ -2,7 +2,6 @@
 |  | ||||||
| 
 |  | ||||||
|  extern crate autocfg; |  | ||||||
|  extern crate cc; |  | ||||||
| -#[cfg(feature = "vendored")]
 |  | ||||||
|  extern crate openssl_src; |  | ||||||
|  extern crate pkg_config; |  | ||||||
|  #[cfg(target_env = "msvc")] |  | ||||||
| @@ -16,7 +15,6 @@
 |  | ||||||
|  mod cfgs; |  | ||||||
| 
 |  | ||||||
|  mod find_normal; |  | ||||||
| -#[cfg(feature = "vendored")]
 |  | ||||||
|  mod find_vendored; |  | ||||||
| 
 |  | ||||||
|  enum Version { |  | ||||||
| @@ -44,15 +42,14 @@
 |  | ||||||
|  } |  | ||||||
| 
 |  | ||||||
|  fn find_openssl(target: &str) -> (PathBuf, PathBuf) { |  | ||||||
| -    #[cfg(feature = "vendored")]
 |  | ||||||
|      { |  | ||||||
|          // vendor if the feature is present, unless |  | ||||||
|          // OPENSSL_NO_VENDOR exists and isn't `0` |  | ||||||
| -        if env("OPENSSL_NO_VENDOR").map_or(true, |s| s == "0") {
 |  | ||||||
| +        //if env("OPENSSL_NO_VENDOR").map_or(true, |s| s == "0") {
 |  | ||||||
|              return find_vendored::get_openssl(target); |  | ||||||
| -        }
 |  | ||||||
| +        //}
 |  | ||||||
|      } |  | ||||||
| -    find_normal::get_openssl(target)
 |  | ||||||
| +    //find_normal::get_openssl(target)
 |  | ||||||
|  } |  | ||||||
| 
 |  | ||||||
|  fn main() { |  | ||||||
| --- a/vendor/openssl-src/src/lib.rs
 |  | ||||||
| +++ b/vendor/openssl-src/src/lib.rs
 |  | ||||||
| @@ -58,7 +58,7 @@
 |  | ||||||
|          { |  | ||||||
|              Command::new("gmake") |  | ||||||
|          } else { |  | ||||||
| -            Command::new("make")
 |  | ||||||
| +            Command::new("gmake")
 |  | ||||||
|          } |  | ||||||
|      } |  | ||||||
|   |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue