Greetings! Could you please try configure once more to see if readline is fixed.
Made a commit to hopefully address 2). Alas your patch will not work where gprof is enabled. At some point if you could post a gdb backtrace of the failure in 3) that would be most helpful. The pre_gcl compile is slow. The final build should be about 10min. Take care, "Kirill A. Korinsky" <kir...@korins.ky> writes: > I've used f123e3d0df9201082c9168671e103dd8835cb81f as local root. > > 1. ./configure still doesn't work well with readline and failed like this: > > checking for rl_completion_matches in -lreadline... yes > checking RL_COMPLETION_ENTRY_FUNCTION_TYPE_FUNCTION... no > checking RL_COMPLETION_ENTRY_FUNCTION_TYPE_RL_COMPENTRY_FUNC_T... no > configure: error: Unknown rl_completion_entry_function return type > > I've attached a patch which I've used to bypass it. > > 2. anyway, gprof aren't disabled completley; build failed with error: > > error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: > ../o/gprof.o is not an object file (not allowed in a library) > make[1]: *** [libpre_gcl.a] Error 1 > > and here the second patch attached. > > 3. after that build failed like this: > >>;; Loading "boot.lisp" > ;; Compiling > /opt/local/var/macports/build/_Users_catap_src_macports-ports_lang_gcl/gcl-devel/work/.tmp/gazonk_9510_0.lsp. > ;; End of Pass 1. > ;; End of Pass 2. > > Error: ERROR "Caught fatal error [memory may be damaged]: Segmentation > violation." > Signalled by MULTIPLE-VALUE-BIND. > Segmentation violation: c stack ok:signalling errorERROR "Caught fatal error > [memory may be damaged]: Segmentation violation." > > Broken at LET*. Type :H for Help. > 1 Return to top level. > COMPILER>>make: *** [unixport/saved_gcl0] Error 255 > > and if I apply patch > https://github.com/macports/macports-ports/blob/master/lang/gcl/files/fix-memory-corruption-on-macOS.patch > it start to build. > > The build was for about two hours with output like: > > OPTIMIZE levels: Safety=3, Space=0, Speed=3 > ;; Finished compiling > /opt/local/var/macports/build/_Users_catap_src_macports-ports_lang_gcl/gcl-devel/work/f123e3d0df9201082c9168671e103dd8835cb81f/gcl/lsp/gcl_c.o. > real time : 35.360 secs > run-gbc time : 27.820 secs > child run time : 0.200 secs > gbc time : 0.000 secs > ;; Compiling ../lsp/gcl_listlib.lsp. > [GC for 85 STRUCTURE pages..(T=304).GC finished] > [GC for 4171976 CONS pages..(T=273).GC finished] > [GC for 85 STRUCTURE pages..(T=338).GC finished] > [GC for 86 STRUCTURE pages..(T=241).GC finished] > [GC for 97 STRUCTURE pages..(T=257).GC finished] > [GC for 1653 RELOCATABLE-BLOCKS pages..(T=227).GC finished] > [GC for 119 STRUCTURE pages..(T=223).GC finished] > [GC for 130 STRUCTURE pages..(T=244).GC finished] > [GC for 143 STRUCTURE pages..(T=327).GC finished] > [GC for 154 STRUCTURE pages..(T=299).GC finished] > [GC for 164 STRUCTURE pages..(T=265).GC finished] > [GC for 173 STRUCTURE pages..(T=258).GC finished] > ;; End of Pass 1. > [GC for 4171976 CONS pages..(T=241).GC finished] > [GC for 1653 RELOCATABLE-BLOCKS pages..(T=244).GC finished] > [GC for 4171976 CONS pages..(T=383).GC finished] > [GC for 4171976 SPICE pages..(T=268).GC finished] > [GC for 4171976 CONS pages..(T=237).GC finished] > ;; End of Pass 2. > OPTIMIZE levels: Safety=3, Space=0, Speed=3 > ;; Finished compiling > /opt/local/var/macports/build/_Users_catap_src_macports-ports_lang_gcl/gcl-devel/work/f123e3d0df9201082c9168671e103dd8835cb81f/gcl/lsp/gcl_listlib.o. > real time : 1256.190 secs > run-gbc time : 921.810 secs > child run time : 2.860 secs > gbc time : 46.290 secs > ;; Compiling ../lsp/gcl_predlib.lsp. > > I think that increase memory usage may speed up build, am I wrong? > > Anyway, the build failed with error: > > real time : 4.590 secs > run-gbc time : 3.200 secs > child run time : 1.100 secs > gbc time : 0.000 secs > ;; Compiling ../lsp/gcl_mnum.lsp. > > Error: ERROR "There is no package with the name \"libc\"." > Fast links are on: do (si::use-fast-links nil) for debugging > Signalled by MULTIPLE-VALUE-CALL. > ERROR "There is no package with the name \"libc\"." > > Broken at FUNCALL. Type :H for Help. > 1 Return to top level. > SYSTEM>>make: *** [unixport/saved_gcl0] Error 255 > > Thus, the patch about memory corruption contains two hunk. Without the second > one build failed as (3), and I've just tested it > >>;; Loading "boot.lisp" > ;; Compiling > /opt/local/var/macports/build/_Users_catap_src_macports-ports_lang_gcl/gcl-devel/work/.tmp/gazonk_25122_0.lsp. > ;; End of Pass 1. > ;; End of Pass 2. > > Error: ERROR "Caught fatal error [memory may be damaged]: Segmentation > violation." > Signalled by MULTIPLE-VALUE-BIND. > Segmentation violation: c stack ok:signalling errorERROR "Caught fatal error > [memory may be damaged]: Segmentation violation." > > Broken at LET*. Type :H for Help. > 1 Return to top level. > COMPILER>>make: *** [unixport/saved_gcl0] Error 255 > rm h/mcompdefs.h > > and without the first one, if I recall right, it's failed near the similar > way but at the end, when it saves the image. > > -- > wbr, Kirill > > From cd996356594e145b15fb93c7db8255b10d2f0b09 Mon Sep 17 00:00:00 2001 > From: "Kirill A. Korinsky" <kir...@korins.ky> > Date: Thu, 21 Dec 2023 18:01:59 +0100 > Subject: [PATCH 1/2] macOS-friendly check for readline > > --- > gcl/configure | 4 ++++ > gcl/configure.in | 4 ++++ > 2 files changed, 8 insertions(+) > > diff --git gcl/configure gcl/configure > index 4d38e9cca..8a6d4e725 100755 > --- gcl/configure > +++ gcl/configure > @@ -9841,6 +9841,7 @@ printf %s "checking > RL_COMPLETION_ENTRY_FUNCTION_TYPE_FUNCTION... " >&6; } > cat confdefs.h - <<_ACEOF >conftest.$ac_ext > /* end confdefs.h. */ > > + #include <stdio.h> > #include > <readline/readline.h> > extern Function > *rl_completion_entry_function __attribute__((weak)); > > @@ -9867,6 +9868,7 @@ printf %s "checking > RL_COMPLETION_ENTRY_FUNCTION_TYPE_RL_COMPENTRY_FUNC_T... " > > cat confdefs.h - <<_ACEOF > >conftest.$ac_ext > /* end confdefs.h. */ > > + #include <stdio.h> > #include > <readline/readline.h> > extern > rl_compentry_func_t *rl_completion_entry_function __attribute__((weak)); > > @@ -9899,6 +9901,7 @@ printf %s "checking RL_READLINE_NAME_TYPE_CHAR... " > >&6; } > cat confdefs.h - <<_ACEOF >conftest.$ac_ext > /* end confdefs.h. */ > > + #include <stdio.h> > #include <readline/readline.h> > extern char *rl_readline_name > __attribute__((weak)); > > @@ -9925,6 +9928,7 @@ printf %s "checking RL_READLINE_NAME_TYPE_CONST_CHAR... > " >&6; } > cat confdefs.h - <<_ACEOF > >conftest.$ac_ext > /* end confdefs.h. */ > > + #include <stdio.h> > #include > <readline/readline.h> > extern const char > *rl_readline_name __attribute__((weak)); > > diff --git gcl/configure.in gcl/configure.in > index cfafd3983..eebbcb2d2 100644 > --- gcl/configure.in > +++ gcl/configure.in > @@ -1895,6 +1895,7 @@ if test "$enable_readline" != "no" ; then > AC_COMPILE_IFELSE( > [AC_LANG_PROGRAM( > [[ > + #include <stdio.h> > #include > <readline/readline.h> > extern Function > *rl_completion_entry_function __attribute__((weak)); > ]], > @@ -1906,6 +1907,7 @@ if test "$enable_readline" != "no" ; then > AC_COMPILE_IFELSE( > [AC_LANG_PROGRAM( > [[ > + #include <stdio.h> > #include > <readline/readline.h> > extern > rl_compentry_func_t *rl_completion_entry_function __attribute__((weak)); > ]], > @@ -1919,6 +1921,7 @@ if test "$enable_readline" != "no" ; then > AC_COMPILE_IFELSE( > [AC_LANG_PROGRAM( > [[ > + #include <stdio.h> > #include <readline/readline.h> > extern char *rl_readline_name > __attribute__((weak)); > ]], > @@ -1930,6 +1933,7 @@ if test "$enable_readline" != "no" ; then > AC_COMPILE_IFELSE( > [AC_LANG_PROGRAM( > [[ > + #include <stdio.h> > #include > <readline/readline.h> > extern const char > *rl_readline_name __attribute__((weak)); > ]], > -- > 2.43.0 > > > From 5c7349872d919c2d7ee8ceb055203029b59e3ded Mon Sep 17 00:00:00 2001 > From: "Kirill A. Korinsky" <kir...@korins.ky> > Date: Thu, 21 Dec 2023 18:53:54 +0100 > Subject: [PATCH 2/2] Completley disable gprof > > --- > gcl/configure.in | 2 +- > gcl/o/makefile | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git gcl/configure.in gcl/configure.in > index eebbcb2d2..66ee6d4ea 100644 > --- gcl/configure.in > +++ gcl/configure.in > @@ -385,7 +385,7 @@ fi > AC_SUBST(GCL_CC) > > > -GPROF="gprof_objs" > +GPROF="gprof" > AC_ARG_ENABLE([gprof],[ --enable-gprof builds gcl with -pg in CFLAGS to > enable profiling with gprof], > [if test "$enableval" != "yes" ; then GPROF=""; fi]) > > diff --git gcl/o/makefile gcl/o/makefile > index b0625769f..d733e0b9f 100644 > --- gcl/o/makefile > +++ gcl/o/makefile > @@ -22,7 +22,7 @@ OBJS:=$(addsuffix .o,typespec alloc gbc bitop boot main > eval macros lex bds fram > hash array string regexpr structure toplevel file read backq print > format\ > pathname unixfsys unixfasl error unixtime unixsys unixsave funlink > fat_string\ > run_process nfunlink usig usig2 utils makefun sockets gmp_wrappers > clxsocket\ > - init_pari nsocket new_init prelink sfasl gprof $(RL_OBJS)) > + init_pari nsocket new_init prelink sfasl $(RL_OBJS)) > OBJS:=$(OBJS) $(EXTRAS) > > INI_FILES=$(patsubst %.o,%.ini,${OBJS}) > @@ -30,7 +30,7 @@ INI_FILES:=$(filter-out new_init.ini,$(filter-out > boot.ini,$(INI_FILES))) > > OBJECTS:=$(OBJS) $(LIBFILES) new_init.o $(GCLIB) $(LAST_FILE) > $(FIRST_FILE) > > -all: $(OBJECTS) #$(GPROF) > +all: $(OBJECTS) $(GPROF) > > gprof_objs: $(addprefix ../gprof/,$(OBJECTS)) -- Camm Maguire c...@maguirefamily.org ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah