Skip to content

Commit 1b93184

Browse files
Merge branch 'main' into missing-freebsd-items
2 parents 560c090 + a0587c8 commit 1b93184

File tree

27 files changed

+1186
-117
lines changed

27 files changed

+1186
-117
lines changed
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
FROM ubuntu:24.10
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
4-
ca-certificates curl gcc git libc6-dev make qemu-user xz-utils
4+
ca-certificates curl gcc gcc-14-loongarch64-linux-gnu git libc6-dev \
5+
make qemu-user xz-utils patch rsync
56

6-
COPY install-musl-cross.sh /
7-
RUN /install-musl-cross.sh loongarch64-unknown-linux-musl
7+
COPY install-musl.sh /
8+
RUN /install-musl.sh loongarch64
89

9-
ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc \
10+
ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
1011
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-loongarch64" \
11-
CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \
12+
CC_loongarch64_unknown_linux_musl=musl-gcc \
1213
CFLAGS_loongarch64_unknown_linux_musl="-mabi=lp64d -fPIC" \
13-
QEMU_LD_PREFIX=/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot \
14-
PATH=$PATH:/loongarch64-unknown-linux-musl/bin:/rust/bin
14+
RUSTFLAGS="-Ctarget-feature=+crt-static" \
15+
QEMU_LD_PREFIX=/musl-loongarch64 \
16+
PATH=$PATH:/musl-loongarch64/bin:/rust/bin

ci/install-musl-cross.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

ci/install-musl.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55

66
set -eux
77

8-
musl_version=1.1.24
8+
case ${1} in
9+
loongarch64)
10+
musl_version=1.2.5
11+
;;
12+
*)
13+
musl_version=1.1.24
14+
;;
15+
esac
16+
917
musl="musl-${musl_version}"
1018

1119
# Download, configure, build, and install musl:
@@ -53,6 +61,13 @@ case ${1} in
5361
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
5462
make install -j4
5563
;;
64+
loongarch64)
65+
musl_arch=loongarch64
66+
kernel_arch=loongarch
67+
CC=loongarch64-linux-gnu-gcc-14 \
68+
./configure --prefix="/musl-${musl_arch}" --enable-wrapper=yes
69+
make install -j4
70+
;;
5671
*)
5772
echo "Unknown target arch: \"${1}\""
5873
exit 1

