Skip to content

Commit

Permalink
Auto merge of #2403 - skrap:master, r=Amanieu
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Sep 24, 2021
2 parents 8a7e251 + 95656b9 commit 372a8c6
Show file tree
Hide file tree
Showing 15 changed files with 356 additions and 179 deletions.
17 changes: 17 additions & 0 deletions ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:20.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-arm curl \
xz-utils patch

RUN mkdir /toolchain

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 | \
tar xjf - -C /toolchain --strip-components=1
RUN /toolchain/relocate-sdk.sh

ENV PATH=$PATH:/rust/bin:/toolchain/bin \
STAGING_DIR=/toolchain/armv7-buildroot-linux-uclibceabihf/sysroot \
CC_armv7_unknown_linux_uclibc=armv7-buildroot-linux-uclibc-gcc \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_LINKER=armv7-buildroot-linux-uclibc-gcc \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_RUNNER="qemu-arm -L /toolchain/arm-buildroot-linux-uclibcgnueabihf/sysroot/"
22 changes: 22 additions & 0 deletions ci/docker/mipsel-unknown-linux-uclibc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu:20.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-mipsel curl \
xz-utils patch

RUN mkdir /toolchain

# binutils 2.33.1
# gcc 9.3.0
# gdb 8.3.1
# linux-headers 4.9.234
# uclibc 1.0.34
RUN curl --retry 5 -L https://toolchains.bootlin.com/downloads/releases/toolchains/mips32el/tarballs/mips32el--uclibc--stable-2020.08-1.tar.bz2 | \
tar xjf - -C /toolchain --strip-components=1
RUN /toolchain/relocate-sdk.sh

ENV PATH=$PATH:/rust/bin:/toolchain/bin \
STAGING_DIR=/toolchain/mipsel-buildroot-linux-uclibc/sysroot \
CC_mipsel_unknown_linux_uclibc=mipsel-buildroot-linux-uclibc-gcc \
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_UCLIBC_LINKER=mipsel-buildroot-linux-uclibc-gcc \
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_UCLIBC_RUNNER="qemu-mipsel -L /toolchain/mipsel-buildroot-linux-uclibc/sysroot/"
31 changes: 31 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,34 @@ fn test_linux(target: &str) {
| "SW_CNT"
if mips || ppc64 || riscv64 || sparc64 => true,

// kernel constants not available in uclibc 1.0.34
| "ADDR_COMPAT_LAYOUT"
| "ADDR_LIMIT_3GB"
| "ADDR_NO_RANDOMIZE"
| "CLONE_NEWCGROUP"
| "EXTPROC"
| "FAN_MARK_FILESYSTEM"
| "FAN_MARK_INODE"
| "IPPROTO_BEETPH"
| "IPPROTO_MPLS"
| "IPV6_HDRINCL"
| "IPV6_MULTICAST_ALL"
| "IPV6_PMTUDISC_INTERFACE"
| "IPV6_PMTUDISC_OMIT"
| "IPV6_ROUTER_ALERT_ISOLATE"
| "O_TMPFILE"
| "PACKET_MR_UNICAST"
| "PTRACE_EVENT_STOP"
| "PTRACE_O_EXITKILL"
| "PTRACE_O_SUSPEND_SECCOMP"
| "PTRACE_PEEKSIGINFO"
| "READ_IMPLIES_EXEC"
| "RUSAGE_THREAD"
| "SHM_EXEC"
| "UDP_GRO"
| "UDP_SEGMENT"
if uclibc => true,

_ => false,
}
});
Expand Down Expand Up @@ -2944,6 +2972,9 @@ fn test_linux(target: &str) {

"reallocarray" if musl => true,

// Not defined in uclibc as of 1.0.34
"gettid" if uclibc => true,

_ => false,
}
});
Expand Down
36 changes: 35 additions & 1 deletion libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ ADJ_TICK
ADJ_TIMECONST
AFFS_SUPER_MAGIC
AFS_SUPER_MAGIC
AF_MPLS
AF_XDP
AIO_ALLDONE
AIO_CANCELED
AIO_NOTCANCELED
AT_STATX_DONT_SYNC
AT_STATX_FORCE_SYNC
AT_STATX_SYNC_AS_STAT
Expand Down Expand Up @@ -54,6 +59,8 @@ EMPTY
EXT2_SUPER_MAGIC
EXT3_SUPER_MAGIC
EXT4_SUPER_MAGIC
Elf32_Chdr
Elf64_Chdr
F2FS_SUPER_MAGIC
FDPIC_FUNCPTRS
FUTEXFS_SUPER_MAGIC
Expand Down Expand Up @@ -111,6 +118,11 @@ LC_PAPER
LC_PAPER_MASK
LC_TELEPHONE
LC_TELEPHONE_MASK
LIO_NOP
LIO_NOWAIT
LIO_READ
LIO_WAIT
LIO_WRITE
LM_ID_BASE
LM_ID_NEWLM
LOGIN_PROCESS
Expand Down Expand Up @@ -316,6 +328,9 @@ OLD_TIME
OPENPROM_SUPER_MAGIC
OVERLAYFS_SUPER_MAGIC
O_FSYNC
PF_IB
PF_MPLS
PF_XDP
PROC_SUPER_MAGIC
PTHREAD_MUTEX_ADAPTIVE_NP
QNX4_SUPER_MAGIC
Expand Down Expand Up @@ -524,6 +539,14 @@ __priority_which_t
__rlimit_resource_t
__timeval
adjtimex
aio_cancel
aio_error
aio_fsync
aio_read
aio_return
aio_suspend
aio_write
aiocb
backtrace
clock_adjtime
copy_file_range
Expand All @@ -532,7 +555,10 @@ dlmopen
endutxent
explicit_bzero
fgetspent_r
futimes
getauxval
getgrent_r
getloadavg
getpt
getpwent_r
getpwnam_r
Expand All @@ -541,11 +567,12 @@ getutxent
getutxid
getutxline
glob
glob_t
glob64
glob64_t
glob_t
globfree
globfree64
lio_listio
mallinfo
mallinfo2
malloc_info
Expand All @@ -557,7 +584,13 @@ nl_pktinfo
ntp_adjtime
ntp_gettime
ntptimeval
open_wmemstream
preadv2
preadv64
prlimit
prlimit64
process_vm_readv
process_vm_writev
pthread_attr_getaffinity_np
pthread_attr_setaffinity_np
pthread_getname_np
Expand All @@ -567,6 +600,7 @@ pthread_rwlockattr_setkind_np
pthread_setname_np
pututxline
pwritev2
pwritev64
qsort_r
reallocarray
semid_ds
Expand Down
36 changes: 35 additions & 1 deletion libc-test/semver/linux-musl.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
# TODO: musl.
AF_IB
AF_MPLS
AF_XDP
AIO_ALLDONE
AIO_CANCELED
AIO_NOTCANCELED
Elf32_Chdr
Elf64_Chdr
LIO_NOP
LIO_NOWAIT
LIO_READ
LIO_WAIT
LIO_WRITE
PF_IB
PF_MPLS
PF_XDP
adjtimex
aio_cancel
aio_error
aio_fsync
aio_read
aio_return
aio_suspend
aio_write
aiocb
clock_adjtime
explicit_bzero
futimes
getauxval
getloadavg
lio_listio
ntptimeval
open_wmemstream
preadv64
prlimit
prlimit64
process_vm_readv
process_vm_writev
pwritev64
reallocarray
timex

