Skip to content

Commit 432151f

Browse files
committed
Auto merge of #2403 - skrap:master, r=Amanieu
uclibc: fix semver files, add misc symbols This commit gets uclibc support working again, and fixes the semver lists to segregate gnu- and musl- specific symbols to those libc variants. There is a [separate PR](rust-lang/rust#88952) against rust itself to add armv7-unknown-linux-uclibceabihf as a tier 3 platform, and this commit is in support of that effort. Until that's done, we should not use the CI for that platform, but I'm including the CI file here in anticipation of turning it on in the not-too-distant future.
2 parents 971fde3 + 6a12326 commit 432151f

File tree

13 files changed

+350
-135
lines changed

13 files changed

+350
-135
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu:20.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
gcc libc6-dev qemu-user ca-certificates qemu-system-arm curl \
5+
xz-utils patch
6+
7+
RUN mkdir /toolchain
8+
9+
RUN curl --retry 5 -L https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2020.08-1.tar.bz2 | \
10+
tar xjf - -C /toolchain --strip-components=1
11+
RUN /toolchain/relocate-sdk.sh
12+
13+
ENV PATH=$PATH:/rust/bin:/toolchain/bin \
14+
STAGING_DIR=/toolchain/armv7-buildroot-linux-uclibceabihf/sysroot \
15+
CC_armv7_unknown_linux_uclibc=armv7-buildroot-linux-uclibc-gcc \
16+
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_LINKER=armv7-buildroot-linux-uclibc-gcc \
17+
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_RUNNER="qemu-arm -L /toolchain/arm-buildroot-linux-uclibcgnueabihf/sysroot/"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM ubuntu:20.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
gcc libc6-dev qemu-user ca-certificates qemu-system-mipsel curl \
5+
xz-utils patch
6+
7+
RUN mkdir /toolchain
8+
9+
# binutils 2.33.1
10+
# gcc 9.3.0
11+
# gdb 8.3.1
12+
# linux-headers 4.9.234
13+
# uclibc 1.0.34
14+
RUN curl --retry 5 -L https://toolchains.bootlin.com/downloads/releases/toolchains/mips32el/tarballs/mips32el--uclibc--stable-2020.08-1.tar.bz2 | \
15+
tar xjf - -C /toolchain --strip-components=1
16+
RUN /toolchain/relocate-sdk.sh
17+
18+
ENV PATH=$PATH:/rust/bin:/toolchain/bin \
19+
STAGING_DIR=/toolchain/mipsel-buildroot-linux-uclibc/sysroot \
20+
CC_mipsel_unknown_linux_uclibc=mipsel-buildroot-linux-uclibc-gcc \
21+
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_UCLIBC_LINKER=mipsel-buildroot-linux-uclibc-gcc \
22+
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_UCLIBC_RUNNER="qemu-mipsel -L /toolchain/mipsel-buildroot-linux-uclibc/sysroot/"

libc-test/build.rs

+31
Original file line numberDiff line numberDiff line change
@@ -2852,6 +2852,34 @@ fn test_linux(target: &str) {
28522852
| "SW_CNT"
28532853
if mips || ppc64 || riscv64 || sparc64 => true,
28542854

2855+
// kernel constants not available in uclibc 1.0.34
2856+
| "ADDR_COMPAT_LAYOUT"
2857+
| "ADDR_LIMIT_3GB"
2858+
| "ADDR_NO_RANDOMIZE"
2859+
| "CLONE_NEWCGROUP"
2860+
| "EXTPROC"
2861+
| "FAN_MARK_FILESYSTEM"
2862+
| "FAN_MARK_INODE"
2863+
| "IPPROTO_BEETPH"
2864+
| "IPPROTO_MPLS"
2865+
| "IPV6_HDRINCL"
2866+
| "IPV6_MULTICAST_ALL"
2867+
| "IPV6_PMTUDISC_INTERFACE"
2868+
| "IPV6_PMTUDISC_OMIT"
2869+
| "IPV6_ROUTER_ALERT_ISOLATE"
2870+
| "O_TMPFILE"
2871+
| "PACKET_MR_UNICAST"
2872+
| "PTRACE_EVENT_STOP"
2873+
| "PTRACE_O_EXITKILL"
2874+
| "PTRACE_O_SUSPEND_SECCOMP"
2875+
| "PTRACE_PEEKSIGINFO"
2876+
| "READ_IMPLIES_EXEC"
2877+
| "RUSAGE_THREAD"
2878+
| "SHM_EXEC"
2879+
| "UDP_GRO"
2880+
| "UDP_SEGMENT"
2881+
if uclibc => true,
2882+
28552883
_ => false,
28562884
}
28572885
});
@@ -2929,6 +2957,9 @@ fn test_linux(target: &str) {
29292957

29302958
"reallocarray" if musl => true,
29312959

2960+
// Not defined in uclibc as of 1.0.34
2961+
"gettid" if uclibc => true,
2962+
29322963
_ => false,
29332964
}
29342965
});