libc-test/build.rs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn src_hotfix_dir() -> PathBuf {
1313

1414
fn do_cc() {
1515
let target = env::var("TARGET").unwrap();
16-
if cfg!(unix) {
16+
if cfg!(unix) || target.contains("cygwin") {
1717
let exclude = ["redox", "wasi", "wali"];
1818
if !exclude.iter().any(|x| target.contains(x)) {
1919
let mut cmsg = cc::Build::new();
@@ -656,6 +656,7 @@ fn test_cygwin(target: &str) {
656656
"dlfcn.h",
657657
"errno.h",
658658
"fcntl.h",
659+
"fnmatch.h",
659660
"grp.h",
660661
"iconv.h",
661662
"langinfo.h",
@@ -666,11 +667,13 @@ fn test_cygwin(target: &str) {
666667
"netinet/tcp.h",
667668
"poll.h",
668669
"pthread.h",
670+
"pty.h",
669671
"pwd.h",
670672
"resolv.h",
671673
"sched.h",
672674
"semaphore.h",
673675
"signal.h",
676+
"spawn.h",
674677
"stddef.h",
675678
"stdlib.h",
676679
"string.h",
@@ -690,6 +693,7 @@ fn test_cygwin(target: &str) {
690693
"sys/uio.h",
691694
"sys/un.h",
692695
"sys/utsname.h",
696+
"sys/vfs.h",
693697
"syslog.h",
694698
"termios.h",
695699
"unistd.h",
@@ -809,7 +813,7 @@ fn test_cygwin(target: &str) {
809813
}
810814
});
811815

812-
cfg.generate("../src/lib.rs", "main.rs");
816+
cfg.generate(src_hotfix_dir().join("lib.rs"), "main.rs");
813817
}
814818

815819
fn test_windows(target: &str) {
@@ -998,6 +1002,13 @@ fn test_solarish(target: &str) {
9981002
cfg.define("__EXTENSIONS__", None);
9991003
cfg.define("_LCONV_C99", None);
10001004

1005+
// FIXME(solaris): This should be removed once new Nix crate is released.
1006+
// See comment in src/unix/solarish/solaris.rs for these.
1007+
if is_solaris {
1008+
cfg.define("O_DIRECT", Some("0x2000000"));
1009+
cfg.define("SIGINFO", Some("41"));
1010+
}
1011+
10011012
headers! {
10021013
cfg:
10031014
"aio.h",
@@ -1253,6 +1264,10 @@ fn test_solarish(target: &str) {
12531264
// https://github.com/gnzlbg/ctest/issues/68
12541265
"lio_listio" => true,
12551266

1267+
// Exists on illumos too but, for now, is
1268+
// [a recent addition](https://www.illumos.org/issues/17094).
1269+
"secure_getenv" if is_illumos => true,
1270+
12561271
_ => false,
12571272
}
12581273
});
@@ -4064,8 +4079,7 @@ fn test_linux(target: &str) {
40644079
"epoll_params" => true,
40654080

40664081
// FIXME(linux): Requires >= 6.12 kernel headers.
4067-
"dmabuf_cmsg" |
4068-
"dmabuf_token" => true,
4082+
"dmabuf_cmsg" | "dmabuf_token" => true,
40694083

40704084
_ => false,
40714085
}

libc-test/semver/android.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,8 +1793,11 @@ NLMSG_MIN_TYPE
17931793
NLMSG_NOOP
17941794
NLMSG_OVERRUN
17951795
NLM_F_ACK
1796+
NLM_F_ACK_TLVS
17961797
NLM_F_APPEND
17971798
NLM_F_ATOMIC
1799+
NLM_F_BULK
1800+
NLM_F_CAPPED
17981801
NLM_F_CREATE
17991802
NLM_F_DUMP
18001803
NLM_F_DUMP_FILTERED
@@ -1803,6 +1806,7 @@ NLM_F_ECHO
18031806
NLM_F_EXCL
18041807
NLM_F_MATCH
18051808
NLM_F_MULTI
1809+
NLM_F_NONREC
18061810
NLM_F_REPLACE
18071811
NLM_F_REQUEST
18081812
NLM_F_ROOT
@@ -2222,10 +2226,16 @@ SCM_CREDENTIALS
22222226
SCM_RIGHTS
22232227
SCM_TIMESTAMP
22242228
SCM_TIMESTAMPING
2229+
SECCOMP_ADDFD_FLAG_SEND
2230+
SECCOMP_ADDFD_FLAG_SETFD
22252231
SECCOMP_FILTER_FLAG_LOG
22262232
SECCOMP_FILTER_FLAG_NEW_LISTENER
22272233
SECCOMP_FILTER_FLAG_SPEC_ALLOW
22282234
SECCOMP_FILTER_FLAG_TSYNC
2235+
SECCOMP_FILTER_FLAG_TSYNC_ESRCH
2236+
SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV
2237+
SECCOMP_GET_ACTION_AVAIL
2238+
SECCOMP_GET_NOTIF_SIZES
22292239
SECCOMP_MODE_DISABLED
22302240
SECCOMP_MODE_FILTER
22312241
SECCOMP_MODE_STRICT
@@ -2241,6 +2251,9 @@ SECCOMP_RET_LOG
22412251
SECCOMP_RET_TRACE
22422252
SECCOMP_RET_TRAP
22432253
SECCOMP_RET_USER_NOTIF
2254+
SECCOMP_SET_MODE_FILTER
2255+
SECCOMP_SET_MODE_STRICT
2256+
SECCOMP_USER_NOTIF_FLAG_CONTINUE
22442257
SEEK_CUR
22452258
SEEK_DATA
22462259
SEEK_END
@@ -3325,6 +3338,7 @@ fwrite_unlocked
33253338
gai_strerror
33263339
genlmsghdr
33273340
getaddrinfo
3341+
getauxval
33283342
getchar
33293343
getchar_unlocked
33303344
getcwd

0 commit comments

Comments
 (0)