Greetings, and thanks so much! I think master should now address these issues. Please keep me informed.
Take care, "Kirill A. Korinsky" <kir...@korins.ky> writes: > With a few hacks (see attached patches) I was able to build it on macOS 12. > > Anyway, it failed on start as: > > cp init_raw.lsp foo > echo "(unless si::*quit-tags* (in-package \"USER\")(system:save-system > \"saved_pre_gcl\"))" >>foo > ar x libpre_gcl.a $(ar t libpre_gcl.a |grep ^gcl_) > /Users/catap/src/gcl/gcl/unixport/raw_pre_gcl > /Users/catap/src/gcl/gcl/unixport/ -libdir /Users/catap/src/gcl/gcl/ < foo > GCL (GNU Common Lisp) April 1994 9465290 pages > Building symbol table for /Users/catap/src/gcl/gcl/unixport/raw_pre_gcl .. > loading /Users/catap/src/gcl/gcl/unixport/../lsp/gcl_export.lsp > loading /Users/catap/src/gcl/gcl/unixport/../lsp/gcl_defmacro.lsp > loading /Users/catap/src/gcl/gcl/unixport/../lsp/gcl_evalmacros.lsp > loading /Users/catap/src/gcl/gcl/unixport/../lsp/gcl_top.lsp > UNDEFINED-FUNCTION NIL SETQ NAME KCL-SELF > Lisp initialization failed. > [ "" = "" ] || \ > ! [ -x /usr/bin/objdump ] || \ > ! /usr/bin/objdump -f saved_pre_gcl | grep "file format" | grep "elf" || \ > ! /usr/bin/objdump -R saved_pre_gcl |grep R_.*_COPY || \ > ! echo "saved_pre_gcl cannot be prelinked" > rm raw_pre_gcl > cd unixport && echo '(time (let ((*features* (cons :pre-gcl > *features*)))(load "boot.lisp")(si::save-system "saved_pre_gcl_temp")))' | > ./saved_pre_gcl > /bin/sh: ./saved_pre_gcl: No such file or directory > > -- > wbr, Kirill > > From e2bd77215300986fcf46f5202abe08833bcf6b4d Mon Sep 17 00:00:00 2001 > From: "Kirill A. Korinsky" <kir...@korins.ky> > Date: Thu, 21 Dec 2023 17:01:47 +0100 > Subject: [PATCH 1/5] Disable gprof on macOS by default > > --- > gcl/configure | 1 + > gcl/configure.in | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/gcl/configure b/gcl/configure > index 74100ec18..15573a0c6 100755 > --- a/gcl/configure > +++ b/gcl/configure > @@ -5742,6 +5742,7 @@ if test "$GPROF" != "" ; then > printf %s "checking working gprof... " >&6; } > case $use in > powerpc*) if test "$host_cpu" = "powerpc64le" ; then GPROF=""; fi;; > + *macos*) GPROF="";;#macOS uses clang by default which doesn't support > gprof for years > s390*) GPROF="";;#mcount smashes float args in make_shortfloat > 20180313 > sh4*) GPROF="";; > m68k*) GPROF="";; > diff --git a/gcl/configure.in b/gcl/configure.in > index 3cc62a06c..eabf55659 100644 > --- a/gcl/configure.in > +++ b/gcl/configure.in > @@ -391,6 +391,7 @@ if test "$GPROF" != "" ; then > AC_MSG_CHECKING([working gprof]) > case $use in > powerpc*) if test "$host_cpu" = "powerpc64le" ; then GPROF=""; fi;; > + *macos*) GPROF="";;#macOS uses clang by default which doesn't support > gprof for years > s390*) GPROF="";;#mcount smashes float args in make_shortfloat > 20180313 > sh4*) GPROF="";; > m68k*) GPROF="";; > -- > 2.43.0 > > > From 577fd4a6b3c7cd36f8d3d5fced25c0780ceb2f24 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 2/5] macOS-friendly check for readline > > --- > gcl/configure | 4 ++++ > gcl/configure.in | 4 ++++ > 2 files changed, 8 insertions(+) > > diff --git a/gcl/configure b/gcl/configure > index 15573a0c6..fabaad897 100755 > --- a/gcl/configure > +++ b/gcl/configure > @@ -9836,6 +9836,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)); > > @@ -9862,6 +9863,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)); > > @@ -9894,6 +9896,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)); > > @@ -9920,6 +9923,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 a/gcl/configure.in b/gcl/configure.in > index eabf55659..15a637f90 100644 > --- a/gcl/configure.in > +++ b/gcl/configure.in > @@ -1892,6 +1892,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)); > ]], > @@ -1903,6 +1904,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)); > ]], > @@ -1916,6 +1918,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)); > ]], > @@ -1927,6 +1930,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 b8876a37dc07fcebc9e7b179168db86a33f27a91 Mon Sep 17 00:00:00 2001 > From: "Kirill A. Korinsky" <kir...@korins.ky> > Date: Thu, 21 Dec 2023 18:12:53 +0100 > Subject: [PATCH 3/5] make moder clang happy > > --- > gcl/o/print.d | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gcl/o/print.d b/gcl/o/print.d > index 569d07eb5..1d944b746 100644 > --- a/gcl/o/print.d > +++ b/gcl/o/print.d > @@ -579,6 +579,7 @@ flush_queue(int force,struct printContext *p) { > if (flush_queue_indent(force,p)) return; > break; > case CURRENT: case BLOCK: > + { > short sh=p->b.p_queue[mod(p->b.p_qh+1)]; > if (p->b.p_qc<2) return; > sh<<=1;sh>>=1; > @@ -587,6 +588,7 @@ flush_queue(int force,struct printContext *p) { > p->b.p_indent_stack[p->b.p_isp] = sh; > flush_queue_flush(force,2,p); > break; > + } > case LINE:case SECTION:case LINE_RELATIVE:case SECTION_RELATIVE: > if (p->b.p_qc<3) return; > flush_queue_flush(force,3,p); > @@ -1680,6 +1682,7 @@ write_object(object x,int level) { > break; > > case t_structure: > + { > object y=structure_to_list(x); > if (PRINTcircle) > if (write_sharp_eq(x,FALSE)==DONE) return; > @@ -1707,6 +1710,7 @@ write_object(object x,int level) { > break; > } > break; > + } > > case t_readtable: > write_unreadable_str(x,"#<readtable "); > -- > 2.43.0 > > > From a5845d09971d0e9ee121424a8579e022a806bd86 Mon Sep 17 00:00:00 2001 > From: "Kirill A. Korinsky" <kir...@korins.ky> > Date: Thu, 21 Dec 2023 18:16:59 +0100 > Subject: [PATCH 4/5] Use FPE_SET_CTXT_ADDR and FPE_CLR_CTXT_CWD only when > defined > > --- > gcl/o/usig.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gcl/o/usig.c b/gcl/o/usig.c > index 66810c28f..3a83f2107 100644 > --- a/gcl/o/usig.c > +++ b/gcl/o/usig.c > @@ -232,8 +232,12 @@ sigfpe3(int sig,siginfo_t *i,void *v) { > #endif > ifuncall3(sSfloating_point_error,FPE_CODE(i,v),FPE_ADDR(i,v),FPE_CTXT(v)); > > +#ifdef FPE_SET_CTXT_ADDR > FPE_SET_CTXT_ADDR(v,FPE_ADDR(i,v)); > +#endif > +#ifdef FPE_CLR_CTXT_CWD > FPE_CLR_CTXT_CWD(v); > +#endif > > } > > -- > 2.43.0 > > > From 2c5c2c7362a6bd913fed16f8e250eae01d2ac241 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 5/5] Reallu disable gprof > > --- > gcl/configure.in | 3 ++- > gcl/o/main.c | 4 ++++ > gcl/o/makefile | 4 ++-- > 3 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/gcl/configure.in b/gcl/configure.in > index 15a637f90..3a2a9ac10 100644 > --- a/gcl/configure.in > +++ b/gcl/configure.in > @@ -383,7 +383,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]) > > @@ -408,6 +408,7 @@ if test "$GPROF" != "" ; then > OLD_CFLAGS=$CFLAGS # Do not run configure tests with -pg > assert_arg_to_cflags -pg > CFLAGS=$OLD_CFLAGS > + AC_DEFINE(USE_GPROF,1,[use gprof]) > fi > fi > AC_SUBST(GPROF) > diff --git a/gcl/o/main.c b/gcl/o/main.c > index ae93a228f..ba945bee0 100644 > --- a/gcl/o/main.c > +++ b/gcl/o/main.c > @@ -370,7 +370,9 @@ minimize_image(void) { > nrbpage=0; > resize_hole(0,t_relocatable,0); > > +#ifdef USE_GPROF > gprof_cleanup(); > +#endif > > #if defined(BSD) || defined(ATT) > mbrk(core_end=heap_end); > @@ -470,7 +472,9 @@ gcl_cleanup(int gc) { > {extern void _cleanup(void);_cleanup();} > #endif > > +#ifdef USE_GPROF > gprof_cleanup(); > +#endif > > if (gc) { > > diff --git a/gcl/o/makefile b/gcl/o/makefile > index 349d84d7a..5b1c7d56b 100644 > --- a/gcl/o/makefile > +++ b/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