Skip to content

Commit 539e7e7

Browse files
authored
Merge pull request #4032 from tgross35/backport-radicchio
[0.2] Backports
2 parents 2a84617 + 02139a4 commit 539e7e7

File tree

14 files changed

+115
-28
lines changed

14 files changed

+115
-28
lines changed

.cirrus.yml

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
task:
22
only_if: $CIRRUS_BRANCH == 'main' || $CIRRUS_BASE_BRANCH == 'libc-0.2' || $CIRRUS_BASE_BRANCH == 'main'
3+
env:
4+
HOME: /tmp # cargo cache needs it
5+
TARGET: x86_64-unknown-freebsd
36
matrix:
4-
- name: nightly freebsd-13
7+
- name: nightly freebsd-13 i686
8+
# Test i686 FreeBSD in 32-bit emulation on a 64-bit host.
9+
env:
10+
TARGET: i686-unknown-freebsd
511
freebsd_instance:
612
image_family: freebsd-13-3
7-
- name: nightly freebsd-14
13+
- name: nightly freebsd-13 x86_64
814
freebsd_instance:
9-
image: freebsd-14-0-release-amd64-ufs
10-
- name: nightly freebsd-15
15+
image_family: freebsd-13-3
16+
- name: nightly freebsd-14 x86_64
17+
freebsd_instance:
18+
image: freebsd-14-1-release-amd64-ufs
19+
- name: nightly freebsd-15 x86_64
1120
freebsd_instance:
1221
image_family: freebsd-15-0-snap
1322
setup_script:
1423
- pkg install -y libnghttp2 curl
1524
- curl https://sh.rustup.rs -sSf --output rustup.sh
1625
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
26+
- . $HOME/.cargo/env
27+
- if [ "$TARGET" = "i686-unknown-freebsd" ]; then rustup target add i686-unknown-freebsd; fi
1728
test_script:
1829
- . $HOME/.cargo/env
19-
- LIBC_CI=1 sh ci/run.sh x86_64-unknown-freebsd
20-
- sh ci/run.sh x86_64-unknown-freebsd
30+
- LIBC_CI=1 sh ci/run.sh $TARGET
31+
- sh ci/run.sh $TARGET

ci/style.sh

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ else
1818
exit 1
1919
fi
2020

