From e89e8a1559693b91fd201d2a0368a8561c1473b7 Mon Sep 17 00:00:00 2001 From: Valery Ushakov Date: Tue, 29 Dec 2020 20:10:33 +0300 Subject: NetBSD/arm: initial support This is more or less mechanical merge of existing NetBSD code and ARM-specific bits from Linux/arm files. --- mkfiles/mkfile-NetBSD-arm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mkfiles/mkfile-NetBSD-arm (limited to 'mkfiles') diff --git a/mkfiles/mkfile-NetBSD-arm b/mkfiles/mkfile-NetBSD-arm new file mode 100644 index 00000000..a022c05b --- /dev/null +++ b/mkfiles/mkfile-NetBSD-arm @@ -0,0 +1,30 @@ +TARGMODEL= Posix +TARGSHTYPE= sh +CPUS= arm + +O= o +OS= o + +AR= ar +ARFLAGS= ruvs + +AS= cc -c +ASFLAGS= + +CC= cc -c +CFLAGS= -g\ + -O\ + -fno-strict-aliasing\ + -Wno-deprecated-declarations -Wuninitialized -Wunused -Wreturn-type -Wimplicit\ + -I$ROOT/NetBSD/arm/include\ + -I$ROOT/include\ + -I/usr/X11R7/include + +ANSICPP= +LD= cc +LDFLAGS= + +SYSLIBS= + +YACC= iyacc +YFLAGS= -d -- cgit v1.2.3 From 8adc601ba8dfd68676fc702cd30075643967f2fd Mon Sep 17 00:00:00 2001 From: Valery Ushakov Date: Mon, 4 Jan 2021 02:42:43 +0300 Subject: 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. --- emu/NetBSD/mkfile | 1 + mkfiles/mkfile-NetBSD-386 | 2 ++ mkfiles/mkfile-NetBSD-arm | 3 +++ mkfiles/mkfile-NetBSD-power | 2 ++ 4 files changed, 8 insertions(+) (limited to 'mkfiles') 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 -- cgit v1.2.3