Skip to content

Commit 4e9c916

Browse files
authored
Merge pull request #4270 from tgross35/backport-portobello
[0.2] Backports
2 parents d148860 + 5553e18 commit 4e9c916

File tree

19 files changed

+263
-52
lines changed

19 files changed

+263
-52
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ but this is not guaranteed.
7171
You can see the platform(target)-specific docs on [docs.rs], select a platform
7272
you want to see.
7373

74-
See [`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh) for
74+
See [`ci/verify-build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/verify-build.sh) for
7575
the platforms on which `libc` is guaranteed to build for each Rust toolchain.
7676
The test-matrix at [GitHub Actions] and [Cirrus CI] show the platforms in which
7777
`libc` tests are run.

build.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{env, str};
55
// need to know all the possible cfgs that this script will set. If you need to set another cfg
66
// make sure to add it to this list as well.
77
const ALLOWED_CFGS: &'static [&'static str] = &[
8-
"emscripten_new_stat_abi",
8+
"emscripten_old_stat_abi",
99
"espidf_time32",
1010
"freebsd10",
1111
"freebsd11",
@@ -74,9 +74,9 @@ fn main() {
7474
}
7575

7676
match emcc_version_code() {
77-
Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"),
78-
// Non-Emscripten or version < 3.1.42.
79-
Some(_) | None => (),
77+
Some(v) if (v < 30142) => set_cfg("emscripten_old_stat_abi"),
78+
// Non-Emscripten or version >= 3.1.42.
79+
_ => (),
8080
}
8181

8282
// On CI: deny all warnings

ci/emscripten.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eux
44

55
# Note: keep in sync with:
6-
# https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/emscripten.sh
6+
# https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/platform-support/wasm32-unknown-emscripten.md#requirements
77
emsdk_version=3.1.68
88

99
git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable

libc-test/build.rs

+26-19
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ fn test_apple(target: &str) {
268268
"os/clock.h",
269269
"os/lock.h",
270270
"os/signpost.h",
271-
// FIXME: Requires the macOS 14.4 SDK.
271+
// FIXME(macos): Requires the macOS 14.4 SDK.
272272
//"os/os_sync_wait_on_address.h",
273273
"poll.h",
274274
"pthread.h",
@@ -338,15 +338,15 @@ fn test_apple(target: &str) {
338338
return true;
339339
}
340340
match ty {
341-
// FIXME: actually a union
341+
// FIXME(union): actually a union
342342
"sigval" => true,
343343

344-
// FIXME: The size is changed in recent macOSes.
344+
// FIXME(macos): The size is changed in recent macOSes.
345345
"malloc_zone_t" => true,
346346
// it is a moving target, changing through versions
347347
// also contains bitfields members
348348
"tcp_connection_info" => true,
349-
// FIXME: The size is changed in recent macOSes.
349+
// FIXME(macos): The size is changed in recent macOSes.
350350
"malloc_introspection_t" => true,
351351

352352
_ => false,
@@ -358,10 +358,10 @@ fn test_apple(target: &str) {
358358
return true;
359359
}
360360
match ty {
361-
// FIXME: Requires the macOS 14.4 SDK.
361+
// FIXME(macos): Requires the macOS 14.4 SDK.
362362
"os_sync_wake_by_address_flags_t" | "os_sync_wait_on_address_flags_t" => true,
363363

364-
// FIXME: "'__uint128' undeclared" in C
364+
// FIXME(macos): "'__uint128' undeclared" in C
365365
"__uint128" => true,
366366

367367
_ => false,
@@ -377,13 +377,13 @@ fn test_apple(target: &str) {
377377
// These OSX constants are removed in Sierra.
378378
// https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOS10_12/Swift/Darwin.html
379379
"KERN_KDENABLE_BG_TRACE" | "KERN_KDDISABLE_BG_TRACE" => true,
380-
// FIXME: the value has been changed since Catalina (0xffff0000 -> 0x3fff0000).
380+
// FIXME(macos): the value has been changed since Catalina (0xffff0000 -> 0x3fff0000).
381381
"SF_SETTABLE" => true,
382382

383-
// FIXME: XCode 13.1 doesn't have it.
383+
// FIXME(macos): XCode 13.1 doesn't have it.
384384
"TIOCREMOTE" => true,
385385

386-
// FIXME: Requires the macOS 14.4 SDK.
386+
// FIXME(macos): Requires the macOS 14.4 SDK.
387387
"OS_SYNC_WAKE_BY_ADDRESS_NONE"
388388
| "OS_SYNC_WAKE_BY_ADDRESS_SHARED"
389389
| "OS_SYNC_WAIT_ON_ADDRESS_NONE"
@@ -402,19 +402,19 @@ fn test_apple(target: &str) {
402402
// close calls the close_nocancel system call
403403
"close" => true,
404404

405-
// FIXME: std removed libresolv support: https://github.com/rust-lang/rust/pull/102766
405+
// FIXME(1.0): std removed libresolv support: https://github.com/rust-lang/rust/pull/102766
406406
"res_init" => true,
407407

408-
// FIXME: remove once the target in CI is updated
408+
// FIXME(macos): remove once the target in CI is updated
409409
"pthread_jit_write_freeze_callbacks_np" => true,
410410

411-
// FIXME: ABI has been changed on recent macOSes.
411+
// FIXME(macos): ABI has been changed on recent macOSes.
412412
"os_unfair_lock_assert_owner" | "os_unfair_lock_assert_not_owner" => true,
413413

414-
// FIXME: Once the SDK get updated to Ventura's level
414+
// FIXME(macos): Once the SDK get updated to Ventura's level
415415
"freadlink" | "mknodat" | "mkfifoat" => true,
416416

417-
// FIXME: Requires the macOS 14.4 SDK.
417+
// FIXME(macos): Requires the macOS 14.4 SDK.
418418
"os_sync_wake_by_address_any"
419419
| "os_sync_wake_by_address_all"
420420
| "os_sync_wake_by_address_flags_t"
@@ -429,7 +429,7 @@ fn test_apple(target: &str) {
429429

430430
cfg.skip_field(move |struct_, field| {
431431
match (struct_, field) {
432-
// FIXME: the array size has been changed since macOS 10.15 ([8] -> [7]).
432+
// FIXME(macos): the array size has been changed since macOS 10.15 ([8] -> [7]).
433433
("statfs", "f_reserved") => true,
434434
("__darwin_arm_neon_state64", "__v") => true,
435435
// MAXPATHLEN is too big for auto-derive traits on arrays.
@@ -447,7 +447,7 @@ fn test_apple(target: &str) {
447447

448448
cfg.skip_field_type(move |struct_, field| {
449449
match (struct_, field) {
450-
// FIXME: actually a union
450+
// FIXME(union): actually a union
451451
("sigevent", "sigev_value") => true,
452452
_ => false,
453453
}
@@ -481,7 +481,7 @@ fn test_apple(target: &str) {
481481
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
482482
s.replace("e_nsec", "espec.tv_nsec")
483483
}
484-
// FIXME: sigaction actually contains a union with two variants:
484+
// FIXME(macos): sigaction actually contains a union with two variants:
485485
// a sa_sigaction with type: (*)(int, struct __siginfo *, void *)
486486
// a sa_handler with type sig_t
487487
"sa_sigaction" if struct_ == "sigaction" => "sa_handler".to_string(),
@@ -490,7 +490,7 @@ fn test_apple(target: &str) {
490490
});
491491

492492
cfg.skip_roundtrip(move |s| match s {
493-
// FIXME: this type has the wrong ABI
493+
// FIXME(macos): this type has the wrong ABI
494494
"max_align_t" if i686 => true,
495495
// Can't return an array from a C function.
496496
"uuid_t" | "vol_capabilities_set_t" => true,
@@ -597,7 +597,7 @@ fn test_openbsd(target: &str) {
597597
return true;
598598
}
599599
match ty {
600-
// FIXME: actually a union
600+
// FIXME(union): actually a union
601601
"sigval" => true,
602602

603603
_ => false,
@@ -915,6 +915,7 @@ fn test_solarish(target: &str) {
915915
"sched.h",
916916
"semaphore.h",
917917
"signal.h",
918+
"spawn.h",
918919
"stddef.h",
919920
"stdint.h",
920921
"stdio.h",
@@ -3065,6 +3066,9 @@ fn test_emscripten(target: &str) {
30653066
// https://github.com/emscripten-core/emscripten/pull/14883
30663067
"SIG_IGN" => true,
30673068

3069+
// Constants present in other linuxes but not emscripten
3070+
"SI_DETHREAD" | "TRAP_PERF" => true,
3071+
30683072
// LFS64 types have been removed in Emscripten 3.1.44
30693073
// https://github.com/emscripten-core/emscripten/pull/19812
30703074
n if n.starts_with("RLIM64") => true,
@@ -4130,6 +4134,9 @@ fn test_linux(target: &str) {
41304134
// FIXME: Not currently available in headers on ARM and musl.
41314135
"NETLINK_GET_STRICT_CHK" if arm => true,
41324136

4137+
// Skip as this signal codes and trap reasons need newer headers
4138+
"SI_DETHREAD" | "TRAP_PERF" => true,
4139+
41334140
// kernel constants not available in uclibc 1.0.34
41344141
| "EXTPROC"
41354142
| "IPPROTO_BEETPH"

libc-test/semver/illumos.txt

+2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ POSIX_FADV_NORMAL
1414
POSIX_FADV_RANDOM
1515
POSIX_FADV_SEQUENTIAL
1616
POSIX_FADV_WILLNEED
17+
POSIX_SPAWN_SETSID
1718
posix_fadvise
1819
posix_fallocate
20+
posix_spawn_file_actions_addfchdir_np
1921
pthread_attr_get_np
2022
pthread_attr_getstackaddr
2123
pthread_attr_setstack

libc-test/semver/linux.txt

+16
Original file line numberDiff line numberDiff line change
@@ -2879,7 +2879,17 @@ SIOCSMIIREG
28792879
SIOCSRARP
28802880
SIOCWANDEV
28812881
SIOGIFINDEX
2882+
SI_ASYNCIO
2883+
SI_ASYNCNL
2884+
SI_DETHREAD
2885+
SI_KERNEL
28822886
SI_LOAD_SHIFT
2887+
SI_MESGQ
2888+
SI_QUEUE
2889+
SI_SIGIO
2890+
SI_TIMER
2891+
SI_TKILL
2892+
SI_USER
28832893
SND_CNT
28842894
SND_MAX
28852895
SOCK_CLOEXEC
@@ -3359,6 +3369,12 @@ TP_STATUS_USER
33593369
TP_STATUS_VLAN_TPID_VALID
33603370
TP_STATUS_VLAN_VALID
33613371
TP_STATUS_WRONG_FORMAT
3372+
TRAP_BRANCH
3373+
TRAP_BRKPT
3374+
TRAP_HWBKPT
3375+
TRAP_PERF
3376+
TRAP_TRACE
3377+
TRAP_UNK
33623378
TUNATTACHFILTER
33633379
TUNDETACHFILTER
33643380
TUNGETFEATURES

libc-test/semver/solarish.txt

+37
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ LIO_READ
1515
LIO_WAIT
1616
LIO_WRITE
1717
PIPE_BUF
18+
POSIX_SPAWN_NOEXECERR_NP
19+
POSIX_SPAWN_NOSIGCHLD_NP
20+
POSIX_SPAWN_RESETIDS
21+
POSIX_SPAWN_SETPGROUP
22+
POSIX_SPAWN_SETSCHEDPARAM
23+
POSIX_SPAWN_SETSCHEDULER
24+
POSIX_SPAWN_SETSIGDEF
25+
POSIX_SPAWN_SETSIGIGN_NP
26+
POSIX_SPAWN_SETSIGMASK
27+
POSIX_SPAWN_WAITPID_NP
1828
SIGEV_PORT
1929
SIGRTMAX
2030
SIGRTMIN
@@ -34,5 +44,32 @@ bind
3444
in6_pktinfo
3545
in_pktinfo
3646
lio_listio
47+
posix_spawn
48+
posix_spawn_file_actions_addchdir
49+
posix_spawn_file_actions_addchdir_np
50+
posix_spawn_file_actions_addclose
51+
posix_spawn_file_actions_addclosefrom_np
52+
posix_spawn_file_actions_adddup2
53+
posix_spawn_file_actions_addfchdir
54+
posix_spawn_file_actions_addopen
55+
posix_spawn_file_actions_destroy
56+
posix_spawn_file_actions_init
57+
posix_spawnattr_destroy
58+
posix_spawnattr_getflags
59+
posix_spawnattr_getpgroup
60+
posix_spawnattr_getschedparam
61+
posix_spawnattr_getschedpolicy
62+
posix_spawnattr_getsigdefault
63+
posix_spawnattr_getsigignore_np
64+
posix_spawnattr_getsigmask
65+
posix_spawnattr_init
66+
posix_spawnattr_setflags
67+
posix_spawnattr_setpgroup
68+
posix_spawnattr_setschedparam
69+
posix_spawnattr_setschedpolicy
70+
posix_spawnattr_setsigdefault
71+
posix_spawnattr_setsigignore_np
72+
posix_spawnattr_setsigmask
73+
posix_spawnp
3774
recvmsg
3875
sendmsg

0 commit comments

Comments
 (0)