You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-lang/go/files/go-1.0.1-hardened.patch

56 lines
1.5 KiB

diff -r 95d6aec944d4 src/all.bash
--- a/src/all.bash Tue May 15 12:00:13 2012 +1000
+++ b/src/all.bash Tue May 15 08:46:50 2012 -0500
@@ -8,6 +8,6 @@
echo 'all.bash must be run from $GOROOT/src' 1>&2
exit 1
fi
-. ./make.bash --no-banner
+. ./make.bash $@ --no-banner
bash run.bash --no-rebuild --banner
$GOTOOLDIR/dist banner # print build info
diff -r 95d6aec944d4 src/make.bash
--- a/src/make.bash Tue May 15 12:00:13 2012 +1000
+++ b/src/make.bash Tue May 15 08:46:50 2012 -0500
@@ -116,6 +116,40 @@
./cmd/dist/dist bootstrap $buildall -v # builds go_bootstrap
# Delay move of dist tool to now, because bootstrap may clear tool directory.
mv cmd/dist/dist "$GOTOOLDIR"/dist
+if [ "$1" = "--pax-kernel" ]; then
+ shift
+ if [ -f "$GOTOOLDIR"/8l ]; then
+ mv "$GOTOOLDIR"/8l{,.orig}
+ cat <<'EOF' >"$GOTOOLDIR"/8l
+#!/bin/bash
+BIN="8.out"
+for (( i = 1 ; i <= $# ; i++ )); do
+ if [ "x${!i}" = "x-o" ]; then
+ i=$(( i + 1 ))
+ BIN="${!i}"
+ fi
+done
+$(dirname $0)/8l.orig "$@" && paxctl -cm "$BIN" &>/dev/null
+EOF
+ chmod +x "$GOTOOLDIR"/8l
+ fi
+ if [ -f "$GOTOOLDIR"/6l ]; then
+ mv "$GOTOOLDIR"/6l{,.orig}
+ cat <<'EOF' >"$GOTOOLDIR"/6l
+#!/bin/bash
+BIN="6.out"
+for (( i = 1 ; i <= $# ; i++ )); do
+ if [ "x${!i}" = "x-o" ]; then
+ i=$(( i + 1 ))
+ BIN="${!i}"
+ fi
+done
+$(dirname $0)/6l.orig "$@" && paxctl -cm "$BIN" &>/dev/null
+EOF
+ chmod +x "$GOTOOLDIR"/6l
+ fi
+ paxctl -cm "$GOTOOLDIR"/go_bootstrap &>/dev/null
+fi
"$GOTOOLDIR"/go_bootstrap clean -i std
echo