From: Mikio Hara Date: Fri, 7 Feb 2014 01:23:53 +0000 (+0900) Subject: syscall: make use of signed char explicit in generating z-files on freebsd/arm X-Git-Tag: go1.3beta1~799 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=546081fd01aad2446b9cd50444662c6438e7fb2e;p=gostls13.git syscall: make use of signed char explicit in generating z-files on freebsd/arm This CL is in preparation to make cgo work on freebsd/arm. The signedness of C char might be a problem when we make bare syscall APIs, Go structures, using built-in bootstrap scripts with cgo because they do translate C stuff to Go stuff internally. For now almost all the C compilers assume that the type of char will be unsigned on arm by default but it makes a different view from amd64, 386. This CL just passes -fsigned-char, let the type of char be signed, option which is supported on both gcc and clang to the underlying C compilers through cgo for avoiding such inconsistency on syscall API. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/59740051 --- diff --git a/src/pkg/syscall/mkall.sh b/src/pkg/syscall/mkall.sh index a3139d603d..63abc869a7 100755 --- a/src/pkg/syscall/mkall.sh +++ b/src/pkg/syscall/mkall.sh @@ -148,7 +148,9 @@ freebsd_arm) mkerrors="$mkerrors" mksyscall="./mksyscall.pl -l32 -arm" mksysnum="curl -s 'http://svn.freebsd.org/base/head/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" + # Let the type of C char be singed for making the bare syscall + # API consistent across over platforms. + mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; linux_386) mkerrors="$mkerrors -m32"