Tuesday, April 28, 2020

Re: lang/clisp build failure

On Fri, 24 Apr 2020 13:59:14 +0100
Stuart Henderson <stu@spacehopper.org> wrote:

> > > > /usr/obj/ports/clisp-2.49/clisp-2.49/src/spvw.d:2881:47: error: use of undeclared identifier 'MAP_ANON'
> > > > mmap((void*)0xC0000000,0x20000000,PROT_NONE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0);
> > > > ^
> > > > /usr/obj/ports/clisp-2.49/clisp-2.49/src/unix.d:65:22: note: expanded from macro 'MAP_ANON'
> > > > #define MAP_ANON MAP_ANONYMOUS
> > > > ^
> > > > /usr/include/sys/mman.h:60:23: note: expanded from macro 'MAP_ANONYMOUS'
> > > > #define MAP_ANONYMOUS MAP_ANON /* alternate POSIX spelling */

> Noticable difference between working and failed builds is this:
>
> -checking for working shared memory... no
> +checking for working shared memory... yes

Some of these tests map memory at fixed addresses, and may yield a
random 'no' from conflict with ASLR. configure would say,
"working mmap... yes", if at least 1 of MAP_ANON, MAP_ANONYMOUS,
/dev/zero are working. If the random result was MAP_ANON 'no' and
MAP_ANONYMOUS 'yes', then you might get the above error.

This diff overrides the tests. OK to commit?

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/clisp/Makefile,v
retrieving revision 1.53
diff -u -p -r1.53 Makefile
--- Makefile 6 Apr 2020 01:25:18 -0000 1.53
+++ Makefile 29 Apr 2020 02:41:25 -0000
@@ -5,7 +5,7 @@ ONLY_FOR_ARCHS = amd64 i386 powerpc spar
COMMENT = ANSI Common Lisp implementation

DISTNAME= clisp-2.49
-REVISION = 4
+REVISION = 5
CATEGORIES= lang
HOMEPAGE= http://clisp.cons.org/

@@ -36,9 +36,17 @@ CONFIGURE_ARGS= --fsstnd=openbsd \
--srcdir=${WRKSRC} ${WRKBUILD} \
--without-dynamic-modules

+# Override some mmap, shm tests: their fixed addresses may conflict
+# with ASLR, and a random 'no' might break the build.
CONFIGURE_ENV = ac_cv_prog_DVIPDF='' \
ac_cv_prog_GROFF='' \
- ac_cv_prog_PS2PDF=''
+ ac_cv_prog_PS2PDF='' \
+ cl_cv_func_mmap_anon=yes \
+ cl_cv_func_mmap_anonymous=yes \
+ cl_cv_func_mmap_devzero=yes \
+ cl_cv_func_mmap_works=yes \
+ cl_cv_func_shmctl_attachable=yes \
+ cl_cv_sys_shm_works=yes

.if ${MACHINE_ARCH} == "sparc64"
CFLAGS += -DSAFETY=2 -DNO_ASM

No comments:

Post a Comment