View | Details | Raw Unified | Return to bug 227130
Collapse All | Expand All

(-)lang/rust/Makefile (-29 / +4 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	rust
4
PORTNAME=	rust
5
PORTVERSION?=	1.24.1
5
PORTVERSION?=	1.25.0
6
PORTREVISION?=
6
PORTREVISION?=
7
CATEGORIES=	lang
7
CATEGORIES=	lang
8
MASTER_SITES=	http://static.rust-lang.org/dist/:src \
8
MASTER_SITES=	http://static.rust-lang.org/dist/:src \
Lines 44-56 ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler Link Here
44
CONFLICTS_INSTALL?=	rust-nightly
44
CONFLICTS_INSTALL?=	rust-nightly
45
45
46
# See WRKSRC/src/stage0.txt for this date and version values.
46
# See WRKSRC/src/stage0.txt for this date and version values.
47
BOOTSTRAPS_DATE?=		2018-01-04
47
BOOTSTRAPS_DATE?=		2018-03-18
48
48
49
RUST_BOOTSTRAP_VERSION?=	1.23.0
49
RUST_BOOTSTRAP_VERSION?=	beta
50
RUSTC_BOOTSTRAP=		${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz
50
RUSTC_BOOTSTRAP=		${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz
51
RUST_STD_BOOTSTRAP=		${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz
51
RUST_STD_BOOTSTRAP=		${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz
52
52
53
CARGO_BOOTSTRAP_VERSION?=	0.24.0
53
CARGO_BOOTSTRAP_VERSION?=	beta
54
CARGO_BOOTSTRAP=		${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz
54
CARGO_BOOTSTRAP=		${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz
55
55
56
RUST_CHANNEL=	${PKGNAMESUFFIX:Ustable:S/^-//}
56
RUST_CHANNEL=	${PKGNAMESUFFIX:Ustable:S/^-//}
Lines 92-106 PLIST_FILES= lib/rustlib/components \ Link Here
92
			lib/rustlib/rust-installer-version
92
			lib/rustlib/rust-installer-version
93
93
94
.include <bsd.port.pre.mk>
94
.include <bsd.port.pre.mk>
95
# ABI patch needed to address ino64 before fixes upstreamed.
96
# https://github.com/rust-lang/rust/issues/42681
97
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200031 && !defined(NIGHTLY_DATE)
98
NEED_ABI_PATCH=		1
99
EXTRA_PATCHES+=		${PATCHDIR}/extra-patch-abi
100
.else
101
NEED_ABI_PATCH=		0
102
.endif
103
104
X_PY_ENV=	HOME="${WRKDIR}" \
95
X_PY_ENV=	HOME="${WRKDIR}" \
105
		OPENSSL_DIR="${OPENSSLBASE}"
96
		OPENSSL_DIR="${OPENSSLBASE}"
106
X_PY_CMD=	${PYTHON_CMD} ${WRKSRC}/x.py
97
X_PY_CMD=	${PYTHON_CMD} ${WRKSRC}/x.py
Lines 140-165 post-extract: Link Here
140
		${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}
131
		${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}
141
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${RUSTC_BOOTSTRAP} \
132
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${RUSTC_BOOTSTRAP} \
142
		${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}
133
		${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}
143
.if ${NEED_ABI_PATCH} == 0
144
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${RUST_STD_BOOTSTRAP} \
134
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${RUST_STD_BOOTSTRAP} \
145
		${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}
135
		${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}
146
.endif
147
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${CARGO_BOOTSTRAP} \
136
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${CARGO_BOOTSTRAP} \
148
		${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}
137
		${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}
149
.if ${NEED_ABI_PATCH} == 1
150
	${TAR} -x -C ${WRKSRC} -f ${DISTDIR}/${DIST_SUBDIR}/${RUST_STD_BOOTSTRAP}
151
	${CC} ${CFLAGS} -fPIC -c -o ${WRKSRC}/old_fstat.o ${FILESDIR}/old_fstat.c
152
	(set -ex; cd ${WRKSRC}; \
153
	 libstd="$$(echo "${RUST_STD_DIR}/rust-std-${RUST_TARGET}/lib/rustlib/${RUST_TARGET}/lib/"libstd-*.rlib)"; \
154
	 hash="$$(basename "$$libstd" .rlib | ${SED} 's/^libstd-//')"; \
155
	 std_o="$$(${AR} t "$$libstd" | ${GREP} -E "^std-$$hash.*\.o$$" | ${HEAD} -n 1)"; \
156
	 ${AR} x "$$libstd" "$$std_o"; \
157
	 ${LD} -r -o std.xx.o "$$std_o" old_fstat.o; \
158
	 ${MV} std.xx.o "$$std_o"; \
159
	 ${AR} r "$$libstd" "$$std_o")
160
	${TAR} -c --format=ustar -C ${WRKSRC} -f ${WRKSRC}/rust-std.tar.gz ${RUST_STD_DIR}
161
	${MV} ${WRKSRC}/rust-std.tar.gz ${WRKSRC}/build/cache/${RUST_STD_BOOTSTRAP}
162
.endif
163
138
164
post-patch:
139
post-patch:
165
	@${REINPLACE_CMD} -e 's|gdb|${LOCALBASE}/bin/gdb|' \
140
	@${REINPLACE_CMD} -e 's|gdb|${LOCALBASE}/bin/gdb|' \
(-)lang/rust/distinfo (-21 / +9 lines)
Lines 1-21 Link Here
1
TIMESTAMP = 1520331200
1
TIMESTAMP = 1522546723
2
SHA256 (rust/rustc-1.24.1-src.tar.xz) = 85d5d032a59ff91ae01e2b0b65607e763de8dc2729e4b3d28a69023bdd8f5718
2
SHA256 (rust/rustc-1.25.0-src.tar.xz) = 14fcb82d5959df758aaf422539359300917217fa8420e34bd596e3fb6ed2de87
3
SIZE (rust/rustc-1.24.1-src.tar.xz) = 42171464
3
SIZE (rust/rustc-1.25.0-src.tar.xz) = 56108536
4
SHA256 (rust/2018-01-04/rustc-1.23.0-aarch64-unknown-freebsd.tar.gz) = 44ae0e7615c19209fb74dc18dd15668af228bb2135bd74a3d4bd8917af6ec889
4
SHA256 (rust/2018-03-18/rustc-beta-x86_64-unknown-freebsd.tar.gz) = 2d00f24c2bfd8112d798d0aab70ec60f12ad6978b5029f83d477345101a46cba
5
SIZE (rust/2018-01-04/rustc-1.23.0-aarch64-unknown-freebsd.tar.gz) = 56833352
5
SIZE (rust/2018-03-18/rustc-beta-x86_64-unknown-freebsd.tar.gz) = 56562280
6
SHA256 (rust/2018-01-04/rust-std-1.23.0-aarch64-unknown-freebsd.tar.gz) = 248cd23557285c7e43ca5ba69d8c71c810ed95affbd723d21d5ce87058bf66f1
6
SHA256 (rust/2018-03-18/rust-std-beta-x86_64-unknown-freebsd.tar.gz) = 86907a7beaa22f52bd093898e0818048bb1ef4b2d45968fb794f69425c345004
7
SIZE (rust/2018-01-04/rust-std-1.23.0-aarch64-unknown-freebsd.tar.gz) = 71207727
7
SIZE (rust/2018-03-18/rust-std-beta-x86_64-unknown-freebsd.tar.gz) = 50222097
8
SHA256 (rust/2018-01-04/cargo-0.24.0-aarch64-unknown-freebsd.tar.gz) = b028d83da266259adf81ae00b8263a08bfb0ae1bcdbb79abca2fd565fe550669
8
SHA256 (rust/2018-03-18/cargo-beta-x86_64-unknown-freebsd.tar.gz) = ed420d91219f86ffa586cd773f19f75c0e192b683e7a7282580faf5b72c7b9de
9
SIZE (rust/2018-01-04/cargo-0.24.0-aarch64-unknown-freebsd.tar.gz) = 3895466
9
SIZE (rust/2018-03-18/cargo-beta-x86_64-unknown-freebsd.tar.gz) = 5209143
10
SHA256 (rust/2018-01-04/rustc-1.23.0-i686-unknown-freebsd.tar.gz) = 47211ab3d9232d08a626f666da1d83f8d713de6010b7c9e1b28565c5c0edf544
11
SIZE (rust/2018-01-04/rustc-1.23.0-i686-unknown-freebsd.tar.gz) = 49240849
12
SHA256 (rust/2018-01-04/rust-std-1.23.0-i686-unknown-freebsd.tar.gz) = 5c220445e20467b71a76bdffeff87d57e17e99860ee8c0e745509147ea283393
13
SIZE (rust/2018-01-04/rust-std-1.23.0-i686-unknown-freebsd.tar.gz) = 67245886
14
SHA256 (rust/2018-01-04/cargo-0.24.0-i686-unknown-freebsd.tar.gz) = c15a71df418533e1c1bb4a879b10c819e0f0b5bc831c148ffafe69a60dbd8ccc
15
SIZE (rust/2018-01-04/cargo-0.24.0-i686-unknown-freebsd.tar.gz) = 5854910
16
SHA256 (rust/2018-01-04/rustc-1.23.0-x86_64-unknown-freebsd.tar.gz) = 49576fd518c3bf7b3b665e666d16a8c4875577514cc1864e498d3b0a50cff500
17
SIZE (rust/2018-01-04/rustc-1.23.0-x86_64-unknown-freebsd.tar.gz) = 48148869
18
SHA256 (rust/2018-01-04/rust-std-1.23.0-x86_64-unknown-freebsd.tar.gz) = 6a7b58f6beb9b5dfad44ee286be552cc96117be3fdce0f2a0ed2904b0ce23186
19
SIZE (rust/2018-01-04/rust-std-1.23.0-x86_64-unknown-freebsd.tar.gz) = 66669825
20
SHA256 (rust/2018-01-04/cargo-0.24.0-x86_64-unknown-freebsd.tar.gz) = 89878efa237bc0121f3702cd286796c4ce8b0829e671408fe0ea99bf28ce2d4c
21
SIZE (rust/2018-01-04/cargo-0.24.0-x86_64-unknown-freebsd.tar.gz) = 5912767
(-)lang/rust/files/extra-patch-abi (-423 lines)
Removed Link Here
1
------------------------------------------------------------------------
2
r441843 | kib | 2017-05-27 05:06:40 -0700 (Sat, 27 May 2017) | 6 lines
3
4
Fix lang/rust after ino64 src commit.
5
6
Approved by:  bapt, dumbbell
7
Sponsored by:   The FreeBSD Foundation
8
Differential revision:  https://reviews.freebsd.org/D10799
9
10
------------------------------------------------------------------------
11
12
commit 969ad2b73cdc928b88f6db8f31916bbe294764c0
13
Author: Bryan Drewery <bryan@shatow.net>
14
Date:   Thu Mar 1 12:35:01 2018 -0800
15
16
    Link against kevent@FBSD_1.0 to fix ABI compat with FreeBSD12.
17
    
18
    struct kevent was modified in FreeBSD12.  The @FBSD_1.0 symbol supports the old
19
    structure ABI still.
20
    
21
    This allows the `mio` crate tests to now pass on FreeBSD12.
22
23
--- ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs.orig	2017-04-24 18:56:45.000000000 +0000
24
+++ ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs	2017-05-30 07:55:40.703709000 +0000
25
@@ -7,10 +7,12 @@
26
     pub struct stat {
27
         pub st_dev: ::dev_t,
28
         pub st_ino: ::ino_t,
29
-        pub st_mode: ::mode_t,
30
         pub st_nlink: ::nlink_t,
31
+        pub st_mode: ::mode_t,
32
+        pub st_pad0: ::uint16_t,
33
         pub st_uid: ::uid_t,
34
         pub st_gid: ::gid_t,
35
+        pub st_pad1: ::uint32_t,
36
         pub st_rdev: ::dev_t,
37
         pub st_atime: ::time_t,
38
         pub st_atime_nsec: ::c_long,
39
@@ -18,13 +20,13 @@
40
         pub st_mtime_nsec: ::c_long,
41
         pub st_ctime: ::time_t,
42
         pub st_ctime_nsec: ::c_long,
43
+        pub st_birthtime: ::time_t,
44
+        pub st_birthtime_nsec: ::c_long,
45
         pub st_size: ::off_t,
46
         pub st_blocks: ::blkcnt_t,
47
         pub st_blksize: ::blksize_t,
48
         pub st_flags: ::fflags_t,
49
-        pub st_gen: ::uint32_t,
50
-        pub st_lspare: ::int32_t,
51
-        pub st_birthtime: ::time_t,
52
-        pub st_birthtime_nsec: ::c_long,
53
+        pub st_gen: ::uint64_t,
54
+        pub st_spare: [::uint64_t; 10],
55
     }
56
 }
57
--- ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig	2017-04-24 18:56:45.000000000 +0000
58
+++ ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs	2017-05-25 16:28:37.280076000 +0000
59
@@ -1,8 +1,8 @@
60
 pub type fflags_t = u32;
61
 pub type clock_t = i32;
62
-pub type ino_t = u32;
63
+pub type ino_t = u64;
64
 pub type lwpid_t = i32;
65
-pub type nlink_t = u16;
66
+pub type nlink_t = u64;
67
 pub type blksize_t = u32;
68
 pub type clockid_t = ::c_int;
69
 pub type sem_t = _sem;
70
@@ -40,10 +40,13 @@
71
     }
72
 
73
     pub struct dirent {
74
-        pub d_fileno: u32,
75
+        pub d_fileno: u64,
76
+        pub d_off: u64,
77
         pub d_reclen: u16,
78
         pub d_type: u8,
79
-        pub d_namlen: u8,
80
+        pub d_pad0: u8,
81
+        pub d_namlen: u16,
82
+        pub d_pad1: u16,
83
         pub d_name: [::c_char; 256],
84
     }
85
 
86
--- ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/x86.rs.orig	2017-04-24 18:56:45.000000000 +0000
87
+++ ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/x86.rs	2017-05-25 16:25:42.303616000 +0000
88
@@ -7,25 +7,30 @@
89
     pub struct stat {
90
         pub st_dev: ::dev_t,
91
         pub st_ino: ::ino_t,
92
-        pub st_mode: ::mode_t,
93
         pub st_nlink: ::nlink_t,
94
+        pub st_mode: ::mode_t,
95
+        pub st_pad0: ::uint16_t,
96
         pub st_uid: ::uid_t,
97
         pub st_gid: ::gid_t,
98
+        pub st_pad1: ::uint32_t,
99
         pub st_rdev: ::dev_t,
100
+        pub st_atime_ext: ::int32_t,
101
         pub st_atime: ::time_t,
102
         pub st_atime_nsec: ::c_long,
103
+        pub st_mtime_ext: ::int32_t,
104
         pub st_mtime: ::time_t,
105
         pub st_mtime_nsec: ::c_long,
106
+        pub st_ctime_ext: ::int32_t,
107
         pub st_ctime: ::time_t,
108
         pub st_ctime_nsec: ::c_long,
109
+        pub st_birthtime_ext: ::int32_t,
110
+        pub st_birthtime: ::time_t,
111
+        pub st_birthtime_nsec: ::c_long,
112
         pub st_size: ::off_t,
113
         pub st_blocks: ::blkcnt_t,
114
         pub st_blksize: ::blksize_t,
115
         pub st_flags: ::fflags_t,
116
-        pub st_gen: ::uint32_t,
117
-        pub st_lspare: ::int32_t,
118
-        pub st_birthtime: ::time_t,
119
-        pub st_birthtime_nsec: ::c_long,
120
-        __unused: [u8; 8],
121
+        pub st_gen: ::uint64_t,
122
+        pub st_spare: [::uint64_t; 10],
123
     }
124
 }
125
--- ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs.orig	2017-04-24 18:56:45.000000000 +0000
126
+++ ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs	2017-05-25 16:25:42.303910000 +0000
127
@@ -7,10 +7,12 @@
128
     pub struct stat {
129
         pub st_dev: ::dev_t,
130
         pub st_ino: ::ino_t,
131
-        pub st_mode: ::mode_t,
132
         pub st_nlink: ::nlink_t,
133
+        pub st_mode: ::mode_t,
134
+        pub st_pad0: ::uint16_t,
135
         pub st_uid: ::uid_t,
136
         pub st_gid: ::gid_t,
137
+        pub st_pad1: ::uint32_t,
138
         pub st_rdev: ::dev_t,
139
         pub st_atime: ::time_t,
140
         pub st_atime_nsec: ::c_long,
141
@@ -18,13 +20,13 @@
142
         pub st_mtime_nsec: ::c_long,
143
         pub st_ctime: ::time_t,
144
         pub st_ctime_nsec: ::c_long,
145
+        pub st_birthtime: ::time_t,
146
+        pub st_birthtime_nsec: ::c_long,
147
         pub st_size: ::off_t,
148
         pub st_blocks: ::blkcnt_t,
149
         pub st_blksize: ::blksize_t,
150
         pub st_flags: ::fflags_t,
151
-        pub st_gen: ::uint32_t,
152
-        pub st_lspare: ::int32_t,
153
-        pub st_birthtime: ::time_t,
154
-        pub st_birthtime_nsec: ::c_long,
155
+        pub st_gen: ::uint64_t,
156
+        pub st_spare: [::uint64_t; 10],
157
     }
158
 }
159
--- ./src/liblibc/src/unix/bsd/freebsdlike/mod.rs.orig	2017-04-24 18:56:45.000000000 +0000
160
+++ ./src/liblibc/src/unix/bsd/freebsdlike/mod.rs	2017-05-25 16:25:42.304391000 +0000
161
@@ -1,4 +1,4 @@
162
-pub type dev_t = u32;
163
+pub type dev_t = u64;
164
 pub type mode_t = u16;
165
 pub type pthread_attr_t = *mut ::c_void;
166
 pub type rlim_t = i64;
167
@@ -1052,6 +1052,7 @@ extern {
168
                        serv: *mut ::c_char,
169
                        servlen: ::size_t,
170
                        flags: ::c_int) -> ::c_int;
171
+    #[cfg_attr(target_os = "freebsd", link_name = "kevent@FBSD_1.0")]
172
     pub fn kevent(kq: ::c_int,
173
                   changelist: *const ::kevent,
174
                   nchanges: ::c_int,
175
--- ./src/libstd/os/freebsd/raw.rs.orig	2017-04-24 18:53:46.000000000 +0000
176
+++ ./src/libstd/os/freebsd/raw.rs	2017-05-25 16:25:42.304715000 +0000
177
@@ -38,32 +38,52 @@
178
 #[stable(feature = "raw_ext", since = "1.1.0")]
179
 pub struct stat {
180
     #[stable(feature = "raw_ext", since = "1.1.0")]
181
-    pub st_dev: u32,
182
+    pub st_dev: u64,
183
     #[stable(feature = "raw_ext", since = "1.1.0")]
184
-    pub st_ino: u32,
185
+    pub st_ino: u64,
186
     #[stable(feature = "raw_ext", since = "1.1.0")]
187
+    pub st_nlink: u64,
188
+    #[stable(feature = "raw_ext", since = "1.1.0")]
189
     pub st_mode: u16,
190
     #[stable(feature = "raw_ext", since = "1.1.0")]
191
-    pub st_nlink: u16,
192
+    pub st_pad0: u16,
193
     #[stable(feature = "raw_ext", since = "1.1.0")]
194
     pub st_uid: u32,
195
     #[stable(feature = "raw_ext", since = "1.1.0")]
196
     pub st_gid: u32,
197
     #[stable(feature = "raw_ext", since = "1.1.0")]
198
-    pub st_rdev: u32,
199
+    pub st_pad1: u32,
200
     #[stable(feature = "raw_ext", since = "1.1.0")]
201
+    pub st_rdev: u64,
202
+    #[cfg(target_arch = "x86")]
203
+    #[stable(feature = "raw_ext", since = "1.1.0")]
204
+    pub st_atime_ext: c_long,
205
+    #[stable(feature = "raw_ext", since = "1.1.0")]
206
     pub st_atime: c_long,
207
     #[stable(feature = "raw_ext", since = "1.1.0")]
208
     pub st_atime_nsec: c_long,
209
+    #[cfg(target_arch = "x86")]
210
     #[stable(feature = "raw_ext", since = "1.1.0")]
211
+    pub st_mtime_ext: c_long,
212
+    #[stable(feature = "raw_ext", since = "1.1.0")]
213
     pub st_mtime: c_long,
214
     #[stable(feature = "raw_ext", since = "1.1.0")]
215
     pub st_mtime_nsec: c_long,
216
+    #[cfg(target_arch = "x86")]
217
     #[stable(feature = "raw_ext", since = "1.1.0")]
218
+    pub st_ctime_ext: c_long,
219
+    #[stable(feature = "raw_ext", since = "1.1.0")]
220
     pub st_ctime: c_long,
221
     #[stable(feature = "raw_ext", since = "1.1.0")]
222
     pub st_ctime_nsec: c_long,
223
+    #[cfg(target_arch = "x86")]
224
     #[stable(feature = "raw_ext", since = "1.1.0")]
225
+    pub st_birthtime_ext: c_long,
226
+    #[stable(feature = "raw_ext", since = "1.1.0")]
227
+    pub st_birthtime: c_long,
228
+    #[stable(feature = "raw_ext", since = "1.1.0")]
229
+    pub st_birthtime_nsec: c_long,
230
+    #[stable(feature = "raw_ext", since = "1.1.0")]
231
     pub st_size: i64,
232
     #[stable(feature = "raw_ext", since = "1.1.0")]
233
     pub st_blocks: i64,
234
@@ -72,14 +92,7 @@
235
     #[stable(feature = "raw_ext", since = "1.1.0")]
236
     pub st_flags: u32,
237
     #[stable(feature = "raw_ext", since = "1.1.0")]
238
-    pub st_gen: u32,
239
+    pub st_gen: u64,
240
     #[stable(feature = "raw_ext", since = "1.1.0")]
241
-    pub st_lspare: i32,
242
-    #[stable(feature = "raw_ext", since = "1.1.0")]
243
-    pub st_birthtime: c_long,
244
-    #[stable(feature = "raw_ext", since = "1.1.0")]
245
-    pub st_birthtime_nsec: c_long,
246
-    #[cfg(target_arch = "x86")]
247
-    #[stable(feature = "raw_ext", since = "1.1.0")]
248
-    pub __unused: [u8; 8],
249
+    pub st_spare: [u64; 10],
250
 }
251
--- ./src/libstd/os/freebsd/fs.rs.orig	2017-04-24 18:53:46.000000000 +0000
252
+++ ./src/libstd/os/freebsd/fs.rs	2017-05-25 16:25:42.304989000 +0000
253
@@ -74,8 +74,6 @@
254
     fn st_flags(&self) -> u32;
255
     #[stable(feature = "metadata_ext2", since = "1.8.0")]
256
     fn st_gen(&self) -> u32;
257
-    #[stable(feature = "metadata_ext2", since = "1.8.0")]
258
-    fn st_lspare(&self) -> u32;
259
 }
260
 
261
 #[stable(feature = "metadata_ext", since = "1.1.0")]
262
@@ -146,9 +144,6 @@
263
     }
264
     fn st_flags(&self) -> u32 {
265
         self.as_inner().as_inner().st_flags as u32
266
-    }
267
-    fn st_lspare(&self) -> u32 {
268
-        self.as_inner().as_inner().st_lspare as u32
269
     }
270
 }
271
 
272
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs.orig	2017-04-24 20:20:26.000000000 +0000
273
+++ ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs	2017-05-30 07:57:19.874957000 +0000
274
@@ -7,10 +7,12 @@
275
     pub struct stat {
276
         pub st_dev: ::dev_t,
277
         pub st_ino: ::ino_t,
278
-        pub st_mode: ::mode_t,
279
         pub st_nlink: ::nlink_t,
280
+        pub st_mode: ::mode_t,
281
+        pub st_pad0: ::uint16_t,
282
         pub st_uid: ::uid_t,
283
         pub st_gid: ::gid_t,
284
+        pub st_pad1: ::uint32_t,
285
         pub st_rdev: ::dev_t,
286
         pub st_atime: ::time_t,
287
         pub st_atime_nsec: ::c_long,
288
@@ -18,13 +20,13 @@
289
         pub st_mtime_nsec: ::c_long,
290
         pub st_ctime: ::time_t,
291
         pub st_ctime_nsec: ::c_long,
292
+        pub st_birthtime: ::time_t,
293
+        pub st_birthtime_nsec: ::c_long,
294
         pub st_size: ::off_t,
295
         pub st_blocks: ::blkcnt_t,
296
         pub st_blksize: ::blksize_t,
297
         pub st_flags: ::fflags_t,
298
-        pub st_gen: ::uint32_t,
299
-        pub st_lspare: ::int32_t,
300
-        pub st_birthtime: ::time_t,
301
-        pub st_birthtime_nsec: ::c_long,
302
+        pub st_gen: ::uint64_t,
303
+        pub st_spare: [::uint64_t; 10],
304
     }
305
 }
306
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs.orig	2017-04-24 20:20:26.000000000 +0000
307
+++ ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs	2017-05-25 16:25:42.305261000 +0000
308
@@ -7,10 +7,12 @@
309
     pub struct stat {
310
         pub st_dev: ::dev_t,
311
         pub st_ino: ::ino_t,
312
-        pub st_mode: ::mode_t,
313
         pub st_nlink: ::nlink_t,
314
+        pub st_mode: ::mode_t,
315
+        pub st_pad0: ::uint16_t,
316
         pub st_uid: ::uid_t,
317
         pub st_gid: ::gid_t,
318
+        pub st_pad1: ::uint32_t,
319
         pub st_rdev: ::dev_t,
320
         pub st_atime: ::time_t,
321
         pub st_atime_nsec: ::c_long,
322
@@ -18,13 +20,13 @@
323
         pub st_mtime_nsec: ::c_long,
324
         pub st_ctime: ::time_t,
325
         pub st_ctime_nsec: ::c_long,
326
+        pub st_birthtime: ::time_t,
327
+        pub st_birthtime_nsec: ::c_long,
328
         pub st_size: ::off_t,
329
         pub st_blocks: ::blkcnt_t,
330
         pub st_blksize: ::blksize_t,
331
         pub st_flags: ::fflags_t,
332
-        pub st_gen: ::uint32_t,
333
-        pub st_lspare: ::int32_t,
334
-        pub st_birthtime: ::time_t,
335
-        pub st_birthtime_nsec: ::c_long,
336
+        pub st_gen: ::uint64_t,
337
+        pub st_spare: [::uint64_t; 10],
338
     }
339
 }
340
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig	2017-04-24 20:20:26.000000000 +0000
341
+++ ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs	2017-05-25 16:28:29.708287000 +0000
342
@@ -1,8 +1,8 @@
343
 pub type fflags_t = u32;
344
 pub type clock_t = i32;
345
-pub type ino_t = u32;
346
+pub type ino_t = u64;
347
 pub type lwpid_t = i32;
348
-pub type nlink_t = u16;
349
+pub type nlink_t = u64;
350
 pub type blksize_t = u32;
351
 pub type clockid_t = ::c_int;
352
 pub type sem_t = _sem;
353
@@ -40,10 +40,13 @@
354
     }
