summaryrefslogtreecommitdiff
path: root/dev-util/plan9port/files
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/plan9port/files')
-rw-r--r--dev-util/plan9port/files/plan9port-builderr.patch29
-rw-r--r--dev-util/plan9port/files/plan9port-cflags.patch16
-rw-r--r--dev-util/plan9port/files/plan9port-freebsd-10.patch11
-rw-r--r--dev-util/plan9port/files/plan9port-noexecstack.patch54
4 files changed, 110 insertions, 0 deletions
diff --git a/dev-util/plan9port/files/plan9port-builderr.patch b/dev-util/plan9port/files/plan9port-builderr.patch
new file mode 100644
index 000000000000..266f10c4b9d5
--- /dev/null
+++ b/dev-util/plan9port/files/plan9port-builderr.patch
@@ -0,0 +1,29 @@
+Prevent mk from ignoring errors
+
+By default, the plan9port INSTALL script doesn't report build error,
+which can result in a mostly broken build begin installed.
+--- a/INSTALL
++++ b/INSTALL
+@@ -41,7 +41,6 @@ echo " "
+ echo "* Resetting $PLAN9/config"
+ rm -f config
+
+-(
+ echo "* Compiler version:"
+ 9c -v 2>&1 | grep -v 'Configured with:' | grep -i version | sed 's/^/ /'
+
+@@ -134,7 +133,7 @@ if $dobuild; then
+ echo "* Warning: not all binaries built successfully."
+ fi
+ echo "* Installing everything in $PLAN9/bin..."
+- mk -k install || exit 1
++ mk install || exit 1
+ if [ ! -x $PLAN9/bin/cleanname -o ! -x $PLAN9/bin/acme -o ! -x $PLAN9/bin/sam ]; then
+ echo " "
+ echo "* Warning: not all binaries built successfully."
+@@ -182,5 +181,4 @@ if $doinstall; then
+ echo " PLAN9=$PLAN9 export PLAN9"
+ echo ' PATH=$PATH:$PLAN9/bin export PATH'
+ fi
+-) 2>&1 | tee install.log | $awk -f $PLAN9/dist/isum.awk -v 'copy='install.sum
+
diff --git a/dev-util/plan9port/files/plan9port-cflags.patch b/dev-util/plan9port/files/plan9port-cflags.patch
new file mode 100644
index 000000000000..c2d2ed6defe5
--- /dev/null
+++ b/dev-util/plan9port/files/plan9port-cflags.patch
@@ -0,0 +1,16 @@
+Prevent resetting CFLAGS and LDFLAGS
+
+This allows the plan9port build to inherit cflags from the environment.
+
+(This patch must be applied after plan9port-noexecstack.patch)
+--- a/src/mkhdr
++++ b/src/mkhdr
+@@ -28,8 +28,6 @@ LD=9l
+ AS=9a
+ AR=9ar
+ INSTALL=install
+-CFLAGS=
+-LDFLAGS=
+ AFLAGS=--noexecstack
+ CLEANFILES=
+ NUKEFILES=
diff --git a/dev-util/plan9port/files/plan9port-freebsd-10.patch b/dev-util/plan9port/files/plan9port-freebsd-10.patch
new file mode 100644
index 000000000000..cc46dc6f4509
--- /dev/null
+++ b/dev-util/plan9port/files/plan9port-freebsd-10.patch
@@ -0,0 +1,11 @@
+--- a/bin/9l 2015-12-09 19:12:50.000000000 +0000
++++ b/bin/9l 2015-12-09 19:13:00.000000000 +0000
+@@ -19,7 +19,7 @@ case "$tag" in
+ 5.2.*)
+ extralibs="$extralibs -lkse"
+ ;;
+- [5-9].*)
++ [5-9].*|10.*)
+ extralibs="$extralibs -lpthread"
+ ;;
+ esac
diff --git a/dev-util/plan9port/files/plan9port-noexecstack.patch b/dev-util/plan9port/files/plan9port-noexecstack.patch
new file mode 100644
index 000000000000..fb4f19f21fc5
--- /dev/null
+++ b/dev-util/plan9port/files/plan9port-noexecstack.patch
@@ -0,0 +1,54 @@
+Remove unneeded executable stack
+
+Assembly routines in libthread and libmp use an executable stack by
+default. This is not needed and can be removed using --noexecstack.
+
+The plan9port 9a wrapper wrapper needs to be modified to pass flags to the
+underlying assembler first though..
+
+Patch by Andy Spencer
+
+ http://code.swtch.com/plan9port/issue/76/
+--- a/bin/9a
++++ b/bin/9a
+@@ -1,10 +1,5 @@
+ #!/bin/sh
+
+-if [ $# != 1 ]; then
+- echo 'usage: 9a file.s' 1>&2
+- exit 1
+-fi
+-
+ test -f $PLAN9/config && . $PLAN9/config
+
+ aflags=""
+@@ -17,5 +12,16 @@ Darwin-*x86_64*)
+ ;;
+ esac
+
+-out=`echo $1 | sed 's/\.s$//;s/$/.o/'`
+-exec as $aflags -o $out $1
++for arg; do
++ case $arg in
++ -*)
++ opts="$opts $arg"
++ ;;
++ *.s)
++ src=$arg
++ dst=$(echo $arg | sed 's/\.s/\.o/')
++ ;;
++ esac
++done
++
++exec as $aflags $opts -o $dst $src
+--- a/src/mkhdr
++++ b/src/mkhdr
+@@ -30,7 +30,7 @@ AR=9ar
+ INSTALL=install
+ CFLAGS=
+ LDFLAGS=
+-AFLAGS=
++AFLAGS=--noexecstack
+ CLEANFILES=
+ NUKEFILES=
+ YACC=9 yacc