Skip to content

Commit 83d97c2

Browse files
committed
Auto merge of #1296 - gnzlbg:build_uclib, r=gnzlbg
Check that more targets build
2 parents 8d94e00 + 183c51b commit 83d97c2

File tree

6 files changed

+134
-106
lines changed

6 files changed

+134
-106
lines changed

ci/build.sh

+12-4
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ done
167167
# FIXME: https://github.com/rust-lang/rust/issues/58564
168168
# sparc-unknown-linux-gnu
169169
RUST_LINUX_NO_CORE_TARGETS="\
170-
x86_64-unknown-hermit \
171-
x86_64-unknown-dragonfly \
172-
aarch64-unknown-hermit \
173170
aarch64-pc-windows-msvc \
174171
aarch64-unknown-cloudabi \
172+
aarch64-unknown-hermit \
173+
aarch64-unknown-netbsd \
174+
aarch64-unknown-openbsd \
175175
armebv7r-none-eabi \
176176
armebv7r-none-eabihf \
177177
armv7-unknown-cloudabi-eabihf \
@@ -182,8 +182,12 @@ i686-pc-windows-msvc \
182182
i686-unknown-cloudabi \
183183
i686-unknown-haiku \
184184
i686-unknown-netbsd \
185+
i686-unknown-openbsd \
186+
mips-unknown-linux-uclibc \
187+
mipsel-unknown-linux-uclibc \
185188
nvptx64-nvidia-cuda \
186189
powerpc-unknown-linux-gnuspe \
190+
powerpc-unknown-netbsd \
187191
riscv32imac-unknown-none-elf \
188192
riscv32imc-unknown-none-elf \
189193
sparc64-unknown-netbsd \
@@ -196,8 +200,12 @@ thumbv7neon-unknown-linux-gnueabihf \
196200
thumbv8m.main-none-eabi \
197201
x86_64-pc-windows-msvc
198202
x86_64-unknown-bitrig \
203+
x86_64-unknown-dragonfly \
204+
x86_64-unknown-dragonfly \
199205
x86_64-unknown-haiku \
200-
x86_64-unknown-openbsd
206+
x86_64-unknown-hermit \
207+
x86_64-unknown-l4re-uclibc \
208+
x86_64-unknown-openbsd \
201209
"
202210

203211
if [ "${RUST}" = "nightly" ] && [ "${OS}" = "linux" ]; then

src/unix/uclibc/align.rs

+33-28
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
macro_rules! expand_align {
22
() => {
33
s! {
4+
#[cfg_attr(any(target_pointer_width = "32",
5+
target_arch = "x86_64",
6+
target_arch = "powerpc64",
7+
target_arch = "mips64",
8+
target_arch = "s390x",
9+
target_arch = "sparc64"),
10+
repr(align(4)))]
11+
#[cfg_attr(not(any(target_pointer_width = "32",
12+
target_arch = "x86_64",
13+
target_arch = "powerpc64",
14+
target_arch = "mips64",
15+
target_arch = "s390x",
16+
target_arch = "sparc64")),
17+
repr(align(8)))]
18+
pub struct pthread_mutexattr_t {
19+
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
20+
}
21+
22+
#[repr(align(4))]
23+
pub struct pthread_condattr_t {
24+
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
25+
}
26+
}
27+
28+
s_no_extra_traits! {
29+
#[repr(align(8))]
30+
#[allow(missing_debug_implementations)]
31+
pub struct pthread_cond_t {
32+
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
33+
}
34+
435
#[cfg_attr(all(target_pointer_width = "32",
536
any(target_arch = "mips",
637
target_arch = "arm",
@@ -11,6 +42,7 @@ macro_rules! expand_align {
1142
target_arch = "arm",
1243
target_arch = "powerpc"))),
1344
repr(align(8)))]
45+
#[allow(missing_debug_implementations)]
1446
pub struct pthread_mutex_t {
1547
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
1648
}
@@ -25,37 +57,10 @@ macro_rules! expand_align {
2557
target_arch = "arm",
2658
target_arch = "powerpc"))),
2759
repr(align(8)))]
60+
#[allow(missing_debug_implementations)]
2861
pub struct pthread_rwlock_t {
2962
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
3063
}
31-
32-
#[cfg_attr(any(target_pointer_width = "32",
33-
target_arch = "x86_64",
34-
target_arch = "powerpc64",
35-
target_arch = "mips64",
36-
target_arch = "s390x",
37-
target_arch = "sparc64"),
38-
repr(align(4)))]
39-
#[cfg_attr(not(any(target_pointer_width = "32",
40-
target_arch = "x86_64",
41-
target_arch = "powerpc64",
42-
target_arch = "mips64",
43-
target_arch = "s390x",
44-
target_arch = "sparc64")),
45-
repr(align(8)))]
46-
pub struct pthread_mutexattr_t {
47-
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
48-
}
49-
50-
#[repr(align(8))]
51-
pub struct pthread_cond_t {
52-
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
53-
}
54-
55-
#[repr(align(4))]
56-
pub struct pthread_condattr_t {
57-
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
58-
}
5964
}
6065
}
6166
}

