Skip to content

Commit 69aafcf

Browse files
committed
Build 1.40.0
1 parent 749e288 commit 69aafcf

11 files changed

+306
-0
lines changed

1.40.0/build.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
RUSTC_BOOTSTRAP_VERSION=1.39.0
4+
CARGO_BOOTSTRAP_VERSION=0.40.0
5+
RUST_VERSION=1.40.0
6+
7+
CONFIGURE_CARGO_STATIC_FLAGS="--enable-cargo-native-static"
8+
9+
# XXX: miri does not build correctly that's why we need the flag below.
10+
ADDITIONAL_CONFIGURE_FLAGS="--enable-missing-tools"
11+
12+
# Since rust 1.38, OPENSSL_DIR has to be specified.
13+
export OPENSSL_DIR="/usr/local"
14+
15+
BASE=`pwd`
16+
DEST=$1
17+
LLVM_ROOT=""
18+
19+
. ../checksums.sh
20+
. ../common.sh
21+
22+
fixup-vendor() {
23+
fixup-vendor-patch openssl src/version.rs || exit 1
24+
fixup-vendor-patch openssl src/ssl/mod.rs || exit 1
25+
fixup-vendor-patch openssl build.rs || exit 1
26+
fixup-vendor-patch openssl-sys build/main.rs || exit 1
27+
fixup-vendor-patch openssl-sys build/cfgs.rs || exit 1
28+
fixup-vendor-patch openssl-sys src/ssl.rs || exit 1
29+
fixup-vendor-patch openssl-sys src/crypto.rs || exit 1
30+
fixup-vendor-patch libc src/unix/bsd/freebsdlike/dragonfly/mod.rs || exit 1
31+
fixup-vendor-patch libc src/lib.rs || exit 1
32+
}
33+
34+
RUN info clean extract prepatch fixup-vendor config xbuild xdist inst 2>&1
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--- src/llvm-project/llvm/lib/Support/Unix/Path.inc.orig 2019-09-09 18:30:53 UTC
2+
+++ src/llvm-project/llvm/lib/Support/Unix/Path.inc
3+
@@ -56,13 +56,14 @@
4+
5+
#include <sys/types.h>
6+
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \
7+
- !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(_AIX)
8+
+ !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(_AIX) && \
9+
+ !defined(__DragonFly__)
10+
#include <sys/statvfs.h>
11+
#define STATVFS statvfs
12+
#define FSTATVFS fstatvfs
13+
#define STATVFS_F_FRSIZE(vfs) vfs.f_frsize
14+
#else
15+
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
16+
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
17+
#include <sys/mount.h>
18+
#include <sys/param.h>
19+
#elif defined(__linux__)
20+
@@ -93,7 +94,7 @@ typedef uint_t uint;
21+
#define STATVFS_F_FRSIZE(vfs) static_cast<uint64_t>(vfs.f_bsize)
22+
#endif
23+
24+
-#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__GNU__)
25+
+#if defined(__NetBSD__) || defined(__GNU__)
26+
#define STATVFS_F_FLAG(vfs) (vfs).f_flag
27+
#else
28+
#define STATVFS_F_FLAG(vfs) (vfs).f_flags
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- vendor/libc/src/lib.rs.orig 2019-11-04 17:34:41 UTC
2+
+++ vendor/libc/src/lib.rs
3+
@@ -21,7 +21,7 @@
4+
feature = "rustc-dep-of-std",
5+
feature(cfg_target_vendor, link_cfg, no_core)
6+
)]
7+
-#![cfg_attr(libc_thread_local, feature(thread_local))]
8+
+#![feature(thread_local)]
9+
// Enable extra lints:
10+
#![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))]
11+
#![deny(missing_copy_implementations, safe_packed_borrows)]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--- vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs.orig 2019-12-16 17:26:11 UTC
2+
+++ vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
3+
@@ -1053,7 +1053,18 @@ f! {
4+
}
5+
}
6+
7+
+// DragonFlyBSD's __error function is declared with "static inline", so it must
8+
+// be implemented in the libc crate, as a pointer to a static thread_local.
9+
+f! {
10+
+ pub fn __error() -> *mut ::c_int {
11+
+ &mut errno
12+
+ }
13+
+}
14+
+
15+
extern "C" {
16+
+ #[thread_local]
17+
+ pub static mut errno: ::c_int;
18+
+
19+
pub fn setgrent();
20+
pub fn mprotect(
21+
addr: *mut ::c_void,
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
--- vendor/openssl-sys/build/cfgs.rs.orig 2019-12-11 12:22:14 UTC
2+
+++ vendor/openssl-sys/build/cfgs.rs
3+
@@ -13,6 +13,9 @@ pub fn get(openssl_version: Option<u64>,
4+
if libressl_version >= 0x2_07_00_00_0 {
5+
cfgs.push("libressl270");
6+
}
7+
+ if libressl_version >= 0x2_07_01_00_0 {
8+
+ cfgs.push("libressl271");
9+
+ }
10+
if libressl_version >= 0x2_07_03_00_0 {
11+
cfgs.push("libressl273");
12+
}
13+
@@ -22,6 +25,25 @@ pub fn get(openssl_version: Option<u64>,
14+
if libressl_version >= 0x2_08_01_00_0 {
15+
cfgs.push("libressl281");
16+
}
17+
+ if libressl_version >= 0x2_09_01_00_0 {
18+
+ cfgs.push("libressl291");
19+
+ }
20+
+
21+
+ if libressl_version >= 0x2_09_02_00_0 {
22+
+ cfgs.push("libressl292");
23+
+ }
24+
+
25+
+ if libressl_version >= 0x3_00_00_00_0 {
26+
+ cfgs.push("libressl300");
27+
+ }
28+
+
29+
+ if libressl_version >= 0x3_00_01_00_0 {
30+
+ cfgs.push("libressl301");
31+
+ }
32+
+
33+
+ if libressl_version >= 0x3_00_02_00_0 {
34+
+ cfgs.push("libressl302");
35+
+ }
36+
} else {
37+
let openssl_version = openssl_version.unwrap();
38+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
--- vendor/openssl-sys/build/main.rs.orig 2019-12-11 12:22:26 UTC
2+
+++ vendor/openssl-sys/build/main.rs
3+
@@ -183,27 +183,32 @@ See rust-openssl README for more informa
4+
if let Some(libressl_version) = libressl_version {
5+
println!("cargo:libressl_version_number={:x}", libressl_version);
6+
7+
+ let major = (libressl_version >> 28) as u8;
8+
let minor = (libressl_version >> 20) as u8;
9+
let fix = (libressl_version >> 12) as u8;
10+
- let (minor, fix) = match (minor, fix) {
11+
- (5, 0) => ('5', '0'),
12+
- (5, 1) => ('5', '1'),
13+
- (5, 2) => ('5', '2'),
14+
- (5, _) => ('5', 'x'),
15+
- (6, 0) => ('6', '0'),
16+
- (6, 1) => ('6', '1'),
17+
- (6, 2) => ('6', '2'),
18+
- (6, _) => ('6', 'x'),
19+
- (7, _) => ('7', 'x'),
20+
- (8, 0) => ('8', '0'),
21+
- (8, 1) => ('8', '1'),
22+
- (8, _) => ('8', 'x'),
23+
- (9, 0) => ('9', '0'),
24+
+ let (major, minor, fix) = match (major, minor, fix) {
25+
+ (2, 5, 0) => ('2', '5', '0'),
26+
+ (2, 5, 1) => ('2', '5', '1'),
27+
+ (2, 5, 2) => ('2', '5', '2'),
28+
+ (2, 5, _) => ('2', '5', 'x'),
29+
+ (2, 6, 0) => ('2', '6', '0'),
30+
+ (2, 6, 1) => ('2', '6', '1'),
31+
+ (2, 6, 2) => ('2', '6', '2'),
32+
+ (2, 6, _) => ('2', '6', 'x'),
33+
+ (2, 7, _) => ('2', '7', 'x'),
34+
+ (2, 8, 0) => ('2', '8', '0'),
35+
+ (2, 8, 1) => ('2', '8', '1'),
36+
+ (2, 8, _) => ('2', '8', 'x'),
37+
+ (2, 9, 0) => ('2', '9', '0'),
38+
+ (2, 9, _) => ('2', '9', 'x'),
39+
+ (3, 0, 0) => ('3', '0', '0'),
40+
+ (3, 0, 1) => ('3', '0', '1'),
41+
+ (3, 0, _) => ('3', '0', 'x'),
42+
_ => version_error(),
43+
};
44+
45+
println!("cargo:libressl=true");
46+
- println!("cargo:libressl_version=2{}{}", minor, fix);
47+
+ println!("cargo:libressl_version={}{}{}", major, minor, fix);
48+
println!("cargo:version=101");
49+
Version::Libressl
50+
} else {
51+
@@ -239,7 +244,7 @@ fn version_error() -> ! {
52+
"
53+
54+
This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5
55+
-through 2.9.0, but a different version of OpenSSL was found. The build is now aborting
56+
+through 3.0.x, but a different version of OpenSSL was found. The build is now aborting
57+
due to this version mismatch.
58+
59+
"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--- vendor/openssl-sys/src/crypto.rs.orig 2019-12-11 12:22:57 UTC
2+
+++ vendor/openssl-sys/src/crypto.rs
3+
@@ -15,7 +15,13 @@ cfg_if! {
4+
if #[cfg(ossl110)] {
5+
pub const CRYPTO_EX_INDEX_SSL: c_int = 0;
6+
pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 1;
7+
-
8+
+ } else if #[cfg(libressl)] {
9+
+ pub const CRYPTO_EX_INDEX_SSL: c_int = 1;
10+
+ pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 2;
11+
+ }
12+
+}
13+
+cfg_if! {
14+
+ if #[cfg(any(ossl110, libressl271))] {
15+
extern "C" {
16+
pub fn OpenSSL_version_num() -> c_ulong;
17+
pub fn OpenSSL_version(key: c_int) -> *const c_char;
18+
@@ -64,7 +70,7 @@ pub type CRYPTO_EX_free = unsafe extern
19+
argp: *mut c_void,
20+
);
21+
extern "C" {
22+
- #[cfg(ossl110)]
23+
+ #[cfg(any(ossl110, libressl))]
24+
pub fn CRYPTO_get_ex_new_index(
25+
class_index: c_int,
26+
argl: c_long,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- vendor/openssl-sys/src/ssl.rs.orig 2019-12-11 12:25:52 UTC
2+
+++ vendor/openssl-sys/src/ssl.rs
3+
@@ -1057,7 +1057,7 @@ extern "C" {
4+
}
5+
6+
cfg_if! {
7+
- if #[cfg(ossl110)] {
8+
+ if #[cfg(any(ossl110, libressl291))] {
9+
extern "C" {
10+
pub fn TLS_method() -> *const SSL_METHOD;
11+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
--- vendor/openssl/build.rs.orig 2019-09-23 23:15:03 UTC
2+
+++ vendor/openssl/build.rs
3+
@@ -46,6 +46,10 @@ fn main() {
4+
println!("cargo:rustc-cfg=libressl270");
5+
}
6+
7+
+ if version >= 0x2_07_01_00_0 {
8+
+ println!("cargo:rustc-cfg=libressl271");
9+
+ }
10+
+
11+
if version >= 0x2_07_03_00_0 {
12+
println!("cargo:rustc-cfg=libressl273");
13+
}
14+
@@ -53,5 +57,25 @@ fn main() {
15+
if version >= 0x2_08_00_00_0 {
16+
println!("cargo:rustc-cfg=libressl280");
17+
}
18+
+
19+
+ if version >= 0x2_09_01_00_0 {
20+
+ println!("cargo:rustc-cfg=libressl291");
21+
+ }
22+
+
23+
+ if version >= 0x2_09_02_00_0 {
24+
+ println!("cargo:rustc-cfg=libressl292");
25+
+ }
26+
+
27+
+ if version >= 0x3_00_00_00_0 {
28+
+ println!("cargo:rustc-cfg=libressl300");
29+
+ }
30+
+
31+
+ if version >= 0x3_00_01_00_0 {
32+
+ println!("cargo:rustc-cfg=libressl301");
33+
+ }
34+
+
35+
+ if version >= 0x3_00_02_00_0 {
36+
+ println!("cargo:rustc-cfg=libressl302");
37+
+ }
38+
}
39+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--- vendor/openssl/src/ssl/mod.rs.orig 2019-09-23 23:15:03 UTC
2+
+++ vendor/openssl/src/ssl/mod.rs
3+
@@ -3690,9 +3690,14 @@ cfg_if! {
4+
}
5+
6+
cfg_if! {
7+
- if #[cfg(ossl110)] {
8+
+ if #[cfg(any(ossl110, libressl291))] {
9+
use ffi::{TLS_method, DTLS_method};
10+
-
11+
+ } else {
12+
+ use ffi::{SSLv23_method as TLS_method, DTLSv1_method as DTLS_method};
13+
+ }
14+
+}
15+
+cfg_if! {
16+
+ if #[cfg(ossl110)] {
17+
unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int {
18+
ffi::CRYPTO_get_ex_new_index(
19+
ffi::CRYPTO_EX_INDEX_SSL_CTX,
20+
@@ -3715,8 +3720,6 @@ cfg_if! {
21+
)
22+
}
23+
} else {
24+
- use ffi::{SSLv23_method as TLS_method, DTLSv1_method as DTLS_method};
25+
-
26+
unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int {
27+
ffi::SSL_CTX_get_ex_new_index(0, ptr::null_mut(), None, None, Some(f))
28+
}

0 commit comments

Comments
 (0)