Skip to content

Commit 16f3fd1

Browse files
committed
Build 1.65.0
1 parent bb2f271 commit 16f3fd1

8 files changed

+322
-0
lines changed

1.65.0/build.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
RUSTC_BOOTSTRAP_VERSION=1.64.0
4+
CARGO_BOOTSTRAP_VERSION=1.64.0
5+
RUST_VERSION=1.65.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 build.rs || exit 1
24+
fixup-vendor-patch openssl-sys build/cfgs.rs || exit 1
25+
fixup-vendor-patch libc src/unix/bsd/freebsdlike/dragonfly/mod.rs || exit 1
26+
fixup-vendor-patch rustix src/imp/libc/process/types.rs || exit 1
27+
fixup-vendor-patch rustix src/imp/libc/fs/dir.rs || exit 1
28+
}
29+
30+
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 2020-09-22 17:14:20 UTC
2+
+++ src/llvm-project/llvm/lib/Support/Unix/Path.inc
3+
@@ -69,13 +69,14 @@ extern char **environ;
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+
@@ -106,7 +107,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__) || (__GNU__) || \
26+
defined(__MVS__)
27+
#define STATVFS_F_FLAG(vfs) (vfs).f_flag
28+
#else
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs.orig 2022-09-19 15:35:02 UTC
2+
+++ vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
3+
@@ -1488,6 +1488,10 @@ f! {
4+
_CMSG_ALIGN(length as usize)) as ::c_uint
5+
}
6+
7+
+ pub fn cpu_setsize(cpumask: &mut cpumask_t) -> ::c_int {
8+
+ (::mem::size_of::<cpumask_t>() * 8) as ::c_int
9+
+ }
10+
+
11+
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
12+
for slot in cpuset.ary.iter_mut() {
13+
*slot = 0;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--- vendor/openssl-sys/build/cfgs.rs.orig 2020-01-27 17:21:00 UTC
2+
+++ vendor/openssl-sys/build/cfgs.rs
3+
@@ -28,6 +28,21 @@ pub fn get(openssl_version: Option<u64>,
4+
if libressl_version >= 0x2_09_01_00_0 {
5+
cfgs.push("libressl291");
6+
}
7+
+ if libressl_version >= 0x2_09_02_00_0 {
8+
+ cfgs.push("libressl292");
9+
+ }
10+
+
11+
+ if libressl_version >= 0x3_00_00_00_0 {
12+
+ cfgs.push("libressl300");
13+
+ }
14+
+
15+
+ if libressl_version >= 0x3_00_01_00_0 {
16+
+ cfgs.push("libressl301");
17+
+ }
18+
+
19+
+ if libressl_version >= 0x3_00_02_00_0 {
20+
+ cfgs.push("libressl302");
21+
+ }
22+
} else {
23+
let openssl_version = openssl_version.unwrap();
24+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- vendor/openssl/build.rs.orig 2020-01-27 17:21:00 UTC
2+
+++ vendor/openssl/build.rs
3+
@@ -61,5 +61,17 @@ fn main() {
4+
if version >= 0x2_09_01_00_0 {
5+
println!("cargo:rustc-cfg=libressl291");
6+
}
7+
+
8+
+ if version >= 0x3_00_00_00_0 {
9+
+ println!("cargo:rustc-cfg=libressl300");
10+
+ }
11+
+
12+
+ if version >= 0x3_00_01_00_0 {
13+
+ println!("cargo:rustc-cfg=libressl301");
14+
+ }
15+
+
16+
+ if version >= 0x3_00_02_00_0 {
17+
+ println!("cargo:rustc-cfg=libressl302");
18+
+ }
19+
}
20+
}
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
--- vendor/rustix/src/imp/libc/fs/dir.rs.orig 2022-09-19 15:35:02 UTC
2+
+++ vendor/rustix/src/imp/libc/fs/dir.rs
3+
@@ -25,6 +25,7 @@ use alloc::borrow::ToOwned;
4+
target_os = "l4re",
5+
target_os = "linux",
6+
target_os = "openbsd",
7+
+ target_os = "dragonfly",
8+
)))]
9+
use c::dirent as libc_dirent;
10+
#[cfg(not(any(
11+
@@ -106,7 +107,7 @@ impl Dir {
12+
unsafe {
13+
// We have our own copy of OpenBSD's dirent; check that the
14+
// layout minimally matches libc's.
15+
- #[cfg(target_os = "openbsd")]
16+
+ #[cfg(any(target_os = "openbsd", target_os = "dragonfly"))]
17+
check_dirent_layout(&*dirent_ptr);
18+
19+
let result = DirEntry {
20+
@@ -172,10 +173,18 @@ unsafe fn read_dirent(input: &libc_diren
21+
)))]
22+
let d_ino = input.d_ino;
23+
24+
- #[cfg(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))]
25+
+ #[cfg(any(
26+
+ target_os = "freebsd",
27+
+ target_os = "netbsd",
28+
+ target_os = "openbsd",
29+
+ target_os = "dragonfly",
30+
+ ))]
31+
let d_fileno = input.d_fileno;
32+
33+
- #[cfg(not(target_os = "wasi"))]
34+
+ #[cfg(not(any(
35+
+ target_os = "wasi",
36+
+ target_os = "dragonfly"
37+
+ )))]
38+
let d_reclen = input.d_reclen;
39+
40+
#[cfg(any(
41+
@@ -184,6 +193,7 @@ unsafe fn read_dirent(input: &libc_diren
42+
target_os = "openbsd",
43+
target_os = "ios",
44+
target_os = "macos",
45+
+ target_os = "dragonfly",
46+
))]
47+
let d_namlen = input.d_namlen;
48+
49+
@@ -213,9 +223,17 @@ unsafe fn read_dirent(input: &libc_diren
50+
target_os = "openbsd",
51+
)))]
52+
d_ino,
53+
- #[cfg(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))]
54+
+ #[cfg(any(
55+
+ target_os = "freebsd",
56+
+ target_os = "netbsd",
57+
+ target_os = "openbsd",
58+
+ target_os = "dragonfly"
59+
+ ))]
60+
d_fileno,
61+
- #[cfg(not(target_os = "wasi"))]
62+
+ #[cfg(not(any(
63+
+ target_os = "wasi",
64+
+ target_os = "dragonfly"
65+
+ )))]
66+
d_reclen,
67+
#[cfg(any(
68+
target_os = "freebsd",
69+
@@ -223,6 +241,7 @@ unsafe fn read_dirent(input: &libc_diren
70+
target_os = "macos",
71+
target_os = "netbsd",
72+
target_os = "openbsd",
73+
+ target_os = "dragonfly",
74+
))]
75+
d_namlen,
76+
#[cfg(any(target_os = "ios", target_os = "macos"))]
77+
@@ -239,6 +258,10 @@ unsafe fn read_dirent(input: &libc_diren
78+
d_name: zeroed(),
79+
#[cfg(target_os = "openbsd")]
80+
__d_padding: zeroed(),
81+
+ #[cfg(target_os = "dragonfly")]
82+
+ __unused1: zeroed(),
83+
+ #[cfg(target_os = "dragonfly")]
84+
+ __unused2: zeroed()
85+
};
86+
87+
// Copy from d_name, reading up to and including the first NUL.
88+
@@ -338,6 +361,65 @@ impl DirEntry {
89+
}
90+
}
91+
92+
+/// libc's DragonFly BSD `dirent` has a private field so we can't construct it
93+
+/// directly, so we declare it ourselves to make all fields accessible.
94+
+/// Shamelessly copied from OpenBSD code
95+
+#[cfg(target_os = "dragonfly")]
96+
+#[repr(C)]
97+
+#[derive(Debug)]
98+
+struct libc_dirent {
99+
+ d_fileno: c::ino_t,
100+
+ d_namlen: u16,
101+
+ d_type: u8,
102+
+ __unused1: u8,
103+
+ __unused2: u32,
104+
+ d_name: [c::c_char; 256],
105+
+}
106+
+
107+
+/// We have our own copy of DragonFly BSD's dirent; check that the layout
108+
+/// minimally matches libc's.
109+
+/// Shamelessly copied from OpenBSD code
110+
+#[cfg(target_os = "dragonfly")]
111+
+fn check_dirent_layout(dirent: &c::dirent) {
112+
+ use crate::utils::as_ptr;
113+
+ use core::mem::{align_of, size_of};
114+
+
115+
+ // Check that the basic layouts match.
116+
+ assert_eq!(size_of::<libc_dirent>(), size_of::<c::dirent>());
117+
+ assert_eq!(align_of::<libc_dirent>(), align_of::<c::dirent>());
118+
+
119+
+ // Check that the field offsets match.
120+
+ assert_eq!(
121+
+ {
122+
+ let z = libc_dirent {
123+
+ d_fileno: 0_u64,
124+
+ d_namlen: 0_u16,
125+
+ d_type: 0_u8,
126+
+ __unused1: 0_u8,
127+
+ __unused2: 0_u32,
128+
+ d_name: [0 as c::c_char; 256],
129+
+ };
130+
+ let base = as_ptr(&z) as usize;
131+
+ (
132+
+ (as_ptr(&z.d_fileno) as usize) - base,
133+
+ (as_ptr(&z.d_namlen) as usize) - base,
134+
+ (as_ptr(&z.d_type) as usize) - base,
135+
+ (as_ptr(&z.d_name) as usize) - base,
136+
+ )
137+
+ },
138+
+ {
139+
+ let z = dirent;
140+
+ let base = as_ptr(z) as usize;
141+
+ (
142+
+ (as_ptr(&z.d_fileno) as usize) - base,
143+
+ (as_ptr(&z.d_namlen) as usize) - base,
144+
+ (as_ptr(&z.d_type) as usize) - base,
145+
+ (as_ptr(&z.d_name) as usize) - base,
146+
+ )
147+
+ }
148+
+ );
149+
+}
150+
+
151+
/// libc's OpenBSD `dirent` has a private field so we can't construct it
152+
/// directly, so we declare it ourselves to make all fields accessible.
153+
#[cfg(target_os = "openbsd")]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
--- vendor/rustix/src/imp/libc/process/types.rs.orig 2022-09-19 15:35:02 UTC
2+
+++ vendor/rustix/src/imp/libc/process/types.rs
3+
@@ -197,6 +197,7 @@ pub enum Signal {
4+
target_os = "macos",
5+
target_os = "netbsd",
6+
target_os = "openbsd",
7+
+ target_os = "dragonfly",
8+
all(
9+
any(target_os = "android", target_os = "linux"),
10+
any(target_arch = "mips", target_arch = "mips64"),
11+
@@ -239,6 +240,7 @@ pub enum Signal {
12+
target_os = "macos",
13+
target_os = "netbsd",
14+
target_os = "openbsd",
15+
+ target_os = "dragonfly",
16+
)))]
17+
#[doc(alias = "Pwr")]
18+
Power = c::SIGPWR,
19+
@@ -274,6 +276,7 @@ impl Signal {
20+
target_os = "macos",
21+
target_os = "netbsd",
22+
target_os = "openbsd",
23+
+ target_os = "dragonfly",
24+
all(
25+
any(target_os = "android", target_os = "linux"),
26+
any(target_arch = "mips", target_arch = "mips64"),
27+
@@ -299,6 +302,7 @@ impl Signal {
28+
target_os = "macos",
29+
target_os = "netbsd",
30+
target_os = "openbsd",
31+
+ target_os = "dragonfly",
32+
)))]
33+
c::SIGPWR => Some(Self::Power),
34+
c::SIGSYS => Some(Self::Sys),
35+
@@ -354,8 +358,12 @@ pub(crate) fn raw_cpu_set_new() -> RawCp
36+
37+
#[cfg(any(
38+
target_os = "android",
39+
- target_os = "dragonfly",
40+
target_os = "fuchsia",
41+
target_os = "linux",
42+
))]
43+
+
44+
pub(crate) const CPU_SETSIZE: usize = c::CPU_SETSIZE as usize;
45+
+
46+
+/// XXX: This is wrong, but can't do much else right now
47+
+#[cfg(target_os = "dragonfly")]
48+
+pub(crate) const CPU_SETSIZE: usize = 256;