35 changes: 0 additions & 35 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ AF_CAIF
AF_CAN
AF_DECnet
AF_ECONET
AF_IB
AF_IEEE802154
AF_IPX
AF_IRDA
Expand All @@ -44,7 +43,6 @@ AF_IUCV
AF_KEY
AF_LLC
AF_LOCAL
AF_MPLS
AF_NETBEUI
AF_NETLINK
AF_NETROM
Expand All @@ -62,10 +60,6 @@ AF_TIPC
AF_VSOCK
AF_WANPIPE
AF_X25
AF_XDP
AIO_ALLDONE
AIO_CANCELED
AIO_NOTCANCELED
AI_ADDRCONFIG
AI_ALL
AI_CANONNAME
Expand Down Expand Up @@ -513,7 +507,6 @@ EXTA
EXTB
EXTPROC
Elf32_Addr
Elf32_Chdr
Elf32_Ehdr
Elf32_Half
Elf32_Off
Expand All @@ -523,7 +516,6 @@ Elf32_Shdr
Elf32_Sym
Elf32_Word
Elf64_Addr
Elf64_Chdr
Elf64_Ehdr
Elf64_Half
Elf64_Off
Expand Down Expand Up @@ -1050,11 +1042,6 @@ LINUX_REBOOT_MAGIC2
LINUX_REBOOT_MAGIC2A
LINUX_REBOOT_MAGIC2B
LINUX_REBOOT_MAGIC2C
LIO_NOP
LIO_NOWAIT
LIO_READ
LIO_WAIT
LIO_WRITE
LOG_AUTHPRIV
LOG_CRON
LOG_FTP
Expand Down Expand Up @@ -1483,7 +1470,6 @@ PF_CAIF
PF_CAN
PF_DECnet
PF_ECONET
PF_IB
PF_IEEE802154
PF_IPX
PF_IRDA
Expand All @@ -1492,7 +1478,6 @@ PF_IUCV
PF_KEY
PF_LLC
PF_LOCAL
PF_MPLS
PF_NETBEUI
PF_NETLINK
PF_NETROM
Expand All @@ -1510,7 +1495,6 @@ PF_TIPC
PF_VSOCK
PF_WANPIPE
PF_X25
PF_XDP
PIPE_BUF
PM_STR
POLLRDBAND
Expand Down Expand Up @@ -2643,14 +2627,6 @@ accept4
acct
addmntent
af_alg_iv
aio_cancel
aio_error
aio_fsync
aio_read
aio_return
aio_suspend
aio_write
aiocb
arpd_request
arphdr
arpreq
Expand Down Expand Up @@ -2741,9 +2717,7 @@ fstatvfs64
ftello64
ftok
ftruncate64
futimes
genlmsghdr
getauxval
getdomainname
getdtablesize
getgrent
Expand All @@ -2755,7 +2729,6 @@ getgrouplist
gethostid
getifaddrs
getline
getloadavg
getmntent
getnameinfo
getpriority
Expand Down Expand Up @@ -2805,7 +2778,6 @@ key_t
killpg
labs
lgetxattr
lio_listio
listxattr
llistxattr
lockf
Expand Down Expand Up @@ -2866,7 +2838,6 @@ nlmsghdr
off64_t
open64
open_memstream
open_wmemstream
openat
openat64
openpty
Expand Down Expand Up @@ -2907,11 +2878,6 @@ ppoll
prctl
pread64
preadv
preadv64
prlimit
prlimit64
process_vm_readv
process_vm_writev
pthread_attr_getguardsize
pthread_attr_getstack
pthread_cancel
Expand Down Expand Up @@ -2941,7 +2907,6 @@ ptrace
ptsname_r
pwrite64
pwritev
pwritev64
qsort
quotactl
rand
Expand Down
Loading

0 comments on commit 372a8c6

Please sign in to comment.