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 PKGREVISIONdiff -r1.77 -r1.78 pkgsrc/lang/sbcl/Makefile
(leot)
@@ -1,17 +1,18 @@ | @@ -1,17 +1,18 @@ | |||
1 | # $NetBSD: Makefile,v 1.77 2018/01/04 14:47:17 jperkin Exp $ | 1 | # $NetBSD: Makefile,v 1.78 2018/10/17 12:59:49 leot Exp $ | |
2 | 2 | |||
3 | DISTNAME= ${PKGNAME_NOREV}-source | 3 | DISTNAME= ${PKGNAME_NOREV}-source | |
4 | PKGNAME= sbcl-1.4.3 | 4 | PKGNAME= sbcl-1.4.3 | |
5 | PKGREVISION= 1 | |||
5 | CATEGORIES= lang | 6 | CATEGORIES= lang | |
6 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sbcl/} | 7 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sbcl/} | |
7 | EXTRACT_SUFX= .tar.bz2 | 8 | EXTRACT_SUFX= .tar.bz2 | |
8 | 9 | |||
9 | MAINTAINER= asau@inbox.ru | 10 | MAINTAINER= asau@inbox.ru | |
10 | HOMEPAGE= http://www.sbcl.org/ | 11 | HOMEPAGE= http://www.sbcl.org/ | |
11 | COMMENT= SBCL, a Common Lisp implementation | 12 | COMMENT= SBCL, a Common Lisp implementation | |
12 | 13 | |||
13 | # SBCL creates a new release with minor updates and fixes every | 14 | # SBCL creates a new release with minor updates and fixes every | |
14 | # month. The maintainer of this package does not have the time | 15 | # month. The maintainer of this package does not have the time | |
15 | # to build, test, update, etc. this package that often. If you | 16 | # to build, test, update, etc. this package that often. If you | |
16 | # would like a newer (or older) version, this works very often: | 17 | # would like a newer (or older) version, this works very often: | |
17 | # 1) change the PKGNAME variable above as desired | 18 | # 1) change the PKGNAME variable above as desired | |
@@ -62,42 +63,56 @@ SUBST_SED.fix-paths+= -e 's,/v | @@ -62,42 +63,56 @@ SUBST_SED.fix-paths+= -e 's,/v | |||
62 | SUBST_CLASSES+= fix-gtar | 63 | SUBST_CLASSES+= fix-gtar | |
63 | SUBST_STAGE.fix-gtar= pre-configure | 64 | SUBST_STAGE.fix-gtar= pre-configure | |
64 | SUBST_MESSAGE.fix-gtar= Fixing GNU tar references. | 65 | SUBST_MESSAGE.fix-gtar= Fixing GNU tar references. | |
65 | SUBST_FILES.fix-gtar= contrib/asdf-install/installer.lisp | 66 | SUBST_FILES.fix-gtar= contrib/asdf-install/installer.lisp | |
66 | SUBST_SED.fix-gtar= -e 's,@GTAR@,${GTAR},' | 67 | SUBST_SED.fix-gtar= -e 's,@GTAR@,${GTAR},' | |
67 | 68 | |||
68 | SUBST_CLASSES+= fix-bins | 69 | SUBST_CLASSES+= fix-bins | |
69 | SUBST_STAGE.fix-bins= pre-configure | 70 | SUBST_STAGE.fix-bins= pre-configure | |
70 | SUBST_FILES.fix-bins= src/runtime/Config.x86-64-sunos | 71 | SUBST_FILES.fix-bins= src/runtime/Config.x86-64-sunos | |
71 | SUBST_FILES.fix-bins+= src/runtime/Config.x86-sunos | 72 | SUBST_FILES.fix-bins+= src/runtime/Config.x86-sunos | |
72 | SUBST_SED.fix-bins= -e 's,nm ,/usr/bin/nm ,' | 73 | SUBST_SED.fix-bins= -e 's,nm ,/usr/bin/nm ,' | |
73 | SUBST_SED.fix-bins+= -e 's,ggrep,grep,' | 74 | SUBST_SED.fix-bins+= -e 's,ggrep,grep,' | |
74 | 75 | |||
76 | .if defined(TOOLS_PLATFORM.paxctl) | |||
77 | SBCL_PAXCTL= ${PAXCTL} +m | |||
78 | MAKE_ENV+= SBCL_PAXCTL=${SBCL_PAXCTL:Q} | |||
79 | .endif | |||
80 | ||||
81 | INSTALL_ENV+= BUILD_ROOT=${DESTDIR:Q} | |||
82 | INSTALL_ENV+= INSTALL_ROOT=${PREFIX:Q} | |||
83 | INSTALL_ENV+= MAN_DIR=${PREFIX:Q}/${PKGMANDIR} | |||
84 | ||||
85 | NOT_PAX_MPROTECT_SAFE+= bin/sbcl | |||
86 | ||||
75 | .if !empty(MACHINE_PLATFORM:MSunOS-*-i386) | 87 | .if !empty(MACHINE_PLATFORM:MSunOS-*-i386) | |
76 | SBCL_ARCH_ARGS= "--arch=x86" | 88 | SBCL_ARCH_ARGS= "--arch=x86" | |
77 | .elif !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) | 89 | .elif !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) | |
78 | SBCL_ARCH_ARGS= "--arch=x86-64" | 90 | SBCL_ARCH_ARGS= "--arch=x86-64" | |
79 | .endif | 91 | .endif | |
80 | 92 | |||
81 | do-build: | 93 | do-build: | |
82 | cd ${WRKSRC} && ${SH} make.sh --prefix=${PREFIX} ${SBCL_ARCH_ARGS} --xc-host=${SBCL_BOOT_SYSTEM:Q} | 94 | ${RUN} ${_ULIMIT_CMD} \ | |
95 | cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${SH} make.sh --prefix=${PREFIX} ${SBCL_ARCH_ARGS} --xc-host=${SBCL_BOOT_SYSTEM:Q} | |||
83 | 96 | |||
84 | post-build: | 97 | post-build: | |
85 | cd ${WRKSRC} && ${RM} -f contrib/sb-cover/test-output/* | 98 | cd ${WRKSRC} && ${RM} -f contrib/sb-cover/test-output/* | |
86 | 99 | |||
87 | do-install: | 100 | do-install: | |
88 | cd ${WRKSRC} && BUILD_ROOT=${DESTDIR:Q} INSTALL_ROOT=${PREFIX:Q} MAN_DIR=${PREFIX:Q}/${PKGMANDIR} ${SH} install.sh | 101 | ${RUN} ${_ULIMIT_CMD} \ | |
89 | rm -f ${DESTDIR}${PREFIX}/lib/sbcl/sb-posix/test-output/write-test.txt | 102 | cd ${WRKSRC} && ${PKGSRC_SETENV} ${INSTALL_ENV} ${SH} install.sh | |
90 | rm -f ${DESTDIR}${PREFIX}/lib/sbcl/sb-posix/test-output/read-test.txt | 103 | ${RM} -f ${DESTDIR}${PREFIX}/lib/sbcl/sb-posix/test-output/write-test.txt | |
91 | rm -f ${DESTDIR}${PREFIX}/lib/sbcl/asdf-install/installer.lisp.orig | 104 | ${RM} -f ${DESTDIR}${PREFIX}/lib/sbcl/sb-posix/test-output/read-test.txt | |
105 | ${RM} -f ${DESTDIR}${PREFIX}/lib/sbcl/asdf-install/installer.lisp.orig | |||
92 | 106 | |||
93 | do-test: | 107 | do-test: | |
94 | # 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 | 108 | # 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 | |
95 | cd ${WRKSRC}/tests && ${SH} ./run-tests.sh | 109 | ${RUN} ${_ULIMIT_CMD} \ | |
110 | cd ${WRKSRC}/tests && ${PKGSRC_SETENV} ${TEST_ENV} ${SH} ./run-tests.sh | |||
96 | 111 | |||
97 | .if ${MACHINE_ARCH} == "x86_64" | 112 | .if ${MACHINE_ARCH} == "x86_64" | |
98 | PLIST_SUBST+= SUFX64=-64 | 113 | PLIST_SUBST+= SUFX64=-64 | |
99 | .else | 114 | .else | |
100 | PLIST_SUBST+= SUFX64= | 115 | PLIST_SUBST+= SUFX64= | |
101 | .endif | 116 | .endif | |
102 | 117 | |||
103 | .include "../../mk/bsd.pkg.mk" | 118 | .include "../../mk/bsd.pkg.mk" |
@@ -1,20 +1,21 @@ | @@ -1,20 +1,21 @@ | |||
1 | $NetBSD: distinfo,v 1.56 2018/01/04 14:47:17 jperkin Exp $ | 1 | $NetBSD: distinfo,v 1.57 2018/10/17 12:59:49 leot Exp $ | |
2 | 2 | |||
3 | SHA1 (sbcl-1.4.3-source.tar.bz2) = cf610061ee2e8bf90efcf830f45412b68f43d0dc | 3 | SHA1 (sbcl-1.4.3-source.tar.bz2) = cf610061ee2e8bf90efcf830f45412b68f43d0dc | |
4 | RMD160 (sbcl-1.4.3-source.tar.bz2) = eb3024ae6980239c6784ee4d234874782870cca4 | 4 | RMD160 (sbcl-1.4.3-source.tar.bz2) = eb3024ae6980239c6784ee4d234874782870cca4 | |
5 | SHA512 (sbcl-1.4.3-source.tar.bz2) = e730f4f095e2c3b52836df0beae08219a2e3883b4e20ba7303f24d8e51aec7c6d278ad6f9d57fac36b5aebec3fefb118d07bfd4ca48a44a3324345f2993fca62 | 5 | SHA512 (sbcl-1.4.3-source.tar.bz2) = e730f4f095e2c3b52836df0beae08219a2e3883b4e20ba7303f24d8e51aec7c6d278ad6f9d57fac36b5aebec3fefb118d07bfd4ca48a44a3324345f2993fca62 | |
6 | Size (sbcl-1.4.3-source.tar.bz2) = 5953041 bytes | 6 | Size (sbcl-1.4.3-source.tar.bz2) = 5953041 bytes | |
7 | SHA1 (patch-ab) = b087921f7317523fd78396518dfd2cb1c8e6d5f9 | 7 | SHA1 (patch-ab) = b087921f7317523fd78396518dfd2cb1c8e6d5f9 | |
8 | SHA1 (patch-src_runtime_GNUmakefile) = bb1fffdaa90897d4ddcaedc3d480778917348281 | |||
8 | SHA1 (patch-src_runtime_backtrace.c) = ba3d7d152b279652d7074ebc9ba615c9d899f35c | 9 | SHA1 (patch-src_runtime_backtrace.c) = ba3d7d152b279652d7074ebc9ba615c9d899f35c | |
9 | SHA1 (patch-src_runtime_breakpoint.c) = 019d98692411b5701ce14c023ed3afab71033323 | 10 | SHA1 (patch-src_runtime_breakpoint.c) = 019d98692411b5701ce14c023ed3afab71033323 | |
10 | SHA1 (patch-src_runtime_bsd-os.c) = 1c2bb3ce517aea03bbc4f09708e8300085253286 | 11 | SHA1 (patch-src_runtime_bsd-os.c) = 1c2bb3ce517aea03bbc4f09708e8300085253286 | |
11 | SHA1 (patch-src_runtime_bsd-os.h) = df48abd32b3b89b9d8a0ba4068c6723bea6617d6 | 12 | SHA1 (patch-src_runtime_bsd-os.h) = df48abd32b3b89b9d8a0ba4068c6723bea6617d6 | |
12 | SHA1 (patch-src_runtime_coreparse.c) = 46f8b5ebea5ba3db7baaed124aaf15f2686f7202 | 13 | SHA1 (patch-src_runtime_coreparse.c) = 46f8b5ebea5ba3db7baaed124aaf15f2686f7202 | |
13 | SHA1 (patch-src_runtime_dynbind.c) = 44b96758392c8d71834e665dfd62bc7464a033c9 | 14 | SHA1 (patch-src_runtime_dynbind.c) = 44b96758392c8d71834e665dfd62bc7464a033c9 | |
14 | SHA1 (patch-src_runtime_gc-common.c) = e74f4537971ee61181f2ed9d1f88fedafd980a47 | 15 | SHA1 (patch-src_runtime_gc-common.c) = e74f4537971ee61181f2ed9d1f88fedafd980a47 | |
15 | SHA1 (patch-src_runtime_gencgc.c) = 6862366d1998205f6bcf9cfded9acda1d03a2f52 | 16 | SHA1 (patch-src_runtime_gencgc.c) = 6862366d1998205f6bcf9cfded9acda1d03a2f52 | |
16 | SHA1 (patch-src_runtime_globals.c) = ad8aedc43460892edb96e55276f1343abda2b7f5 | 17 | SHA1 (patch-src_runtime_globals.c) = ad8aedc43460892edb96e55276f1343abda2b7f5 | |
17 | SHA1 (patch-src_runtime_interr.c) = a12a0a6826d7dd506d6012f10f69862f2a551174 | 18 | SHA1 (patch-src_runtime_interr.c) = a12a0a6826d7dd506d6012f10f69862f2a551174 | |
18 | SHA1 (patch-src_runtime_interrupt.c) = c6675f60565cc411a34e58927c9ca2510f822328 | 19 | SHA1 (patch-src_runtime_interrupt.c) = c6675f60565cc411a34e58927c9ca2510f822328 | |
19 | SHA1 (patch-src_runtime_monitor.c) = cdf86207600a387fb092fa8018dd5a08f8c9f4f2 | 20 | SHA1 (patch-src_runtime_monitor.c) = cdf86207600a387fb092fa8018dd5a08f8c9f4f2 | |
20 | SHA1 (patch-src_runtime_os-common.c) = 966e3d23e3b7024c4c6b4e1c704a505b1a56008f | 21 | SHA1 (patch-src_runtime_os-common.c) = 966e3d23e3b7024c4c6b4e1c704a505b1a56008f |
$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.