Wed Oct 17 12:59:49 2018 UTC ()
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


(leot)
diff -r1.77 -r1.78 pkgsrc/lang/sbcl/Makefile
diff -r1.56 -r1.57 pkgsrc/lang/sbcl/distinfo
diff -r0 -r1.1 pkgsrc/lang/sbcl/patches/patch-src_runtime_GNUmakefile

cvs diff -r1.77 -r1.78 pkgsrc/lang/sbcl/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/sbcl/Makefile 2018/01/04 14:47:17 1.77
+++ pkgsrc/lang/sbcl/Makefile 2018/10/17 12:59:49 1.78
@@ -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
3DISTNAME= ${PKGNAME_NOREV}-source 3DISTNAME= ${PKGNAME_NOREV}-source
4PKGNAME= sbcl-1.4.3 4PKGNAME= sbcl-1.4.3
 5PKGREVISION= 1
5CATEGORIES= lang 6CATEGORIES= lang
6MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sbcl/} 7MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sbcl/}
7EXTRACT_SUFX= .tar.bz2 8EXTRACT_SUFX= .tar.bz2
8 9
9MAINTAINER= asau@inbox.ru 10MAINTAINER= asau@inbox.ru
10HOMEPAGE= http://www.sbcl.org/ 11HOMEPAGE= http://www.sbcl.org/
11COMMENT= SBCL, a Common Lisp implementation 12COMMENT= 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
62SUBST_CLASSES+= fix-gtar 63SUBST_CLASSES+= fix-gtar
63SUBST_STAGE.fix-gtar= pre-configure 64SUBST_STAGE.fix-gtar= pre-configure
64SUBST_MESSAGE.fix-gtar= Fixing GNU tar references. 65SUBST_MESSAGE.fix-gtar= Fixing GNU tar references.
65SUBST_FILES.fix-gtar= contrib/asdf-install/installer.lisp 66SUBST_FILES.fix-gtar= contrib/asdf-install/installer.lisp
66SUBST_SED.fix-gtar= -e 's,@GTAR@,${GTAR},' 67SUBST_SED.fix-gtar= -e 's,@GTAR@,${GTAR},'
67 68
68SUBST_CLASSES+= fix-bins 69SUBST_CLASSES+= fix-bins
69SUBST_STAGE.fix-bins= pre-configure 70SUBST_STAGE.fix-bins= pre-configure
70SUBST_FILES.fix-bins= src/runtime/Config.x86-64-sunos 71SUBST_FILES.fix-bins= src/runtime/Config.x86-64-sunos
71SUBST_FILES.fix-bins+= src/runtime/Config.x86-sunos 72SUBST_FILES.fix-bins+= src/runtime/Config.x86-sunos
72SUBST_SED.fix-bins= -e 's,nm ,/usr/bin/nm ,' 73SUBST_SED.fix-bins= -e 's,nm ,/usr/bin/nm ,'
73SUBST_SED.fix-bins+= -e 's,ggrep,grep,' 74SUBST_SED.fix-bins+= -e 's,ggrep,grep,'
74 75
 76.if defined(TOOLS_PLATFORM.paxctl)
 77SBCL_PAXCTL= ${PAXCTL} +m
 78MAKE_ENV+= SBCL_PAXCTL=${SBCL_PAXCTL:Q}
 79.endif
 80
 81INSTALL_ENV+= BUILD_ROOT=${DESTDIR:Q}
 82INSTALL_ENV+= INSTALL_ROOT=${PREFIX:Q}
 83INSTALL_ENV+= MAN_DIR=${PREFIX:Q}/${PKGMANDIR}
 84
 85NOT_PAX_MPROTECT_SAFE+= bin/sbcl
 86