355
 
356
     pub struct dirent {
357
-        pub d_fileno: u32,
358
+        pub d_fileno: u64,
359
+        pub d_off: u64,
360
         pub d_reclen: u16,
361
         pub d_type: u8,
362
-        pub d_namlen: u8,
363
+        pub d_pad0: u8,
364
+        pub d_namlen: u16,
365
+        pub d_pad1: u16,
366
         pub d_name: [::c_char; 256],
367
     }
368
 
369
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs.orig	2017-04-24 20:20:26.000000000 +0000
370
+++ ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs	2017-05-25 16:25:42.305967000 +0000
371
@@ -7,25 +7,30 @@
372
     pub struct stat {
373
         pub st_dev: ::dev_t,
374
         pub st_ino: ::ino_t,
375
-        pub st_mode: ::mode_t,
376
         pub st_nlink: ::nlink_t,
377
+        pub st_mode: ::mode_t,
378
+        pub st_pad0: ::uint16_t,
379
         pub st_uid: ::uid_t,
380
         pub st_gid: ::gid_t,
381
+        pub st_pad1: ::uint32_t,
382
         pub st_rdev: ::dev_t,
383
+        pub st_atime_ext: ::int32_t,
384
         pub st_atime: ::time_t,
385
         pub st_atime_nsec: ::c_long,
386
+        pub st_mtime_ext: i32,
387
         pub st_mtime: ::time_t,
388
         pub st_mtime_nsec: ::c_long,
389
+        pub st_ctime_ext: ::int32_t,
390
         pub st_ctime: ::time_t,
391
         pub st_ctime_nsec: ::c_long,
392
+        pub st_birthtime_ext: ::int32_t,
393
+        pub st_birthtime: ::time_t,
394
+        pub st_birthtime_nsec: ::c_long,
395
         pub st_size: ::off_t,
396
         pub st_blocks: ::blkcnt_t,
397
         pub st_blksize: ::blksize_t,
398
         pub st_flags: ::fflags_t,
399
-        pub st_gen: ::uint32_t,
400
-        pub st_lspare: ::int32_t,
401
-        pub st_birthtime: ::time_t,
402
-        pub st_birthtime_nsec: ::c_long,
403
-        __unused: [u8; 8],
404
+        pub st_gen: ::uint64_t,
405
+        pub st_spare: [::uint64_t; 10],
406
     }
