summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Ushakov <uwe@stderr.spb.ru>2021-01-04 02:42:43 +0300
committerValery Ushakov <uwe@stderr.spb.ru>2021-01-04 02:42:43 +0300
commit8adc601ba8dfd68676fc702cd30075643967f2fd (patch)
tree1dd4e2d4992a02cc79eedc2731f98f0223b99c63
parentc5728686379484100b7d59abf4f0b47928b1631e (diff)
NetBSD/arm: disable pax mprotect restrictions for emu
ARM has separate read and execute protection bits so after writing out JIT code we need to make it executable with mprotect(2), but PAX wouldn't let us by default. Mark the emu binary so that this restriction is lifted. On other machines where this is not an issue set PAXCTL to a no-op.
-rw-r--r--emu/NetBSD/mkfile1
-rw-r--r--mkfiles/mkfile-NetBSD-3862
-rw-r--r--mkfiles/mkfile-NetBSD-arm3
-rw-r--r--mkfiles/mkfile-NetBSD-power2
4 files changed, 8 insertions, 0 deletions
diff --git a/emu/NetBSD/mkfile b/emu/NetBSD/mkfile
index 17516997..6a9b6a5c 100644
--- a/emu/NetBSD/mkfile
+++ b/emu/NetBSD/mkfile
@@ -40,6 +40,7 @@ default:V: $O.$CONF
$O.$CONF: $OBJ $CONF.c $CONF.root.h $LIBFILES
$CC $CFLAGS '-DKERNDATE='$KERNDATE $CONF.c
$LD $LDFLAGS -o $target $OBJ $CONF.$O $LIBFILES $SYSLIBS
+ $PAXCTL $target
install:V: $O.$CONF
cp $O.$CONF $INSTALLDIR/$CONF
diff --git a/mkfiles/mkfile-NetBSD-386 b/mkfiles/mkfile-NetBSD-386
index 99ae6687..39e8ed5d 100644
--- a/mkfiles/mkfile-NetBSD-386
+++ b/mkfiles/mkfile-NetBSD-386
@@ -26,5 +26,7 @@ LDFLAGS=
SYSLIBS=
+PAXCTL= :
+
YACC= iyacc
YFLAGS= -d
diff --git a/mkfiles/mkfile-NetBSD-arm b/mkfiles/mkfile-NetBSD-arm
index a022c05b..581bca9d 100644
--- a/mkfiles/mkfile-NetBSD-arm
+++ b/mkfiles/mkfile-NetBSD-arm
@@ -26,5 +26,8 @@ LDFLAGS=
SYSLIBS=
+# disable PaX mprotect(2) restrictions for JIT
+PAXCTL= paxctl +m
+
YACC= iyacc
YFLAGS= -d
diff --git a/mkfiles/mkfile-NetBSD-power b/mkfiles/mkfile-NetBSD-power
index 1ac7e58e..ae7f86c8 100644
--- a/mkfiles/mkfile-NetBSD-power
+++ b/mkfiles/mkfile-NetBSD-power
@@ -26,5 +26,7 @@ LDFLAGS=
SYSLIBS=
+PAXCTL= :
+
YACC= iyacc
YFLAGS= -d