Skip to content

Commit 841e13d

Browse files
author
Araragi Hokuto
committed
unix: Fix zerrors generation on illumos
zerrors generated on illumos seems to be different from those generated on solaris. This commit updates mkerrors.sh to handle those platform differences.
1 parent abfeaab commit 841e13d

File tree

4 files changed

+1540
-5
lines changed

4 files changed

+1540
-5
lines changed

unix/mkall.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ solaris_amd64)
192192
;;
193193
illumos_amd64)
194194
mksyscall="go run mksyscall_solaris.go"
195-
mkerrors=
195+
mkerrors="$mkerrors -m64"
196196
mksysnum=
197197
mktypes=
198198
;;

unix/mkerrors.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,24 @@ if [[ "$GOOS" = "linux" ]] && [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then
2323
exit 1
2424
fi
2525

26-
if [[ "$GOOS" = "aix" ]]; then
26+
if [[ "$GOOS" = "aix" ]] || [[ "$GOOS" = "illumos" ]]; then
2727
CC=${CC:-gcc}
2828
else
2929
CC=${CC:-cc}
3030
fi
3131

32-
if [[ "$GOOS" = "solaris" ]]; then
32+
if [[ "$GOOS" = "solaris" ]] || [[ "$GOOS" = "illumos" ]]; then
3333
# Assumes GNU versions of utilities in PATH.
3434
export PATH=/usr/gnu/bin:$PATH
3535
fi
3636

37+
buildtags="${GOARCH},${GOOS}"
38+
39+
# Solaris zerrors should not be compiled on illumos
40+
if [[ "$GOOS" = "solaris" ]]; then
41+
buildtags="$buildtags,!illumos"
42+
fi
43+
3744
uname=$(uname)
3845

3946
includes_AIX='
@@ -580,7 +587,7 @@ echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
580587
echo '// mkerrors.sh' "$@"
581588
echo '// Code generated by the command above; see README.md. DO NOT EDIT.'
582589
echo
583-
echo "// +build ${GOARCH},${GOOS}"
590+
echo "// +build $buildtags"
584591
echo
585592
go tool cgo -godefs -- "$@" _const.go >_error.out
586593
cat _error.out | grep -vf _error.grep | grep -vf _signal.grep

0 commit comments

Comments
 (0)