From b803725a77d8d7835ef369f3a13b2fc269a0761f Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Sun, 13 Nov 2022 12:55:14 +0000 Subject: [PATCH] TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. gcl (2.6.12-120) unstable; urgency=medium * Version_2.6.13pre119 Gbp-Pq: Name Version_2_6_13pre120 --- configure | 63 +++++++++++++++++++++++++++++++++++++++++++++----- configure.in | 39 +++++++++++++++++++++++++++---- h/compbas.h | 2 +- h/gclincl.h.in | 25 ++++++++++---------- h/linux.h | 4 ++-- h/lu.h | 6 +++++ h/type.h | 2 +- o/usig.c | 10 ++++---- o/utils.c | 4 +--- 9 files changed, 119 insertions(+), 36 deletions(-) diff --git a/configure b/configure index 1a7939a..6480209 100755 --- a/configure +++ b/configure @@ -703,8 +703,8 @@ GMPDIR GMP HAVE_MALLOC_ZONE_MEMALIGN MAKEINFO -AWK GCL_CC +AWK CPP OBJEXT EXEEXT @@ -4418,11 +4418,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -GCL_CC=`basename $CC` -if echo $GCL_CC |grep gcc |grep -q win; then - GCL_CC=gcc -fi - add_arg_to_cflags() { @@ -4557,6 +4552,56 @@ add_args_to_cflags -fsigned-char -pipe -fcommon \ add_args_to_ldflags -no-pie # -Wl,-z,lazy +CC=gcc +GCL_CC=gcc + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline semantics" >&5 +printf %s "checking for inline semantics... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + extern inline int foo(int i) {return i;} + + int + bar(int i) {return foo(i);} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if ! `nm conftest.o |grep -q "T foo"` ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: old" >&5 +printf "%s\n" "old" >&6; } + +printf "%s\n" "#define OLD_INLINE 1" >>confdefs.h + + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + inline int foo(int i) {return i;} + + int + bar(int i) {return foo(i);} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if ! `nm conftest.o |grep -q "T foo"` ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: new" >&5 +printf "%s\n" "new" >&6; } + else + as_fn_error $? "need working inline semantics" "$LINENO" 5 + fi +else $as_nop + as_fn_error $? "need to probe inline semantics" "$LINENO" 5 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +else $as_nop + as_fn_error $? "need to probe inline semantics" "$LINENO" 5 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 printf %s "checking for clang... " >&6; } if test "$cross_compiling" = yes @@ -4694,6 +4739,12 @@ fi test -n "$AWK" && break done +GCL_CC_ARGS=`echo $CC | ${AWK} '{$1="";print}'` +GCL_CC="`basename $CC` $GCL_CC_ARGS" +if echo $GCL_CC |grep gcc |grep -q win; then + GCL_CC=gcc +fi + # Check whether --enable-gprof was given. if test ${enable_gprof+y} diff --git a/configure.in b/configure.in index 1626054..08c1459 100644 --- a/configure.in +++ b/configure.in @@ -181,11 +181,6 @@ fi AC_PROG_CC AC_PROG_CPP AC_SUBST(CC) -GCL_CC=`basename $CC` -if echo $GCL_CC |grep gcc |grep -q win; then - GCL_CC=gcc -fi -AC_SUBST(GCL_CC) add_arg_to_cflags() { @@ -268,6 +263,34 @@ add_args_to_cflags -fsigned-char -pipe -fcommon \ add_args_to_ldflags -no-pie # -Wl,-z,lazy +AC_MSG_CHECKING([for inline semantics]) +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ + extern inline int foo(int i) {return i;} + + int + bar(int i) {return foo(i);} + ]])], + [if ! `nm conftest.o |grep -q "T foo"` ; then + AC_MSG_RESULT([old]) + AC_DEFINE([OLD_INLINE],[1],[extern inline semantics]) + else + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ + inline int foo(int i) {return i;} + + int + bar(int i) {return foo(i);} + ]])], + [if ! `nm conftest.o |grep -q "T foo"` ; then + AC_MSG_RESULT([new]) + else + AC_MSG_ERROR([need working inline semantics]) + fi], + [AC_MSG_ERROR([need to probe inline semantics])]) + fi], + [AC_MSG_ERROR([need to probe inline semantics])]) + AC_MSG_CHECKING([for clang]) AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ @@ -329,6 +352,12 @@ case "$use" in esac AC_CHECK_PROGS(AWK,[gawk nawk awk]) +GCL_CC_ARGS=`echo $CC | ${AWK} '{$1="";print}'` +GCL_CC="`basename $CC` $GCL_CC_ARGS" +if echo $GCL_CC |grep gcc |grep -q win; then + GCL_CC=gcc +fi +AC_SUBST(GCL_CC) AC_ARG_ENABLE([gprof],[ --enable-gprof builds gcl with -pg in CFLAGS to enable profiling with gprof], [if test "$enableval" = "yes" ; then diff --git a/h/compbas.h b/h/compbas.h index 9ee6f69..dc7b0e9 100755 --- a/h/compbas.h +++ b/h/compbas.h @@ -4,7 +4,7 @@ #define EXTER extern #endif #ifndef INLINE -#if (defined(__GNUC__) && __GNUC__ <= 4) && !defined __clang__ +#ifdef OLD_INLINE #define INLINE extern inline #else #define INLINE inline diff --git a/h/gclincl.h.in b/h/gclincl.h.in index 5465feb..4686d4e 100644 --- a/h/gclincl.h.in +++ b/h/gclincl.h.in @@ -21,11 +21,6 @@ /* running clang compiler */ #undef CLANG -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - /* cstack max */ #undef CSTACKMAX @@ -41,7 +36,7 @@ /* whether C stack grows up or down */ #undef CSTACK_DIRECTION -/* Define to 1 if using `alloca.c'. */ +/* Define to 1 if using 'alloca.c'. */ #undef C_ALLOCA /* debug safecdr code */ @@ -62,11 +57,10 @@ /* using gmp */ #undef GMP -/* Define to 1 if you have `alloca', as a function or macro. */ +/* Define to 1 if you have 'alloca', as a function or macro. */ #undef HAVE_ALLOCA -/* Define to 1 if you have and it should be used (not on Ultrix). - */ +/* Define to 1 if works. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ @@ -171,9 +165,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have the `mprotect' function. */ #undef HAVE_MPROTECT @@ -216,6 +207,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -318,6 +312,9 @@ /* needed object alignment bytes */ #undef OBJ_ALIGNMENT +/* extern inline semantics */ +#undef OLD_INLINE + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT @@ -368,7 +365,9 @@ /* staticly linked images */ #undef STATIC_LINKING -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* have _cleanup function */ diff --git a/h/linux.h b/h/linux.h index 3c94d8d..271310a 100644 --- a/h/linux.h +++ b/h/linux.h @@ -146,10 +146,10 @@ do { int c = 0; \ /* #define FPE_CODE(i_) make_fixnum((fixnum)SF(i_)->si_code) */ #ifdef __i386__ -#define FPE_CODE(i_,v_) make_fixnum(FFN(fSfpe_code)(UC(v_)->uc_mcontext.fpregs->sw,((struct _fpstate *)UC(v_)->uc_mcontext.fpregs)->mxcsr)) +#define FPE_CODE(i_,v_) make_fixnum((long)FFN(fSfpe_code)(UC(v_)->uc_mcontext.fpregs->sw,((struct _fpstate *)UC(v_)->uc_mcontext.fpregs)->mxcsr)) #define FPE_ADDR(i_,v_) make_fixnum((UC(v_)->uc_mcontext.fpregs->tag!=-1) ? UC(v_)->uc_mcontext.fpregs->ipoff : (fixnum)SF(i_)->si_addr) #else -#define FPE_CODE(i_,v_) make_fixnum(FFN(fSfpe_code)(UC(v_)->uc_mcontext.fpregs->swd,((struct _fpstate *)UC(v_)->uc_mcontext.fpregs)->mxcsr)) +#define FPE_CODE(i_,v_) make_fixnum((long)FFN(fSfpe_code)(UC(v_)->uc_mcontext.fpregs->swd,((struct _fpstate *)UC(v_)->uc_mcontext.fpregs)->mxcsr)) #define FPE_ADDR(i_,v_) make_fixnum(UC(v_)->uc_mcontext.fpregs->fop ? UC(v_)->uc_mcontext.fpregs->rip : (fixnum)SF(i_)->si_addr) #endif #define FPE_CTXT(v_) list(3,make_fixnum((fixnum)&UC(v_)->uc_mcontext.gregs), \ diff --git a/h/lu.h b/h/lu.h index 93aed56..d8c2a44 100644 --- a/h/lu.h +++ b/h/lu.h @@ -13,6 +13,7 @@ typedef float shortfloat; typedef double longfloat; typedef union lispunion *object; +typedef union typeunion *hobj; #ifndef WORDS_BIGENDIAN @@ -431,3 +432,8 @@ union lispunion { struct sfarray sfa; struct lfarray lfa; }; + +union typeunion { + struct dummy d; + fixnum fw; +}; diff --git a/h/type.h b/h/type.h index 707a7cb..548e87f 100644 --- a/h/type.h +++ b/h/type.h @@ -100,7 +100,7 @@ enum smmode { /* stream mode */ #endif /*Note preserve sgc flag here VVV*/ -#define set_type_of(x,y) ({object _x=(object)(x);enum type _y=(y);_x->d.f=0;\ +#define set_type_of(x,y) ({hobj _x=(hobj)(x);enum type _y=(y);_x->d.f=0; \ if (TYPEWORD_TYPE_P(_y)) {_x->d.e=1;_x->d.t=_y;_x->fw|=(fixnum)OBJNULL;}}) #ifndef WIDE_CONS diff --git a/o/usig.c b/o/usig.c index 1e64e08..3495d31 100755 --- a/o/usig.c +++ b/o/usig.c @@ -214,11 +214,11 @@ DEFUN_NEW("FEDISABLEEXCEPT",object,fSfedisableexcept,SI,0,0,NONE,IO,OO,OO,OO,(vo DEFUN_NEW("FPE_CODE",object,fSfpe_code,SI,2,2,NONE,II,OO,OO,OO,(fixnum x87sw,fixnum mxcsr),"") { - RETURN1((object)(FE_TEST(x87sw,mxcsr,FE_INVALID) ? FPE_FLTINV : - (FE_TEST(x87sw,mxcsr,FE_DIVBYZERO) ? FPE_FLTDIV : - (FE_TEST(x87sw,mxcsr,FE_OVERFLOW) ? FPE_FLTOVF : - (FE_TEST(x87sw,mxcsr,FE_UNDERFLOW) ? FPE_FLTUND : - (FE_TEST(x87sw,mxcsr,FE_INEXACT) ? FPE_FLTRES : 0)))))); + RETURN1((object)(long)(FE_TEST(x87sw,mxcsr,FE_INVALID) ? FPE_FLTINV : + (FE_TEST(x87sw,mxcsr,FE_DIVBYZERO) ? FPE_FLTDIV : + (FE_TEST(x87sw,mxcsr,FE_OVERFLOW) ? FPE_FLTOVF : + (FE_TEST(x87sw,mxcsr,FE_UNDERFLOW) ? FPE_FLTUND : + (FE_TEST(x87sw,mxcsr,FE_INEXACT) ? FPE_FLTRES : 0)))))); } #if defined(__MINGW32__) || defined(__CYGWIN__) diff --git a/o/utils.c b/o/utils.c index 14e458c..711ccbd 100755 --- a/o/utils.c +++ b/o/utils.c @@ -69,9 +69,7 @@ Ifuncall_n(object fun,int n,...) { va_list ap; object *new; va_start(ap,n); - { - COERCE_VA_LIST(new,ap,n); - } + COERCE_VA_LIST(new,ap,n); va_end(ap); return IapplyVector(fun,n,new); } -- 2.30.2