aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@golang.org>2009-11-11 15:02:15 -0800
committerAdam Langley <agl@golang.org>2009-11-11 15:02:15 -0800
commit2643f742a5b7c5db8a51fbe0b5b824190c9d5571 (patch)
tree765465e1b339831a5bf6200af0c9d4532aee360f
parentef7c370a201b1aae90349b1e869493264a147baa (diff)
downloadgo-2643f742a5b7c5db8a51fbe0b5b824190c9d5571.tar.gz
go-2643f742a5b7c5db8a51fbe0b5b824190c9d5571.zip
make.bash: detect and warn about SELinux policy that crashes us.
The default SELinux policy on Fedora 12 (at least) disallows stack pages to be +x. This causes all binaries written by 6g/6l to segfault immedately. The 'true' way to fix this issue is to mark binaries with the correct type. However, that assumes that 6l is going to detect SELinux, figure out the correct type for the current distribution and set the type (without libselinux). For now we'll warn users and point them towards the way to enable execstack for the whole system. http://code.google.com/p/go/issues/detail?id=47 R=rsc CC=golang-dev http://codereview.prom.corp.google.com/1026041
-rwxr-xr-xsrc/make.bash16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/make.bash b/src/make.bash
index f152a74519..06c1f128cd 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -47,6 +47,22 @@ if ! (cd lib9 && which quietgcc) >/dev/null 2>&1; then
exit 1
fi
+if [ -d /selinux -a -f /selinux/booleans/allow_execstack ] ; then
+ if ! cat /selinux/booleans/allow_execstack | grep -c '^1 1$' >> /dev/null ; then
+ echo "WARNING: the default SELinux policy on, at least, Fedora 12 breaks "
+ echo "Go. You can enable the features that Go needs via the following "
+ echo "command (as root):"
+ echo " # setsebool -P allow_execstack 1"
+ echo
+ echo "Note that this affects your system globally! "
+ echo
+ echo "The build will continue in five seconds in case we "
+ echo "misdiagnosed the issue..."
+
+ sleep 5
+ fi
+fi
+
bash clean.bash
for i in lib9 libbio libmach cmd pkg libcgo cmd/cgo cmd/ebnflint cmd/godoc cmd/gofmt cmd/goyacc cmd/hgpatch