[PATCH] s390[x]: cleanup syscall list
Christian Seiler <[email protected]> Sun, 31 Jan 2016 13:33:18 +0100
| Newsgroups | gmane.linux.lib.dietlibc |
|---|---|
| Message-ID | <[email protected]> |
Hi,
A package of mine in Debian that links against dietlibc fails to build
on s390x because 'getdents64' is not defined there in dietlibc [1].
But if you look at arch/s390/include/uapi/linux/unistd.h in the kernel
source tree, you will see that getdents64 is defined for s390x. After
looking a bit at the git history of that file, the very first import of
that file into git 10 years ago already contained getdents64 - but it
also appears to be the case that the version in dietlibc is based on an
even older version of that file and thus #undefs the getdents64 call.
I've thus gone through s390/syscalls.h and s390x/syscalls.h and cleaned
up the syscall list: I've gotten rid of all of the #undefs (in dietlibc
there are two separate files anyway, so no #ifdeffery needed), and have
added all system calls up to __NR_memfd_create that were missing from
dietlibc for both architectures. (I haven't done newer ones because no
architecture in dietlibc supports these, so that would probably be a
separate change.) This should sync up the list of system calls for both
architectures with the current Linux kernel.
Caveat: I don't have access to neither s390 nor s390x myself, so I have
only tested this insofar as that I've run the C preprocessor against
both the upstream kernel version and the dietlibc version and seen that
the resulting system call list (for all calls <= memfd_create) is now
identical. [2]
Patch can be found under:
https://gist.githubusercontent.com/chris-se/722bae58755951b7a7dd/raw/9a9de8bc7ea6725557f18be026434dfa390c127d/s390_syscalls.patch
Regards,
Christian
[1] For reference, the build log:
https://buildd.debian.org/status/fetch.php?pkg=tiny-initramfs&arch=s390x&ver=0.1-1&stamp=1453981123
[2]
gcc -D__s390__ -E -dM -o- s390/syscalls.h | awk '$3 <= 350 { print; }' | sort -n | grep 'define __NR' > s390-this.list
gcc -D__s390__ -E -dM -o- $LINUXSRC/arch/s390/include/uapi/asm/unistd.h | awk '$3 <= 350 { print; }' | sort -n | grep 'define __NR' > s390-orig.list
gcc -D__s390x__ -E -dM -o- s390x/syscalls.h | awk '$3 <= 350 { print; }' | sort -n | grep 'define __NR' > s390x-this.list
gcc -D__s390x__ -E -dM -o- $LINUXSRC/arch/s390/include/uapi/asm/unistd.h | awk '$3 <= 350 { print; }' | sort -n | grep 'define __NR' > s390x-orig.list
diff -u s390-orig.list s390-this.list
diff -u s390x-orig.list s390x-this.list