checksums.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ SHA256_rustc_1_61_0_src_tar_gz=ad0b4351675aa9abdf4c7e066613bd274c4391c5506db1529
4747
SHA256_rustc_1_62_1_src_tar_gz=72acbe6ffcd94f598382a7430b0d85ee8f679e6d0b27f3f566ed1c16c978133f
4848
SHA256_rustc_1_63_0_src_tar_gz=1f9580295642ef5da7e475a8da2397d65153d3f2cb92849dbd08ed0effca99d0
4949
SHA256_rustc_1_64_0_src_tar_gz=b3cd9f481e1a2901bf6f3808d30c69cc4ea80d93c4cc4e2ed52258b180381205
50+
SHA256_rustc_1_65_0_src_tar_gz=5828bb67f677eabf8c384020582b0ce7af884e1c84389484f7f8d00dd82c0038
5051

5152
SHA256_cargo_0_27_0_x86_64_unknown_dragonfly_tar_xz=a0b670f797d01ea156cf3ca9f0a7aa2a76bfa8b35dfa779510cfedc1d82eb19b
5253
SHA256_rustc_1_26_0_x86_64_unknown_dragonfly_tar_xz=d14e5d973bfb671535212460d7eca2552379150ffc207712e825f06febdd57c6
@@ -199,3 +200,8 @@ SHA256_rust_std_1_62_1_x86_64_unknown_dragonfly_tar_xz=5e5bf69bc9af174da63335e19
199200
SHA256_cargo_1_63_0_x86_64_unknown_dragonfly_tar_xz=1da3759865e0068c6db5a60d49f794c4d593d5cbfac6982a48c5e0589095a1ea
200201
SHA256_rustc_1_63_0_x86_64_unknown_dragonfly_tar_xz=7ddd2ab8b44fcc393fa96a1cf6673bca98c34a9a74f37319f870e523df87cb25
201202
SHA256_rust_std_1_63_0_x86_64_unknown_dragonfly_tar_xz=e1184545dff4898b0bbd713317c11af1efb056635b97964b62f44d36d704182b
203+
204+
SHA256_cargo_1_64_0_x86_64_unknown_dragonfly_tar_xz=bb607064d6a1faf406fff7ab566b5c0a761367945bfcd6d59e9bc86318a5ba53
205+
SHA256_rustc_1_64_0_x86_64_unknown_dragonfly_tar_xz=a8e417f950796d547fc032c48ace2cf2976449f2fe6fea81df6af9faaff664cd
206+
SHA256_rust_std_1_64_0_x86_64_unknown_dragonfly_tar_xz=ec974b8449d4e5c9833565b4b412bcedf49b6a1ca9e7ee429e1fd09e48e63ddd
207+

0 commit comments

Comments
 (0)