Skip to content

Commit 974aaa3

Browse files
committed
Merge branch 'csky-unknown-linux-gnuabiv2' of github.com:Dirreke/libc into csky-unknown-linux-gnuabiv2
2 parents 85daa2f + fab4a56 commit 974aaa3

File tree

20 files changed

+355
-40
lines changed

20 files changed

+355
-40
lines changed

.cirrus.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ task:
2929
task:
3030
name: nightly x86_64-unknown-freebsd-14
3131
freebsd_instance:
32-
image: freebsd-14-0-current-amd64-v20230330
32+
# FIXME: FreeBSD 14 CI fails due to pkg installation.
33+
# Use 14 again once a new image is available on Cirrus CI.
34+
image_family: freebsd-13-2
3335
setup_script:
3436
- pkg install -y libnghttp2 curl
3537
- curl https://sh.rustup.rs -sSf --output rustup.sh

.github/workflows/docs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ jobs:
2525
- name: Generate documentation
2626
run: LIBC_CI=1 sh ci/dox.sh
2727
- name: Setup Pages
28-
uses: actions/configure-pages@v2
28+
uses: actions/configure-pages@v3
29+
- name: Fix permissions
30+
run: rm -f ./target/doc/.lock
2931
- name: Upload artifact
30-
uses: actions/upload-pages-artifact@v1
32+
uses: actions/upload-pages-artifact@v2
3133
with:
3234
path: 'target/doc'
3335
- name: Deploy to GitHub Pages
3436
id: deployment
35-
uses: actions/deploy-pages@v1
37+
uses: actions/deploy-pages@v2

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ targets = [
124124
"x86_64-unknown-redox",
125125
"x86_64-wrs-vxworks"
126126
]
127-
cargo-args = ["-Zbuild-std"]
127+
cargo-args = ["-Zbuild-std=core"]
128128

129129
[dependencies]
130130
rustc-std-workspace-core = { version = "1.0.0", optional = true }