libc-test/semver/linux-gnu.txt

+35-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ ADJ_TICK
1515
ADJ_TIMECONST
1616
AFFS_SUPER_MAGIC
1717
AFS_SUPER_MAGIC
18+
AF_MPLS
19+
AF_XDP
20+
AIO_ALLDONE
21+
AIO_CANCELED
22+
AIO_NOTCANCELED
1823
AT_STATX_DONT_SYNC
1924
AT_STATX_FORCE_SYNC
2025
AT_STATX_SYNC_AS_STAT
@@ -54,6 +59,8 @@ EMPTY
5459
EXT2_SUPER_MAGIC
5560
EXT3_SUPER_MAGIC
5661
EXT4_SUPER_MAGIC
62+
Elf32_Chdr
63+
Elf64_Chdr
5764
F2FS_SUPER_MAGIC
5865
FDPIC_FUNCPTRS
5966
FUTEXFS_SUPER_MAGIC
@@ -111,6 +118,11 @@ LC_PAPER
111118
LC_PAPER_MASK
112119
LC_TELEPHONE
113120
LC_TELEPHONE_MASK
121+
LIO_NOP
122+
LIO_NOWAIT
123+
LIO_READ
124+
LIO_WAIT
125+
LIO_WRITE
114126
LM_ID_BASE
115127
LM_ID_NEWLM
116128
LOGIN_PROCESS
@@ -316,6 +328,9 @@ OLD_TIME
316328
OPENPROM_SUPER_MAGIC
317329
OVERLAYFS_SUPER_MAGIC
318330
O_FSYNC
331+
PF_IB
332+
PF_MPLS
333+
PF_XDP
319334
PROC_SUPER_MAGIC
320335
PTHREAD_MUTEX_ADAPTIVE_NP
321336
QNX4_SUPER_MAGIC
@@ -524,6 +539,14 @@ __priority_which_t
524539
__rlimit_resource_t
525540
__timeval
526541
adjtimex
542+
aio_cancel
543+
aio_error
544+
aio_fsync
545+
aio_read
546+
aio_return
547+
aio_suspend
548+
aio_write
549+
aiocb
527550
backtrace
528551
clock_adjtime
529552
copy_file_range
@@ -532,7 +555,10 @@ dlmopen
532555
endutxent
533556
explicit_bzero
534557
fgetspent_r
558+
futimes
559+
getauxval
535560
getgrent_r
561+
getloadavg
536562
getpt
537563
getpwent_r
538564
getpwnam_r
@@ -541,11 +567,12 @@ getutxent
541567
getutxid
542568
getutxline
543569
glob
570+
glob_t
544571
glob64
545572
glob64_t
546-
glob_t
547573
globfree
548574
globfree64
575+
lio_listio
549576
mallinfo
550577
mallinfo2
551578
malloc_info
@@ -557,7 +584,13 @@ nl_pktinfo
557584
ntp_adjtime
558585
ntp_gettime
559586
ntptimeval
587+
open_wmemstream
560588
preadv2
589+
preadv64
590+
prlimit
591+
prlimit64
592+
process_vm_readv
593+
process_vm_writev
561594
pthread_attr_getaffinity_np
562595
pthread_attr_setaffinity_np
563596
pthread_getname_np
@@ -567,6 +600,7 @@ pthread_rwlockattr_setkind_np
567600
pthread_setname_np
568601
pututxline
569602
pwritev2
603+
pwritev64
570604
qsort_r
571605
reallocarray
572606
semid_ds

libc-test/semver/linux-musl.txt

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,42 @@
11
# TODO: musl.
2+
AF_IB
3+
AF_MPLS
4+
AF_XDP
5+
AIO_ALLDONE
6+
AIO_CANCELED
7+
AIO_NOTCANCELED
8+
Elf32_Chdr
9+
Elf64_Chdr
10+
LIO_NOP
11+
LIO_NOWAIT
12+
LIO_READ
13+
LIO_WAIT
14+
LIO_WRITE
15+
PF_IB
16+
PF_MPLS
17+
PF_XDP
218
adjtimex
19+
aio_cancel
20+
aio_error
21+
aio_fsync
22+
aio_read
23+
aio_return
24+
aio_suspend
25+
aio_write
26+
aiocb
327
clock_adjtime
428
explicit_bzero
29+
futimes
30+
getauxval
31+
getloadavg
32+
lio_listio
533
ntptimeval
34+
open_wmemstream
35+
preadv64
36+
prlimit
37+
prlimit64
38+
process_vm_readv
39+
process_vm_writev
40+
pwritev64
641
reallocarray
742
timex
8-

