"H.J. Lu" <hongjiu...@intel.com> writes: > Some my Linux system, system call numbers are defined as > > #define __NR_x32_rt_sigaction __NR_X32_SYSCALL(0) > > and > > __NR_X32_SYSCALL(0) is expanded to (0x40000000 | (512 + 0)). This patch > tries to deal with by checking '^// unknowndefine SYS_[a-z]' and uses > "${CC} -E" to extract the real number. Tested on Linux/x86-64. OK > to install?
This patch might be a little simpler. Does it solve the problem? Ian
diff -r 864416b061a9 libgo/mksysinfo.sh --- a/libgo/mksysinfo.sh Fri Dec 09 08:46:12 2011 -0800 +++ b/libgo/mksysinfo.sh Fri Dec 09 14:45:52 2011 -0800 @@ -97,6 +97,13 @@ ${CC} -fdump-go-spec=gen-sysinfo.go -std=gnu99 -S -o sysinfo.s sysinfo.c +# Pick up some constants that may be defined using preprocessor +# macros. +grep '^// unknowndefine SYS_' gen-sysinfo.go | \ + sed -e 's|^// unknowndefine \(SYS_[^ ]*\) \(.*\)$|enum { \1 = \2 };|' \ + >> sysinfo.c +${CC} -fdump-go-spec=gen-sysinfo.go -std=gnu99 -S -o sysinfo.s sysinfo.c + echo 'package syscall' > ${OUT} echo 'import "unsafe"' >> ${OUT} echo 'type _ unsafe.Pointer' >> ${OUT}