]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: make use of signed char explicit in generating z-files on freebsd/arm
authorMikio Hara <mikioh.mikioh@gmail.com>
Fri, 7 Feb 2014 01:23:53 +0000 (10:23 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Fri, 7 Feb 2014 01:23:53 +0000 (10:23 +0900)
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

src/pkg/syscall/mkall.sh

index a3139d603d84f02e247bd13683b1505bcca8644e..63abc869a76226cf392f19d2dd7ee14066f3194c 100755 (executable)
@@ -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"