407
 }
408
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/mod.rs.orig	2017-04-24 20:20:26.000000000 +0000
409
+++ ./src/vendor/libc/src/unix/bsd/freebsdlike/mod.rs	2017-05-25 16:25:42.306480000 +0000
410
@@ -1,4 +1,4 @@
411
-pub type dev_t = u32;
412
+pub type dev_t = u64;
413
 pub type mode_t = u16;
414
 pub type pthread_attr_t = *mut ::c_void;
415
 pub type rlim_t = i64;
416
@@ -1052,6 +1052,7 @@ extern {
417
                        serv: *mut ::c_char,
418
                        servlen: ::size_t,
419
                        flags: ::c_int) -> ::c_int;
420
+    #[cfg_attr(target_os = "freebsd", link_name = "kevent@FBSD_1.0")]
421
     pub fn kevent(kq: ::c_int,
422
                   changelist: *const ::kevent,
423
                   nchanges: ::c_int,
(-)lang/rust/files/old_fstat.c (-103 lines)
Removed Link Here
1
/* $FreeBSD$ */
2
3
#include <sys/syscall.h>
4
#include <dlfcn.h>
5
#include <stdio.h>
6
#include <stdlib.h>
7
#include <unistd.h>
8
9
struct stat;
10
11
int
12
fstat(int fd, struct stat *sb)
13
{
14
15
	return (syscall(SYS_freebsd11_fstat, fd, sb));
16
}
17
18
int
19
stat(const char *path, struct stat *sb)
20
{
21
22
	return (syscall(SYS_freebsd11_stat, path, sb));
23
}
24
25
int
26
lstat(const char *path, struct stat *sb)
27
{
28
29
	return (syscall(SYS_freebsd11_lstat, path, sb));
30
}
31
32
int
33
fstatat(int fd, const char *path, struct stat *sb, int flag)
34
{
35
36
	return (syscall(SYS_freebsd11_fstatat, fd, path, sb, flag));
37
}
38
39
struct ODIR;
40
struct freebsd11_dirent;
41
42
/*
43
__asm(".symver  old_readdir, readdir@FBSD_1.0");
44
int old_readdir(struct ODIR *);
45
int
46
readdir(struct ODIR *dirp)
47
{
48
49
	return (old_readdir(dirp));
50
}
51
*/
52
53
__asm(".symver  old_readdir_r, readdir_r@FBSD_1.0");
54
int old_readdir_r(struct ODIR *, struct freebsd11_dirent *,
55
    struct freebsd11_dirent **);
56
int
57
readdir_r(struct ODIR *dirp, struct freebsd11_dirent *entry,
58
    struct freebsd11_dirent **result)
59
{
60
	void *libc;
61
	void *fptr;
62
	int error;
63
64
	libc = dlopen("libc.so.7", RTLD_LAZY | RTLD_GLOBAL);
65
	if (libc == NULL) {
66
		fprintf(stderr, "libc open: %s\n", dlerror());
67
		abort();
68
	}
69
	fptr = dlvsym(libc, "readdir_r", "FBSD_1.0");
70
	if (fptr == NULL) {
71
		fprintf(stderr, "readdir_r: %s\n", dlerror());
72
		abort();
73
	}
74
	error = ((int (*)(struct ODIR *, struct freebsd11_dirent *,
75
	    struct freebsd11_dirent **))fptr)(dirp, entry, result);
76
	dlclose(libc);
77
	return (error);
78
}
79
80
/*
81
__asm(".symver	old_scandir, scandir@FBSD_1.0");
82
int old_scandir(const char *, struct freebsd11_dirent ***,
83
    int (*)(const struct freebsd11_dirent *),
84
    int (*)(const struct freebsd11_dirent **,
85
	const struct freebsd11_dirent **));
86
int
87
scandir(const char *dirname, struct freebsd11_dirent ***namelist,
88
    int (*select)(const struct freebsd11_dirent *),
89
    int (*dcomp)(const struct freebsd11_dirent **,
90
	const struct freebsd11_dirent **))
91
{
92
93
	return (old_scandir(dirname, namelist, select, dcomp));
94
}
95
*/
96
97
struct old_statfs;
98
int
99
fstatfs(int fd, struct old_statfs *buf)
100
{
101
102
	return (syscall(SYS_freebsd11_fstatfs, fd, buf));
103
}
(-)lang/rust/files/patch-src_binaryen_CMakeLists.txt (-60 lines)
Removed Link Here
1
https://github.com/WebAssembly/binaryen/commit/07f6dfbf0d89
2
https://github.com/WebAssembly/binaryen/commit/d9692277357b
3
4
--- src/binaryen/CMakeLists.txt.orig	2018-02-12 18:56:16 UTC
5
+++ src/binaryen/CMakeLists.txt
6
@@ -99,51 +99,12 @@ ELSE()
7
   FIND_PACKAGE(Threads REQUIRED)
8
   ADD_CXX_FLAG("-std=c++11")
9
   if (NOT EMSCRIPTEN)
10
-    # try to get the target architecture by compiling a dummy.c file and
11
-    # checking the architecture using the file command.
12
-    file(WRITE ${PROJECT_BINARY_DIR}/dummy.c "main(){}")
13
-    try_compile(
14
-      COMPILE_OK
15
-      ${PROJECT_BINARY_DIR}
16
-      ${PROJECT_BINARY_DIR}/dummy.c
17
-      OUTPUT_VARIABLE COMPILE_OUTPUT
18
-      COPY_FILE ${PROJECT_BINARY_DIR}/dummy
19
-    )
20
-    if (COMPILE_OK)
21
-      execute_process(
22
-        COMMAND file ${PROJECT_BINARY_DIR}/dummy
23
-        RESULT_VARIABLE FILE_RESULT
24
-        OUTPUT_VARIABLE FILE_OUTPUT
25
-        ERROR_QUIET
26
-      )
27
-
28
-      if (FILE_RESULT EQUAL 0)
29
-        if (${FILE_OUTPUT} MATCHES "x86[-_]64")
30
-          set(TARGET_ARCH "x86-64")
31
-        elseif (${FILE_OUTPUT} MATCHES "Intel 80386")
32
-          set(TARGET_ARCH "i386")
33
-        elseif (${FILE_OUTPUT} MATCHES "ARM")
34
-          set(TARGET_ARCH "ARM")
35
-        else ()
36
-          message(WARNING "Unknown target architecture!")
37
-        endif ()
38
-        if(TARGET_ARCH)
39
-          MESSAGE(STATUS "Building for platform ${TARGET_ARCH}")
40
-        endif ()
41
-      else ()
42
-        message(WARNING "Error running file on dummy executable")
43
-      endif ()
44
-    else ()
45
-      message(WARNING "Error compiling dummy.c file: ${COMPILE_OUTPUT}")
46
-    endif ()
47
-
48
-    if (TARGET_ARCH STREQUAL "i386")
49
+    if (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
50
       # wasm doesn't allow for x87 floating point math
51
       ADD_COMPILE_FLAG("-msse2")
52
       ADD_COMPILE_FLAG("-mfpmath=sse")
53
-    elseif(TARGET_ARCH STREQUAL "ARM")
54
-      # stub for ARM-specific instructions. GCC6 adds NEON with the below flags
55
-      ADD_COMPILE_FLAG("-march=native")
56
+    elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^armv[2-6]" AND NOT CMAKE_CXX_FLAGS MATCHES "-mfpu=")
57
+      ADD_COMPILE_FLAG("-mfpu=vfpv3")
58
     endif ()
59
   endif ()
60
   ADD_COMPILE_FLAG("-Wall")
(-)lang/rust/files/patch-src_librustc__back_target_freebsd__base.rs (-14 lines)
Removed Link Here
1
Return struct like OpenBSD, see src/librustc_trans/cabi_x86.rs
2
3
--- src/librustc_back/target/freebsd_base.rs.orig	2017-11-22 21:33:00 UTC
4
+++ src/librustc_back/target/freebsd_base.rs
5
@@ -31,6 +31,8 @@ pub fn opts() -> TargetOptions {
6
         target_family: Some("unix".to_string()),
7
         linker_is_gnu: true,
8
         has_rpath: true,
9
+        is_like_openbsd: true,
10
+        eliminate_frame_pointer: false,
11
         pre_link_args: args,
12
         position_independent_executables: true,
13
         relro_level: RelroLevel::Full,
14
- 

Return to bug 227130