75.if !empty(MACHINE_PLATFORM:MSunOS-*-i386) 87.if !empty(MACHINE_PLATFORM:MSunOS-*-i386)
76SBCL_ARCH_ARGS= "--arch=x86" 88SBCL_ARCH_ARGS= "--arch=x86"
77.elif !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) 89.elif !empty(MACHINE_PLATFORM:MSunOS-*-x86_64)
78SBCL_ARCH_ARGS= "--arch=x86-64" 90SBCL_ARCH_ARGS= "--arch=x86-64"
79.endif 91.endif
80 92
81do-build: 93do-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
84post-build: 97post-build:
85 cd ${WRKSRC} && ${RM} -f contrib/sb-cover/test-output/* 98 cd ${WRKSRC} && ${RM} -f contrib/sb-cover/test-output/*
86 99
87do-install: 100do-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
93do-test: 107do-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"
98PLIST_SUBST+= SUFX64=-64 113PLIST_SUBST+= SUFX64=-64
99.else 114.else
100PLIST_SUBST+= SUFX64= 115PLIST_SUBST+= SUFX64=
101.endif 116.endif
102 117
103.include "../../mk/bsd.pkg.mk" 118.include "../../mk/bsd.pkg.mk"

cvs diff -r1.56 -r1.57 pkgsrc/lang/sbcl/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/sbcl/distinfo 2018/01/04 14:47:17 1.56
+++ pkgsrc/lang/sbcl/distinfo 2018/10/17 12:59:49 1.57
@@ -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
3SHA1 (sbcl-1.4.3-source.tar.bz2) = cf610061ee2e8bf90efcf830f45412b68f43d0dc 3SHA1 (sbcl-1.4.3-source.tar.bz2) = cf610061ee2e8bf90efcf830f45412b68f43d0dc
4RMD160 (sbcl-1.4.3-source.tar.bz2) = eb3024ae6980239c6784ee4d234874782870cca4 4RMD160 (sbcl-1.4.3-source.tar.bz2) = eb3024ae6980239c6784ee4d234874782870cca4
5SHA512 (sbcl-1.4.3-source.tar.bz2) = e730f4f095e2c3b52836df0beae08219a2e3883b4e20ba7303f24d8e51aec7c6d278ad6f9d57fac36b5aebec3fefb118d07bfd4ca48a44a3324345f2993fca62 5SHA512 (sbcl-1.4.3-source.tar.bz2) = e730f4f095e2c3b52836df0beae08219a2e3883b4e20ba7303f24d8e51aec7c6d278ad6f9d57fac36b5aebec3fefb118d07bfd4ca48a44a3324345f2993fca62
6Size (sbcl-1.4.3-source.tar.bz2) = 5953041 bytes 6Size (sbcl-1.4.3-source.tar.bz2) = 5953041 bytes
7SHA1 (patch-ab) = b087921f7317523fd78396518dfd2cb1c8e6d5f9 7SHA1 (patch-ab) = b087921f7317523fd78396518dfd2cb1c8e6d5f9
 8SHA1 (patch-src_runtime_GNUmakefile) = bb1fffdaa90897d4ddcaedc3d480778917348281
8SHA1 (patch-src_runtime_backtrace.c) = ba3d7d152b279652d7074ebc9ba615c9d899f35c 9SHA1 (patch-src_runtime_backtrace.c) = ba3d7d152b279652d7074ebc9ba615c9d899f35c
9SHA1 (patch-src_runtime_breakpoint.c) = 019d98692411b5701ce14c023ed3afab71033323 10SHA1 (patch-src_runtime_breakpoint.c) = 019d98692411b5701ce14c023ed3afab71033323
10SHA1 (patch-src_runtime_bsd-os.c) = 1c2bb3ce517aea03bbc4f09708e8300085253286 11SHA1 (patch-src_runtime_bsd-os.c) = 1c2bb3ce517aea03bbc4f09708e8300085253286
11SHA1 (patch-src_runtime_bsd-os.h) = df48abd32b3b89b9d8a0ba4068c6723bea6617d6 12SHA1 (patch-src_runtime_bsd-os.h) = df48abd32b3b89b9d8a0ba4068c6723bea6617d6
12SHA1 (patch-src_runtime_coreparse.c) = 46f8b5ebea5ba3db7baaed124aaf15f2686f7202 13SHA1 (patch-src_runtime_coreparse.c) = 46f8b5ebea5ba3db7baaed124aaf15f2686f7202
13SHA1 (patch-src_runtime_dynbind.c) = 44b96758392c8d71834e665dfd62bc7464a033c9 14SHA1 (patch-src_runtime_dynbind.c) = 44b96758392c8d71834e665dfd62bc7464a033c9
14SHA1 (patch-src_runtime_gc-common.c) = e74f4537971ee61181f2ed9d1f88fedafd980a47 15SHA1 (patch-src_runtime_gc-common.c) = e74f4537971ee61181f2ed9d1f88fedafd980a47
15SHA1 (patch-src_runtime_gencgc.c) = 6862366d1998205f6bcf9cfded9acda1d03a2f52 16SHA1 (patch-src_runtime_gencgc.c) = 6862366d1998205f6bcf9cfded9acda1d03a2f52
16SHA1 (patch-src_runtime_globals.c) = ad8aedc43460892edb96e55276f1343abda2b7f5 17SHA1 (patch-src_runtime_globals.c) = ad8aedc43460892edb96e55276f1343abda2b7f5
17SHA1 (patch-src_runtime_interr.c) = a12a0a6826d7dd506d6012f10f69862f2a551174 18SHA1 (patch-src_runtime_interr.c) = a12a0a6826d7dd506d6012f10f69862f2a551174
18SHA1 (patch-src_runtime_interrupt.c) = c6675f60565cc411a34e58927c9ca2510f822328 19SHA1 (patch-src_runtime_interrupt.c) = c6675f60565cc411a34e58927c9ca2510f822328
19SHA1 (patch-src_runtime_monitor.c) = cdf86207600a387fb092fa8018dd5a08f8c9f4f2 20SHA1 (patch-src_runtime_monitor.c) = cdf86207600a387fb092fa8018dd5a08f8c9f4f2
20SHA1 (patch-src_runtime_os-common.c) = 966e3d23e3b7024c4c6b4e1c704a505b1a56008f 21SHA1 (patch-src_runtime_os-common.c) = 966e3d23e3b7024c4c6b4e1c704a505b1a56008f

File Added: pkgsrc/lang/sbcl/patches/Attic/patch-src_runtime_GNUmakefile
$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.