build.rs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::string::String;
77
// need to know all the possible cfgs that this script will set. If you need to set another cfg
88
// make sure to add it to this list as well.
99
const ALLOWED_CFGS: &'static [&'static str] = &[
10+
"emscripten_new_stat_abi",
1011
"freebsd10",
1112
"freebsd11",
1213
"freebsd12",
@@ -34,7 +35,7 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
3435
const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[
3536
("target_os", &["switch", "aix", "ohos"]),
3637
("target_env", &["illumos", "wasi", "aix", "ohos"]),
37-
("target_arch", &["loongarch64", "csky"]),
38+
("target_arch", &["loongarch64", "mips32r6", "mips64r6", "csky"]),
3839
];
3940

4041
fn main() {
@@ -69,6 +70,12 @@ fn main() {
6970
Some(_) | None => set_cfg("freebsd11"),
7071
}
7172

73+
match emcc_version_code() {
74+
Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"),
75+
// Non-Emscripten or version < 3.1.42.
76+
Some(_) | None => (),
77+
}
78+
7279
// On CI: deny all warnings
7380
if libc_ci {
7481
set_cfg("libc_deny_warnings");
@@ -238,6 +245,33 @@ fn which_freebsd() -> Option<i32> {
238245
}
239246
}
240247

248+
fn emcc_version_code() -> Option<u64> {
249+
let output = std::process::Command::new("emcc")
250+
.arg("-dumpversion")
251+
.output()
252+
.ok();
253+
if output.is_none() {
254+
return None;
255+
}
256+
let output = output.unwrap();
257+
if !output.status.success() {
258+
return None;
259+
}
260+
261+
let stdout = String::from_utf8(output.stdout).ok();
262+
if stdout.is_none() {
263+
return None;
264+
}
265+
let version = stdout.unwrap();
266+
let mut pieces = version.trim().split('.');
267+
268+
let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
269+
let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
270+
let patch = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
271+
272+
Some(major * 10000 + minor * 100 + patch)
273+
}
274+
241275
fn set_cfg(cfg: &str) {
242276
if !ALLOWED_CFGS.contains(&cfg) {
243277
panic!("trying to set cfg {}, but it is not in ALLOWED_CFGS", cfg);

ci/build.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ i686-linux-android \
102102
i686-unknown-freebsd \
103103
i686-unknown-linux-gnu \
104104
i686-unknown-linux-musl \
105-
mips-unknown-linux-gnu \
106-
mips-unknown-linux-musl \
107-
mips64-unknown-linux-gnuabi64 \
108-
mips64el-unknown-linux-gnuabi64 \
109-
mipsel-unknown-linux-gnu \
110-
mipsel-unknown-linux-musl \
111105
powerpc-unknown-linux-gnu \
112106
powerpc64-unknown-linux-gnu \
113107
powerpc64le-unknown-linux-gnu \
@@ -118,6 +112,14 @@ x86_64-unknown-linux-musl \
118112
x86_64-unknown-netbsd \
119113
"
120114

115+
# FIXME: builds of MIPS targets are currently broken on nightly.
116+
# mips-unknown-linux-gnu \
117+
# mips-unknown-linux-musl \
118+
# mips64-unknown-linux-gnuabi64 \
119+
# mips64el-unknown-linux-gnuabi64 \
120+
# mipsel-unknown-linux-gnu \
121+
# mipsel-unknown-linux-musl \
122+
121123
RUST_GT_1_13_LINUX_TARGETS="\
122124
arm-unknown-linux-musleabi \
123125
arm-unknown-linux-musleabihf \

ci/install-rust.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ else
1212
# https://github.com/rust-lang/rust/issues/103673 contains related information.
1313
case "$TARGET" in
1414
*android*) toolchain=nightly-2022-10-09;;
15+
# FIXME: Unpin once mips' components are available on nightly.
16+
# https://rust-lang.github.io/rustup-components-history/mips-unknown-linux-gnu.html
17+
*mips*) toolchain=nightly-2023-07-04;;
1518
*) toolchain=nightly;;
1619
esac
1720
fi

libc-test/build.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ fn test_apple(target: &str) {
350350
// FIXME: ABI has been changed on recent macOSes.
351351
"os_unfair_lock_assert_owner" | "os_unfair_lock_assert_not_owner" => true,
352352

353+
// FIXME: Once the SDK get updated to Ventura's level
354+
"freadlink" | "mknodat" | "mkfifoat" => true,
355+
353356
_ => false,
354357
}
355358
});
@@ -1802,6 +1805,41 @@ fn test_android(target: &str) {
18021805
// kernel 5.6 minimum required
18031806
"IPPROTO_MPTCP" | "IPPROTO_ETHERNET" => true,
18041807

1808+
// FIXME: NDK r22 minimum required
1809+
| "FDB_NOTIFY_BIT"
1810+
| "FDB_NOTIFY_INACTIVE_BIT"
1811+
| "IFLA_ALT_IFNAME"
1812+
| "IFLA_PERM_ADDRESS"
1813+
| "IFLA_PROP_LIST"
1814+
| "IFLA_PROTO_DOWN_REASON"
1815+
| "NDA_FDB_EXT_ATTRS"
1816+
| "NDA_NH_ID"
1817+
| "NFEA_ACTIVITY_NOTIFY"
1818+
| "NFEA_DONT_REFRESH"
1819+
| "NFEA_UNSPEC" => true,
1820+
1821+
// FIXME: NDK r23 minimum required
1822+
| "IFLA_PARENT_DEV_BUS_NAME"
1823+
| "IFLA_PARENT_DEV_NAME" => true,
1824+
1825+
// FIXME: NDK r25 minimum required
1826+
| "IFLA_GRO_MAX_SIZE"
1827+
| "NDA_FLAGS_EXT"
1828+
| "NTF_EXT_MANAGED" => true,
1829+
1830+
// FIXME: NDK above r25 required
1831+
| "IFLA_ALLMULTI"
1832+
| "IFLA_DEVLINK_PORT"
1833+
| "IFLA_GRO_IPV4_MAX_SIZE"
1834+
| "IFLA_GSO_IPV4_MAX_SIZE"
1835+
| "IFLA_TSO_MAX_SEGS"
1836+
| "IFLA_TSO_MAX_SIZE"
1837+
| "NDA_NDM_STATE_MASK"
1838+
| "NDA_NDM_FLAGS_MASK"
1839+
| "NDTPA_INTERVAL_PROBE_TIME_MS"
1840+
| "NFQA_UNSPEC"
1841+
| "NTF_EXT_LOCKED" => true,
1842+
18051843
_ => false,
18061844
}
18071845
});

