summaryrefslogtreecommitdiff
path: root/lang/sbcl
diff options
context:
space:
mode:
authorleot <leot@pkgsrc.org>2018-10-17 12:59:49 +0000
committerleot <leot@pkgsrc.org>2018-10-17 12:59:49 +0000
commitb4c3fdb115d1345b2285040a3f79c8b6f75c5a71 (patch)
tree2d05ad60b42bae81aa65922253e3827fc1739b60 /lang/sbcl
parent9bda5ef39ed9520cf38072fab927c2d07943c90d (diff)
downloadpkgsrc-b4c3fdb115d1345b2285040a3f79c8b6f75c5a71.tar.gz
sbcl: Honor UNLIMIT_RESOURCES and address PaX problems
- Due custom do-{build,test,install} UNLIMIT_RESOURCES were not honored leading to: //slurp-ucd *** - No more room for LISP objects errors. Adjust these target to honor UNLIMIT_RESOURCES. - sbcl does not work with PaX MPROTECT because mmap()s by OR'ing all PROT_{EXEC,READ,WRITE}. Unfortunately src/runtime/sbcl is also used as part of building needing also `${PAXCTL} +m' in the middle of the build. Introduce an SBCL_PAXCTL variable (by default `:') via patch-src_runtime_GNUmakefile that execute a program against src/runtime/sbcl and define it for platforms that have a paxctl tool. Mark bin/sbcl with NOT_PAX_MPROTECT_SAFE too. - Refactor the environment variables injection logic in do-{build,test,install} to honor MAKE_ENV and INSTALL_ENV. - Minor mostly cosmetic adjustments (use ${RM}, not rm) Bump PKGREVISION
Diffstat (limited to 'lang/sbcl')
-rw-r--r--lang/sbcl/Makefile29
-rw-r--r--lang/sbcl/distinfo3
-rw-r--r--lang/sbcl/patches/patch-src_runtime_GNUmakefile25
3 files changed, 49 insertions, 8 deletions
diff --git a/lang/sbcl/Makefile b/lang/sbcl/Makefile
index c6920e79f6c..6e97ff1d2e9 100644
--- a/lang/sbcl/Makefile
+++ b/lang/sbcl/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.77 2018/01/04 14:47:17 jperkin Exp $
+# $NetBSD: Makefile,v 1.78 2018/10/17 12:59:49 leot Exp $
DISTNAME= ${PKGNAME_NOREV}-source
PKGNAME= sbcl-1.4.3
+PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sbcl/}
EXTRACT_SUFX= .tar.bz2
@@ -72,6 +73,17 @@ SUBST_FILES.fix-bins+= src/runtime/Config.x86-sunos
SUBST_SED.fix-bins= -e 's,nm ,/usr/bin/nm ,'
SUBST_SED.fix-bins+= -e 's,ggrep,grep,'
+.if defined(TOOLS_PLATFORM.paxctl)
+SBCL_PAXCTL= ${PAXCTL} +m
+MAKE_ENV+= SBCL_PAXCTL=${SBCL_PAXCTL:Q}
+.endif
+
+INSTALL_ENV+= BUILD_ROOT=${DESTDIR:Q}
+INSTALL_ENV+= INSTALL_ROOT=${PREFIX:Q}
+INSTALL_ENV+= MAN_DIR=${PREFIX:Q}/${PKGMANDIR}
+
+NOT_PAX_MPROTECT_SAFE+= bin/sbcl
+
.if !empty(MACHINE_PLATFORM:MSunOS-*-i386)
SBCL_ARCH_ARGS= "--arch=x86"
.elif !empty(MACHINE_PLATFORM:MSunOS-*-x86_64)
@@ -79,20 +91,23 @@ SBCL_ARCH_ARGS= "--arch=x86-64"
.endif
do-build:
- cd ${WRKSRC} && ${SH} make.sh --prefix=${PREFIX} ${SBCL_ARCH_ARGS} --xc-host=${SBCL_BOOT_SYSTEM:Q}
+ ${RUN} ${_ULIMIT_CMD} \
+ cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${SH} make.sh --prefix=${PREFIX} ${SBCL_ARCH_ARGS} --xc-host=${SBCL_BOOT_SYSTEM:Q}
post-build:
cd ${WRKSRC} && ${RM} -f contrib/sb-cover/test-output/*
do-install:
- cd ${WRKSRC} && BUILD_ROOT=${DESTDIR:Q} INSTALL_ROOT=${PREFIX:Q} MAN_DIR=${PREFIX:Q}/${PKGMANDIR} ${SH} install.sh
- rm -f ${DESTDIR}${PREFIX}/lib/sbcl/sb-posix/test-output/write-test.txt
- rm -f ${DESTDIR}${PREFIX}/lib/sbcl/sb-posix/test-output/read-test.txt
- rm -f ${DESTDIR}${PREFIX}/lib/sbcl/asdf-install/installer.lisp.orig
+ ${RUN} ${_ULIMIT_CMD} \
+ cd ${WRKSRC} && ${PKGSRC_SETENV} ${INSTALL_ENV} ${SH} install.sh
+ ${RM} -f ${DESTDIR}${PREFIX}/lib/sbcl/sb-posix/test-output/write-test.txt
+ ${RM} -f ${DESTDIR}${PREFIX}/lib/sbcl/sb-posix/test-output/read-test.txt
+ ${RM} -f ${DESTDIR}${PREFIX}/lib/sbcl/asdf-install/installer.lisp.orig
do-test:
# for f in compiler.pure.lisp interface.pure.lisp compiler.impure.lisp debug.impure.lisp interface.impure.lisp; do mv ${WRKSRC}/tests/$$f ${WRKSRC}/tests/$$f.off || :; done
- cd ${WRKSRC}/tests && ${SH} ./run-tests.sh
+ ${RUN} ${_ULIMIT_CMD} \
+ cd ${WRKSRC}/tests && ${PKGSRC_SETENV} ${TEST_ENV} ${SH} ./run-tests.sh
.if ${MACHINE_ARCH} == "x86_64"
PLIST_SUBST+= SUFX64=-64
diff --git a/lang/sbcl/distinfo b/lang/sbcl/distinfo
index 9ca16d45e12..2d29f46f042 100644
--- a/lang/sbcl/distinfo
+++ b/lang/sbcl/distinfo
@@ -1,10 +1,11 @@
-$NetBSD: distinfo,v 1.56 2018/01/04 14:47:17 jperkin Exp $
+$NetBSD: distinfo,v 1.57 2018/10/17 12:59:49 leot Exp $
SHA1 (sbcl-1.4.3-source.tar.bz2) = cf610061ee2e8bf90efcf830f45412b68f43d0dc
RMD160 (sbcl-1.4.3-source.tar.bz2) = eb3024ae6980239c6784ee4d234874782870cca4
SHA512 (sbcl-1.4.3-source.tar.bz2) = e730f4f095e2c3b52836df0beae08219a2e3883b4e20ba7303f24d8e51aec7c6d278ad6f9d57fac36b5aebec3fefb118d07bfd4ca48a44a3324345f2993fca62
Size (sbcl-1.4.3-source.tar.bz2) = 5953041 bytes
SHA1 (patch-ab) = b087921f7317523fd78396518dfd2cb1c8e6d5f9
+SHA1 (patch-src_runtime_GNUmakefile) = bb1fffdaa90897d4ddcaedc3d480778917348281
SHA1 (patch-src_runtime_backtrace.c) = ba3d7d152b279652d7074ebc9ba615c9d899f35c
SHA1 (patch-src_runtime_breakpoint.c) = 019d98692411b5701ce14c023ed3afab71033323
SHA1 (patch-src_runtime_bsd-os.c) = 1c2bb3ce517aea03bbc4f09708e8300085253286
diff --git a/lang/sbcl/patches/patch-src_runtime_GNUmakefile b/lang/sbcl/patches/patch-src_runtime_GNUmakefile
new file mode 100644
index 00000000000..6b80cb92a03
--- /dev/null
+++ b/lang/sbcl/patches/patch-src_runtime_GNUmakefile
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_runtime_GNUmakefile,v 1.1 2018/10/17 12:59:49 leot Exp $
+
+Add support to invoke paxctl(8) or similar programs to adjust PaX
+permissions of src/runtime/sbcl during the build phase.
+
+--- src/runtime/GNUmakefile.orig 2017-12-29 09:55:08.000000000 +0000
++++ src/runtime/GNUmakefile
+@@ -14,6 +14,9 @@
+ all: targets tags
+ TARGET=sbcl
+
++# paxctl(8) or similar programs to adjust PaX permissions of src/runtime/sbcl
++SBCL_PAXCTL ?= :
++
+ # Defaults which might be overridden or modified by values in the
+ # Config file. Most of them are same on most systems right now.
+ # If you need to override one of these, do it in Config.
+@@ -78,6 +81,7 @@ targets: $(TARGET) $(OBJTARGET) sbcl.nm
+
+ $(TARGET): $(LIBSBCL)
+ $(CC) ${LINKFLAGS} -o $@ $(USE_LIBSBCL) $(LIBS)
++ $(SBCL_PAXCTL) $@
+
+ # ld -r -o sbcl.o works on Linux, but not on other platforms.
+ # On macOS, it fails to keep debug sections.