sudo-project/sudo

error: 'NT_ARM_SYSTEM_CALL' undeclared (first use in this function)

hxily opened this issue · 3 comments

hxily commented

Hello, I try to building packages on centos 7.9.2009(4.18.0-193.28.1.el7.aarch64),and is failed,

log:

In file included from ./exec_ptrace.c:59:0:
./exec_ptrace.c: In function 'set_syscallno':
./exec_ptrace.h:98:35: error: 'NT_ARM_SYSTEM_CALL' undeclared (first use in this function)
ptrace(PTRACE_SETREGSET, pid, NT_ARM_SYSTEM_CALL, &_iov);
^
./exec_ptrace.h:333:42: note: in expansion of macro 'reg_set_syscall'
# define compat_reg_set_syscall(_r, _nr) reg_set_syscall(_r, _nr)
^
./exec_ptrace.c:110:2: note: in expansion of macro 'compat_reg_set_syscall'
compat_reg_set_syscall(regs->u.compat, syscallno);
^
./exec_ptrace.h:98:35: note: each undeclared identifier is reported only once for each function it appears in
ptrace(PTRACE_SETREGSET, pid, NT_ARM_SYSTEM_CALL, &_iov);
^
./exec_ptrace.h:333:42: note: in expansion of macro 'reg_set_syscall'
# define compat_reg_set_syscall(_r, _nr) reg_set_syscall(_r, _nr)
^
./exec_ptrace.c:110:2: note: in expansion of macro 'compat_reg_set_syscall'
compat_reg_set_syscall(regs->u.compat, syscallno);
^
gcc -std=gnu11 -c -I../include -I.. -I. -I. -D_PATH_SUDO_CONF="/etc/sudo.conf" -DLOCALEDIR="/usr/share/locale" -DZLIB_CONST -D_FORTIFY_SOURCE=2 -g -O2 -fvisibility=hidden -fPIE -fstack-protector-strong -fstack-clash-protection ./load_plugins.c
gcc -std=gnu11 -c -I../include -I.. -I. -I. -D_PATH_SUDO_CONF="/etc/sudo.conf" -DLOCALEDIR="/usr/share/locale" -DZLIB_CONST -D_FORTIFY_SOURCE=2 -g -O2 -fvisibility=hidden -fPIE -fstack-protector-strong -fstack-clash-protection ./net_ifs.c
make[1]: *** [exec_ptrace.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/root/rpmbuild/BUILD/sudo-1.9.12p1/src'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.qyM11L (%build)

If you change:

#include <elf.h>

to:

#include <linux/elf.h>

in exec_ptrace.h does that fix the problem? Or is NT_ARM_SYSTEM_CALL not defined in /usr/include/linux/elf.h?

This should be fixed by 8215034

hxily commented

so perfectful,thank you.