libc-test/semver/android.txt

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ FD_ISSET
597597
FD_SET
598598
FD_SETSIZE
599599
FD_ZERO
600+
FDB_NOTIFY_BIT
601+
FDB_NOTIFY_INACTIVE_BIT
600602
FF0
601603
FF1
602604
FFDLY
@@ -777,6 +779,19 @@ IFLA_CARRIER_DOWN_COUNT
777779
IFLA_NEW_IFINDEX
778780
IFLA_MIN_MTU
779781
IFLA_MAX_MTU
782+
IFLA_PROP_LIST
783+
IFLA_ALT_IFNAME
784+
IFLA_PERM_ADDRESS
785+
IFLA_PROTO_DOWN_REASON
786+
IFLA_PARENT_DEV_NAME
787+
IFLA_PARENT_DEV_BUS_NAME
788+
IFLA_GRO_MAX_SIZE
789+
IFLA_TSO_MAX_SIZE
790+
IFLA_TSO_MAX_SEGS
791+
IFLA_ALLMULTI
792+
IFLA_DEVLINK_PORT
793+
IFLA_GSO_IPV4_MAX_SIZE
794+
IFLA_GRO_IPV4_MAX_SIZE
780795
IFLA_INFO_UNSPEC
781796
IFLA_INFO_KIND
782797
IFLA_INFO_DATA
@@ -1257,6 +1272,54 @@ MS_SYNCHRONOUS
12571272
MS_UNBINDABLE
12581273
NCCS
12591274
NCP_SUPER_MAGIC
1275+
NDA_CACHEINFO
1276+
NDA_DST
1277+
NDA_FDB_EXT_ATTRS
1278+
NDA_FLAGS_EXT
1279+
NDA_IFINDEX
1280+
NDA_LINK_NETNSID
1281+
NDA_LLADDR
1282+
NDA_MASTER
1283+
NDA_NDM_FLAGS_MASK
1284+
NDA_NDM_STATE_MASK
1285+
NDA_NH_ID
1286+
NDA_PORT
1287+
NDA_PROBES
1288+
NDA_PROTOCOL
1289+
NDA_SRC_VNI
1290+
NDA_UNSPEC
1291+
NDA_VLAN
1292+
NDA_VNI
1293+
NDTA_CONFIG
1294+
NDTA_GC_INTERVAL
1295+
NDTA_NAME
1296+
NDTA_PAD
1297+
NDTA_PARMS
1298+
NDTA_STATS
1299+
NDTA_THRESH1
1300+
NDTA_THRESH2
1301+
NDTA_THRESH3
1302+
NDTA_UNSPEC
1303+
NDTPA_ANYCAST_DELAY
1304+
NDTPA_APP_PROBES
1305+
NDTPA_BASE_REACHABLE_TIME
1306+
NDTPA_DELAY_PROBE_TIME
1307+
NDTPA_GC_STALETIME
1308+
NDTPA_IFINDEX
1309+
NDTPA_INTERVAL_PROBE_TIME_MS
1310+
NDTPA_LOCKTIME
1311+
NDTPA_MCAST_PROBES
1312+
NDTPA_MCAST_REPROBES
1313+
NDTPA_PAD
1314+
NDTPA_PROXY_DELAY
1315+
NDTPA_PROXY_QLEN
1316+
NDTPA_QUEUE_LEN
1317+
NDTPA_QUEUE_LENBYTES
1318+
NDTPA_REACHABLE_TIME
1319+
NDTPA_REFCNT
1320+
NDTPA_RETRANS_TIME
1321+
NDTPA_UCAST_PROBES
1322+
NDTPA_UNSPEC
12601323
NETLINK_ADD_MEMBERSHIP
12611324
NETLINK_AUDIT
12621325
NETLINK_BROADCAST_ERROR
@@ -1622,6 +1685,9 @@ NF_VERDICT_FLAG_QUEUE_BYPASS
16221685
NF_VERDICT_MASK
16231686
NF_VERDICT_QBITS
16241687
NF_VERDICT_QMASK
1688+
NFEA_ACTIVITY_NOTIFY
1689+
NFEA_DONT_REFRESH
1690+
NFEA_UNSPEC
16251691
NI_DGRAM
16261692
NI_MAXHOST
16271693
NI_MAXSERV
@@ -1657,6 +1723,25 @@ NLM_F_REPLACE
16571723
NLM_F_REQUEST
16581724
NLM_F_ROOT
16591725
NOFLSH
1726+
NTF_EXT_LEARNED
1727+
NTF_EXT_LOCKED
1728+
NTF_EXT_MANAGED
1729+
NTF_MASTER
1730+
NTF_OFFLOADED
1731+
NTF_PROXY
1732+
NTF_ROUTER
1733+
NTF_SELF
1734+
NTF_STICKY
1735+
NTF_USE
1736+
NUD_DELAY
1737+
NUD_FAILED
1738+
NUD_INCOMPLETE
1739+
NUD_NOARP
1740+
NUD_NONE
1741+
NUD_PERMANENT
1742+
NUD_PROBE
1743+
NUD_REACHABLE
1744+
NUD_STALE
16601745
OCRNL
16611746
OFDEL
16621747
OFILL
@@ -1818,6 +1903,7 @@ PTRACE_PEEKUSER
18181903
PTRACE_POKEDATA
18191904
PTRACE_POKETEXT
18201905
PTRACE_POKEUSER
1906+
PTRACE_SECCOMP_GET_METADATA
18211907
PTRACE_SETOPTIONS
18221908
PTRACE_SETSIGINFO
18231909
PTRACE_SINGLESTEP
@@ -3430,6 +3516,7 @@ sched_setparam
34303516
sched_setscheduler
34313517
sched_yield
34323518
seccomp_data
3519+
seccomp_metadata
34333520
seekdir
34343521
select
34353522
sem_close

libc-test/semver/apple.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,7 @@ flistxattr
18711871
fmemopen
18721872
fmount
18731873
forkpty
1874+
freadlink
18741875
freeifaddrs
18751876
freelocale
18761877
fremovexattr
@@ -1994,6 +1995,8 @@ memset_s
19941995
mem_entry_name_port_t
19951996
mincore
19961997
mkdirat
1998+
mkfifoat
1999+
mknodat
19972000
mkstemps
19982001
mount
19992002
msghdr

src/unix/bsd/apple/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6058,6 +6058,15 @@ extern "C" {
60586058

60596059
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
60606060
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
6061+
6062+
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
6063+
pub fn mknodat(
6064+
dirfd: ::c_int,
6065+
pathname: *const ::c_char,
6066+
mode: ::mode_t,
6067+
dev: dev_t,
6068+
) -> ::c_int;
6069+
pub fn freadlink(fd: ::c_int, buf: *mut ::c_char, size: ::size_t) -> ::c_int;
60616070
}
60626071

60636072
pub unsafe fn mach_task_self() -> ::mach_port_t {

0 commit comments

Comments
 (0)