libc-test/semver/linux.txt

-35
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ AF_CAIF
3535
AF_CAN
3636
AF_DECnet
3737
AF_ECONET
38-
AF_IB
3938
AF_IEEE802154
4039
AF_IPX
4140
AF_IRDA
@@ -44,7 +43,6 @@ AF_IUCV
4443
AF_KEY
4544
AF_LLC
4645
AF_LOCAL
47-
AF_MPLS
4846
AF_NETBEUI
4947
AF_NETLINK
5048
AF_NETROM
@@ -62,10 +60,6 @@ AF_TIPC
6260
AF_VSOCK
6361
AF_WANPIPE
6462
AF_X25
65-
AF_XDP
66-
AIO_ALLDONE
67-
AIO_CANCELED
68-
AIO_NOTCANCELED
6963
AI_ADDRCONFIG
7064
AI_ALL
7165
AI_CANONNAME
@@ -513,7 +507,6 @@ EXTA
513507
EXTB
514508
EXTPROC
515509
Elf32_Addr
516-
Elf32_Chdr
517510
Elf32_Ehdr
518511
Elf32_Half
519512
Elf32_Off
@@ -523,7 +516,6 @@ Elf32_Shdr
523516
Elf32_Sym
524517
Elf32_Word
525518
Elf64_Addr
526-
Elf64_Chdr
527519
Elf64_Ehdr
528520
Elf64_Half
529521
Elf64_Off
@@ -1050,11 +1042,6 @@ LINUX_REBOOT_MAGIC2
10501042
LINUX_REBOOT_MAGIC2A
10511043
LINUX_REBOOT_MAGIC2B
10521044
LINUX_REBOOT_MAGIC2C
1053-
LIO_NOP
1054-
LIO_NOWAIT
1055-
LIO_READ
1056-
LIO_WAIT
1057-
LIO_WRITE
10581045
LOG_AUTHPRIV
10591046
LOG_CRON
10601047
LOG_FTP
@@ -1483,7 +1470,6 @@ PF_CAIF
14831470
PF_CAN
14841471
PF_DECnet
14851472
PF_ECONET
1486-
PF_IB
14871473
PF_IEEE802154
14881474
PF_IPX
14891475
PF_IRDA
@@ -1492,7 +1478,6 @@ PF_IUCV
14921478
PF_KEY
14931479
PF_LLC
14941480
PF_LOCAL
1495-
PF_MPLS
14961481
PF_NETBEUI
14971482
PF_NETLINK
14981483
PF_NETROM
@@ -1510,7 +1495,6 @@ PF_TIPC
15101495
PF_VSOCK
15111496
PF_WANPIPE
15121497
PF_X25
1513-
PF_XDP
15141498
PIPE_BUF
15151499
PM_STR
15161500
POLLRDBAND
@@ -2643,14 +2627,6 @@ accept4
26432627
acct
26442628
addmntent
26452629
af_alg_iv
2646-
aio_cancel
2647-
aio_error
2648-
aio_fsync
2649-
aio_read
2650-
aio_return
2651-
aio_suspend
2652-
aio_write
2653-
aiocb
26542630
arpd_request
26552631
arphdr
26562632
arpreq
@@ -2741,9 +2717,7 @@ fstatvfs64
27412717
ftello64
27422718
ftok
27432719
ftruncate64
2744-
futimes
27452720
genlmsghdr
2746-
getauxval
27472721
getdomainname
27482722
getdtablesize
27492723
getgrent
@@ -2755,7 +2729,6 @@ getgrouplist
27552729
gethostid
27562730
getifaddrs
27572731
getline
2758-
getloadavg
27592732
getmntent
27602733
getnameinfo
27612734
getpriority
@@ -2805,7 +2778,6 @@ key_t
28052778
killpg
28062779
labs
28072780
lgetxattr
2808-
lio_listio
28092781
listxattr
28102782
llistxattr
28112783
lockf
@@ -2866,7 +2838,6 @@ nlmsghdr
28662838
off64_t
28672839
open64
28682840
open_memstream
2869-
open_wmemstream
28702841
openat
28712842
openat64
28722843
openpty
@@ -2907,11 +2878,6 @@ ppoll
29072878
prctl
29082879
pread64
29092880
preadv
2910-
preadv64
2911-
prlimit
2912-
prlimit64
2913-
process_vm_readv
2914-
process_vm_writev
29152881
pthread_attr_getguardsize
29162882
pthread_attr_getstack
29172883
pthread_cancel
@@ -2941,7 +2907,6 @@ ptrace
29412907
ptsname_r
29422908
pwrite64
29432909
pwritev
2944-
pwritev64
29452910
qsort
29462911
quotactl
29472912
rand

0 commit comments

Comments
 (0)