src/unix/uclibc/mod.rs

+45-39
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,6 @@ s! {
6666
pub sin6_scope_id: u32,
6767
}
6868

69-
pub struct sockaddr_un {
70-
pub sun_family: sa_family_t,
71-
pub sun_path: [::c_char; 108]
72-
}
73-
74-
pub struct sockaddr_storage {
75-
pub ss_family: sa_family_t,
76-
__ss_align: ::size_t,
77-
#[cfg(target_pointer_width = "32")]
78-
__ss_pad2: [u8; 128 - 2 * 4],
79-
#[cfg(target_pointer_width = "64")]
80-
__ss_pad2: [u8; 128 - 2 * 8],
81-
}
82-
8369
pub struct addrinfo {
8470
pub ai_flags: ::c_int,
8571
pub ai_family: ::c_int,
@@ -140,15 +126,6 @@ s! {
140126
pub dli_saddr: *mut ::c_void,
141127
}
142128

143-
pub struct utsname {
144-
pub sysname: [::c_char; 65],
145-
pub nodename: [::c_char; 65],
146-
pub release: [::c_char; 65],
147-
pub version: [::c_char; 65],
148-
pub machine: [::c_char; 65],
149-
pub domainname: [::c_char; 65]
150-
}
151-
152129
pub struct lconv {
153130
pub decimal_point: *mut ::c_char,
154131
pub thousands_sep: *mut ::c_char,
@@ -189,22 +166,6 @@ s! {
189166
__unused1: [::c_int; 12]
190167
}
191168

192-
pub struct dirent {
193-
pub d_ino: ::ino_t,
194-
pub d_off: ::off_t,
195-
pub d_reclen: ::c_ushort,
196-
pub d_type: ::c_uchar,
197-
pub d_name: [::c_char; 256],
198-
}
199-
200-
pub struct dirent64 {
201-
pub d_ino: ::ino64_t,
202-
pub d_off: ::off64_t,
203-
pub d_reclen: ::c_ushort,
204-
pub d_type: ::c_uchar,
205-
pub d_name: [::c_char; 256],
206-
}
207-
208169
pub struct rlimit64 {
209170
pub rlim_cur: rlim64_t,
210171
pub rlim_max: rlim64_t,
@@ -358,10 +319,55 @@ s_no_extra_traits! {
358319
any(target_arch = "x86", target_arch = "x86_64"),
359320
repr(packed)
360321
)]
322+
#[allow(missing_debug_implementations)]
361323
pub struct epoll_event {
362324
pub events: ::uint32_t,
363325
pub u64: ::uint64_t,
364326
}
327+
328+
#[allow(missing_debug_implementations)]
329+
pub struct sockaddr_un {
330+
pub sun_family: sa_family_t,
331+
pub sun_path: [::c_char; 108]
332+
}
333+
334+
#[allow(missing_debug_implementations)]
335+
pub struct sockaddr_storage {
336+
pub ss_family: sa_family_t,
337+
__ss_align: ::size_t,
338+
#[cfg(target_pointer_width = "32")]
339+
__ss_pad2: [u8; 128 - 2 * 4],
340+
#[cfg(target_pointer_width = "64")]
341+
__ss_pad2: [u8; 128 - 2 * 8],
342+
}
343+
344+
#[allow(missing_debug_implementations)]
345+
pub struct utsname {
346+
pub sysname: [::c_char; 65],
347+
pub nodename: [::c_char; 65],
348+
pub release: [::c_char; 65],
349+
pub version: [::c_char; 65],
350+
pub machine: [::c_char; 65],
351+
pub domainname: [::c_char; 65]
352+
}
353+
354+
#[allow(missing_debug_implementations)]
355+
pub struct dirent {
356+
pub d_ino: ::ino_t,
357+
pub d_off: ::off_t,
358+
pub d_reclen: ::c_ushort,
359+
pub d_type: ::c_uchar,
360+
pub d_name: [::c_char; 256],
361+
}
362+
363+
#[allow(missing_debug_implementations)]
364+
pub struct dirent64 {
365+
pub d_ino: ::ino64_t,
366+
pub d_off: ::off64_t,
367+
pub d_reclen: ::c_ushort,
368+
pub d_type: ::c_uchar,
369+
pub d_name: [::c_char; 256],
370+
}
365371
}
366372

367373
// intentionally not public, only used for fd_set

src/unix/uclibc/x86_64/align.rs

+24-19
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ macro_rules! expand_align {
1212
__size: [::c_char; 32],
1313
}
1414

15-
#[cfg_attr(all(target_pointer_width = "32",
16-
any(target_arch = "mips",
17-
target_arch = "arm",
18-
target_arch = "powerpc")),
19-
repr(align(4)))]
20-
#[cfg_attr(all(any(target_pointer_width = "64",
21-
not(any(target_arch = "mips",
22-
target_arch = "arm",
23-
target_arch = "powerpc")))),
24-
repr(align(8)))]
25-
pub struct pthread_mutex_t { // ToDo
26-
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
27-
}
28-
2915
#[cfg_attr(any(target_pointer_width = "32",
3016
target_arch = "x86_64",
3117
target_arch = "powerpc64",
@@ -44,15 +30,33 @@ macro_rules! expand_align {
4430
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
4531
}
4632

