1
0
mirror of https://github.com/golang/go synced 2024-09-30 12:28:35 -06:00

syscall: mksysnum_linux.pl: run syscall numbers through GCC

This will skip system call numbers that are ifdef'ed out in unistd.h,
as occurs on PPC.

Change-Id: I88e640e4621c7a8cc266433f34a7b4be71543ec9
Reviewed-on: https://go-review.googlesource.com/9966
Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
Ian Lance Taylor 2015-05-12 14:24:26 -07:00
parent 350fd548b3
commit 1828d03ad5
2 changed files with 3 additions and 2 deletions

View File

@ -179,7 +179,7 @@ linux_amd64)
linux_arm) linux_arm)
mkerrors="$mkerrors" mkerrors="$mkerrors"
mksyscall="./mksyscall.pl -l32 -arm" mksyscall="./mksyscall.pl -l32 -arm"
mksysnum="curl -s 'http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/arch/arm/include/uapi/asm/unistd.h' | ./mksysnum_linux.pl" mksysnum="curl -s 'http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/arch/arm/include/uapi/asm/unistd.h' | ./mksysnum_linux.pl -"
mktypes="GOARCH=$GOARCH go tool cgo -godefs" mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;; ;;
linux_arm64) linux_arm64)

View File

@ -28,7 +28,8 @@ sub fmt {
} }
my $prev; my $prev;
while(<>){ open(GCC, "gcc -E -dD $ARGV[0] |") || die "can't run gcc";
while(<GCC>){
if(/^#define __NR_syscalls\s+/) { if(/^#define __NR_syscalls\s+/) {
# ignore redefinitions of __NR_syscalls # ignore redefinitions of __NR_syscalls
} }