21+
# Ensure that `sort` output is not locale-dependent
22+
export LC_ALL=C
23+
2124
for file in libc-test/semver/*.txt; do
2225
case "$file" in
2326
*TODO*) continue ;;

libc-test/semver/apple.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,6 @@ clock_getres
19111911
clonefile
19121912
clonefileat
19131913
cmsghdr
1914-
confstr
19151914
connectx
19161915
copyfile
19171916
copyfile_callback_t

libc-test/semver/linux-gnu.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ XSK_UNALIGNED_BUF_ADDR_MASK
505505
XSK_UNALIGNED_BUF_OFFSET_SHIFT
506506
_CS_GNU_LIBC_VERSION
507507
_CS_GNU_LIBPTHREAD_VERSION
508-
_CS_PATH
508+
_CS_V6_ENV
509+
_CS_V7_ENV
509510
_SC_2_C_VERSION
510511
_SC_BASE
511512
_SC_CHARCLASS_NAME_MAX
@@ -608,7 +609,6 @@ asctime_r
608609
backtrace
609610
clock_adjtime
610611
close_range
611-
confstr
612612
copy_file_range
613613
ctermid
614614
ctime_r

libc-test/semver/linux-musl.txt

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ XDP_USE_SG
6060
XDP_ZEROCOPY
6161
XSK_UNALIGNED_BUF_ADDR_MASK
6262
XSK_UNALIGNED_BUF_OFFSET_SHIFT
63+
_CS_V6_ENV
64+
_CS_V7_ENV
6365
adjtimex
6466
aio_cancel
6567
aio_error

libc-test/semver/linux.txt

+36
Original file line numberDiff line numberDiff line change
@@ -3326,6 +3326,42 @@ XATTR_REPLACE
33263326
XTABS
33273327
YESEXPR
33283328
YESSTR
3329+
_CS_PATH
3330+
_CS_POSIX_V5_WIDTH_RESTRICTED_ENVS
3331+
_CS_POSIX_V6_ILP32_OFF32_CFLAGS
3332+
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS
3333+
_CS_POSIX_V6_ILP32_OFF32_LIBS
3334+
_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
3335+
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
3336+
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
3337+
_CS_POSIX_V6_ILP32_OFFBIG_LIBS
3338+
_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
3339+
_CS_POSIX_V6_LP64_OFF64_CFLAGS
3340+
_CS_POSIX_V6_LP64_OFF64_LDFLAGS
3341+
_CS_POSIX_V6_LP64_OFF64_LIBS
3342+
_CS_POSIX_V6_LP64_OFF64_LINTFLAGS
3343+
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
3344+
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
3345+
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS
3346+
_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
3347+
_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
3348+
_CS_POSIX_V7_ILP32_OFF32_CFLAGS
3349+
_CS_POSIX_V7_ILP32_OFF32_LDFLAGS
3350+
_CS_POSIX_V7_ILP32_OFF32_LIBS
3351+
_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS
3352+
_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS
3353+
_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
3354+
_CS_POSIX_V7_ILP32_OFFBIG_LIBS
3355+
_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS
3356+
_CS_POSIX_V7_LP64_OFF64_CFLAGS
3357+
_CS_POSIX_V7_LP64_OFF64_LDFLAGS
3358+
_CS_POSIX_V7_LP64_OFF64_LIBS
3359+
_CS_POSIX_V7_LP64_OFF64_LINTFLAGS
3360+
_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS
3361+
_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
3362+
_CS_POSIX_V7_LPBIG_OFFBIG_LIBS
3363+
_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
3364+
_CS_POSIX_V7_WIDTH_RESTRICTED_ENVS
33293365
_IOFBF
33303366
_IOLBF
33313367
_IONBF

libc-test/semver/unix.txt

+1
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ clockid_t
492492
close
493493
closedir
494494
closelog
495+
confstr
495496
connect
496497
creat
497498
dev_t

src/unix/bsd/apple/mod.rs

-5
Original file line numberDiff line numberDiff line change
@@ -5657,11 +5657,6 @@ extern "C" {
56575657
pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
56585658
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
56595659
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
5660-
#[cfg_attr(
5661-
all(target_os = "macos", target_arch = "x86"),
5662-
link_name = "confstr$UNIX2003"
5663-
)]
5664-
pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
56655660
pub fn lio_listio(
56665661
mode: ::c_int,
56675662
aiocb_list: *const *mut aiocb,

src/unix/hurd/align.rs

-1
This file was deleted.

src/unix/hurd/mod.rs

-11
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ pub type __ptrdiff_t = __sword_type;
7272
pub type __socklen_t = __u32_type;
7373
pub type __sig_atomic_t = ::c_int;
7474
pub type __time64_t = __int64_t;
75-
pub type ssize_t = __ssize_t;
7675
pub type wchar_t = ::c_int;
7776
pub type wint_t = ::c_uint;
7877
pub type gid_t = __gid_t;
@@ -4676,16 +4675,6 @@ safe_f! {
46764675
}
46774676
}
46784677

4679-
cfg_if! {
4680-
if #[cfg(libc_align)] {
4681-
mod align;
4682-
pub use self::align::*;
4683-
} else {
4684-
mod no_align;
4685-
pub use self::no_align::*;
4686-
}
4687-
}
4688-
46894678
cfg_if! {
46904679
if #[cfg(target_pointer_width = "64")] {
46914680
mod b64;

src/unix/linux_like/linux/gnu/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,8 @@ pub const FILENAME_MAX: ::c_uint = 4096;
886886
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
887887
pub const _CS_GNU_LIBC_VERSION: ::c_int = 2;
888888
pub const _CS_GNU_LIBPTHREAD_VERSION: ::c_int = 3;
889-
pub const _CS_PATH: ::c_int = 0;
889+
pub const _CS_V6_ENV: ::c_int = 1148;
890+
pub const _CS_V7_ENV: ::c_int = 1149;
890891
pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41;
891892
pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45;
892893
pub const _SC_PII: ::c_int = 53;
@@ -1533,7 +1534,6 @@ extern "C" {
15331534
pub fn asctime_r(tm: *const ::tm, buf: *mut ::c_char) -> *mut ::c_char;
15341535
pub fn ctime_r(timep: *const time_t, buf: *mut ::c_char) -> *mut ::c_char;
15351536

1536-
pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
15371537
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
15381538
/// POSIX version of `basename(3)`, defined in `libgen.h`.
15391539
#[link_name = "__xpg_basename"]

src/unix/linux_like/linux/mod.rs

+37
Original file line numberDiff line numberDiff line change
@@ -1812,6 +1812,43 @@ pub const _SC_XOPEN_STREAMS: ::c_int = 246;
18121812
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
18131813
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
18141814

1815+
pub const _CS_PATH: ::c_int = 0;
1816+
pub const _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS: ::c_int = 1;
1817+
pub const _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS: ::c_int = 4;
1818+
pub const _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS: ::c_int = 5;
1819+
pub const _CS_POSIX_V6_ILP32_OFF32_CFLAGS: ::c_int = 1116;
1820+
pub const _CS_POSIX_V6_ILP32_OFF32_LDFLAGS: ::c_int = 1117;
1821+
pub const _CS_POSIX_V6_ILP32_OFF32_LIBS: ::c_int = 1118;
1822+
pub const _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS: ::c_int = 1119;
1823+
pub const _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS: ::c_int = 1120;
1824+
pub const _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS: ::c_int = 1121;
1825+
pub const _CS_POSIX_V6_ILP32_OFFBIG_LIBS: ::c_int = 1122;
1826+
pub const _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS: ::c_int = 1123;
1827+
pub const _CS_POSIX_V6_LP64_OFF64_CFLAGS: ::c_int = 1124;
1828+
pub const _CS_POSIX_V6_LP64_OFF64_LDFLAGS: ::c_int = 1125;
1829+
pub const _CS_POSIX_V6_LP64_OFF64_LIBS: ::c_int = 1126;
1830+
pub const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS: ::c_int = 1127;
1831+
pub const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: ::c_int = 1128;
1832+
pub const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: ::c_int = 1129;
1833+
pub const _CS_POSIX_V6_LPBIG_OFFBIG_LIBS: ::c_int = 1130;
1834+
pub const _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS: ::c_int = 1131;
1835+
pub const _CS_POSIX_V7_ILP32_OFF32_CFLAGS: ::c_int = 1132;
1836+
pub const _CS_POSIX_V7_ILP32_OFF32_LDFLAGS: ::c_int = 1133;
1837+
pub const _CS_POSIX_V7_ILP32_OFF32_LIBS: ::c_int = 1134;
1838+
pub const _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS: ::c_int = 1135;
1839+
pub const _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS: ::c_int = 1136;
1840+
pub const _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS: ::c_int = 1137;
1841+
pub const _CS_POSIX_V7_ILP32_OFFBIG_LIBS: ::c_int = 1138;
1842+
pub const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS: ::c_int = 1139;
1843+
pub const _CS_POSIX_V7_LP64_OFF64_CFLAGS: ::c_int = 1140;
1844+
pub const _CS_POSIX_V7_LP64_OFF64_LDFLAGS: ::c_int = 1141;
1845+
pub const _CS_POSIX_V7_LP64_OFF64_LIBS: ::c_int = 1142;
1846+
pub const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS: ::c_int = 1143;
1847+
pub const _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS: ::c_int = 1144;
1848+
pub const _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS: ::c_int = 1145;
1849+
pub const _CS_POSIX_V7_LPBIG_OFFBIG_LIBS: ::c_int = 1146;
1850+
pub const _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS: ::c_int = 1147;
1851+
18151852
pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
18161853
pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
18171854

src/unix/linux_like/linux/musl/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,9 @@ pub const XSK_UNALIGNED_BUF_ADDR_MASK: ::c_ulonglong = (1 << XSK_UNALIGNED_BUF_O
899899

900900
pub const XDP_PKT_CONTD: ::__u32 = 1 << 0;
901901

902+
pub const _CS_V6_ENV: ::c_int = 1148;
903+
pub const _CS_V7_ENV: ::c_int = 1149;
904+
902905
cfg_if! {
903906
if #[cfg(target_arch = "s390x")] {
904907
pub const POSIX_FADV_DONTNEED: ::c_int = 6;

src/unix/mod.rs

+12
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,18 @@ cfg_if! {
14851485
}
14861486
}
14871487

1488+
cfg_if! {
1489+
if #[cfg(not(target_os = "android"))] {
1490+
extern "C" {
1491+
#[cfg_attr(
1492+
all(target_os = "macos", target_arch = "x86"),
1493+
link_name = "confstr$UNIX2003"
1494+
)]
1495+
pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
1496+
}
1497+
}
1498+
}
1499+
14881500
cfg_if! {
14891501
if #[cfg(not(target_os = "aix"))] {
14901502
extern "C" {

0 commit comments

Comments
 (0)