47-
#[repr(align(8))]
48-
pub struct pthread_cond_t { // ToDo
49-
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
50-
}
51-
5233
#[repr(align(4))]
5334
pub struct pthread_condattr_t { // ToDo
5435
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
5536
}
37+
}
38+
39+
s_no_extra_traits! {
40+
#[cfg_attr(all(target_pointer_width = "32",
41+
any(target_arch = "mips",
42+
target_arch = "arm",
43+
target_arch = "powerpc")),
44+
repr(align(4)))]
45+
#[cfg_attr(all(any(target_pointer_width = "64",
46+
not(any(target_arch = "mips",
47+
target_arch = "arm",
48+
target_arch = "powerpc")))),
49+
repr(align(8)))]
50+
#[allow(missing_debug_implementations)]
51+
pub struct pthread_mutex_t { // ToDo
52+
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
53+
}
54+
55+
#[repr(align(8))]
56+
#[allow(missing_debug_implementations)]
57+
pub struct pthread_cond_t { // ToDo
58+
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
59+
}
5660

5761
#[cfg_attr(all(target_pointer_width = "32",
5862
any(target_arch = "mips",
@@ -64,6 +68,7 @@ macro_rules! expand_align {
6468
target_arch = "arm",
6569
target_arch = "powerpc"))),
6670
repr(align(8)))]
71+
#[allow(missing_debug_implementations)]
6772
pub struct pthread_rwlock_t { // ToDo
6873
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
6974
}

src/unix/uclibc/x86_64/l4re.rs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ s! {
2727
}
2828

2929
#[cfg(target_os = "l4re")]
30+
#[allow(missing_debug_implementations)]
3031
pub struct pthread_attr_t {
3132
pub __detachstate: ::c_int,
3233
pub __schedpolicy: ::c_int,

src/unix/uclibc/x86_64/mod.rs

+19-16
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,6 @@ pub type time_t = ::c_int;
2020
pub type wchar_t = ::c_int;
2121

2222
s! {
23-
pub struct dirent {
24-
pub d_ino: ::ino64_t,
25-
pub d_off: ::off64_t,
26-
pub d_reclen: u16,
27-
pub d_type: u8,
28-
pub d_name: [::c_char; 256],
29-
}
30-
31-
pub struct dirent64 {
32-
pub d_ino: ::ino64_t,
33-
pub d_off: ::off64_t,
34-
pub d_reclen: u16,
35-
pub d_type: u8,
36-
pub d_name: [::c_char; 256],
37-
}
38-
3923
pub struct ipc_perm {
4024
pub __key: ::key_t,
4125
pub uid: ::uid_t,
@@ -252,6 +236,25 @@ s! {
252236
}
253237
}
254238

239+
s_no_extra_traits! {
240+
#[allow(missing_debug_implementations)]
241+
pub struct dirent {
242+
pub d_ino: ::ino64_t,
243+
pub d_off: ::off64_t,
244+
pub d_reclen: u16,
245+
pub d_type: u8,
246+
pub d_name: [::c_char; 256],
247+
}
248+
#[allow(missing_debug_implementations)]
249+
pub struct dirent64 {
250+
pub d_ino: ::ino64_t,
251+
pub d_off: ::off64_t,
252+
pub d_reclen: u16,
253+
pub d_type: u8,
254+
pub d_name: [::c_char; 256],
255+
}
256+
}
257+
255258
// constants
256259
pub const EADDRINUSE: ::c_int = 98; // Address already in use
257260
pub const EADDRNOTAVAIL: ::c_int = 99; // Cannot assign requested address

0 commit comments

Comments
 (0)