From: Peter Lundkvist Date: Sun, 23 Jan 2022 10:25:04 +0000 (+0100) Subject: procd: seccomp/jail: Fix build error on arm with glibc X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cb0031c47b9d46f3cf84daa90d484af5f9c90e31;p=project%2Fprocd.git procd: seccomp/jail: Fix build error on arm with glibc This fixes the make_syscall_h.sh script to recognize both __NR_Linux, used by mips, and __NR_SYSCALL_BASE and __ARM_NR_BASE used by arm. Run-tested on arm (ipq806x) and mips (ath79), both with glibc. Compile-tested and checked resulting syscall_names.h file wuth glibc: aarch64, powerpc, x86_64, i486 musl: arm, mips Fixes: FS#4194, FS#4195 Signed-off-by: Peter Lundkvist --- diff --git a/make_syscall_h.sh b/make_syscall_h.sh index 18d9131..17e3bc4 100755 --- a/make_syscall_h.sh +++ b/make_syscall_h.sh @@ -13,11 +13,11 @@ CC=$1 echo "#include " echo "static const char *__syscall_names[] = {" -echo "#include " | ${CC} -E -dM - | grep '^#define __NR_' | \ - LC_ALL=C sed -r -n -e 's/^\#define[ \t]+__NR_([a-z0-9_]+)[ \t]+([ ()+0-9a-zNR_Linux]+)(.*)/ [\2] = "\1",/p' +echo "#include " | ${CC} -E -dM - | grep '^#define __NR_[a-z0-9_]\+[ \t].*[0-9].*$' | \ + LC_ALL=C sed -r -n -e 's/^\#define[ \t]+__NR_([a-z0-9_]+)[ \t]+([ ()+0-9a-zNR_LSYCABE]+)(.*)/ [\2] = "\1",/p' echo "};" -extra_syscalls="$(echo "#include " | ${CC} -E -dM - | sed -n -e '/^#define __ARM_NR_/ s///p')" +extra_syscalls="$(echo "#include " | ${CC} -E -dM - | sed -r -n -e 's/^#define __ARM_NR_([a-z0-9_]+)/\1/p')" cat <