Skip to content

Commit

Permalink
Two configuration fixes (bignums and libbacktrace) (bootstrap)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-serrano committed Dec 12, 2024
1 parent 8c9b57f commit 67446e4
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 39 deletions.
6 changes: 3 additions & 3 deletions autoconf/libbacktrace
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#* ------------------------------------------------------------- */
#* Author : Jose Romildo */
#* Creation : Sat Nov 11 13:27:23 1995 */
#* Last change : Wed Dec 11 17:24:00 2024 (serrano) */
#* Last change : Thu Dec 12 11:26:59 2024 (serrano) */
#* ------------------------------------------------------------- */
#* Check for the host libbacktrace library. */
#*=====================================================================*/
Expand All @@ -13,7 +13,7 @@
#* flags */
#*---------------------------------------------------------------------*/
cflags=
libbacktracelib="libbacktrace"
libbacktracelib="backtrace"
type=

#*---------------------------------------------------------------------*/
Expand Down Expand Up @@ -63,7 +63,7 @@ static void cbe(void *data, const char *msg, int errnum) {
int main( int argc, char *argv[] ) {
struct backtrace_state *bt_state = backtrace_create_state(0L, 0, cbe, 0L);
return bt_state != 0;
return bt_state == 0;
}
EOF

Expand Down
68 changes: 34 additions & 34 deletions bdb/blib/table.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*=====================================================================*/
/* serrano/prgm/project/bigloo/bdb/blib/table.c */
/* serrano/prgm/project/bigloo/bigloo/bdb/blib/table.c */
/* ------------------------------------------------------------- */
/* Author : unknown */
/* Creation : Wed Jul 28 07:20:32 1999 */
/* Last change : Wed Jul 12 10:39:47 2000 (serrano) */
/* Last change : Thu Dec 12 10:20:58 2024 (serrano) */
/* ------------------------------------------------------------- */
/* The mangling/demangling table management. */
/* ------------------------------------------------------------- */
Expand All @@ -25,7 +25,7 @@ struct bdb_fun_info { char *sname, *cname; };
/* the table that has been build by the compiler in -gbdb mode. */
/*---------------------------------------------------------------------*/
obj_t
bdb_table_to_list( obj_t bdb ) {
bdb_table_to_list(obj_t bdb) {
obj_t cla_info = BNIL;
obj_t glo_info = BNIL;
obj_t mod_info = BNIL;
Expand All @@ -38,38 +38,38 @@ bdb_table_to_list( obj_t bdb ) {
/* we start reading the signature for the table in, */
/* just to check that the compiled table format is */
/* compatible with this version of blib. */
if( !(table_entry->sname == BDB_LIBRARY_MAGIC_NUMBER) ||
!(table_entry->cname == BDB_LIBRARY_MAGIC_NUMBER) ) {
fprintf( stderr,
if (!((long)table_entry->sname == BDB_LIBRARY_MAGIC_NUMBER) ||
!((long)table_entry->cname == BDB_LIBRARY_MAGIC_NUMBER)) {
fprintf(stderr,
"***ERROR: Incompatible versions -- "
"Bigloo compiler/Bdb library");
exit( -1 );
exit(-1);
} else {
table_entry++;
}

/* we start fetching the module name and its */
/* C initialization function. */
mod_info = string_to_bstring( table_entry->sname );
init_info = string_to_bstring( table_entry->cname );
mod_info = string_to_bstring(table_entry->sname);
init_info = string_to_bstring(table_entry->cname);
table_entry++;

/* and the source files implementing this module. */
while( ((int *)table_entry->sname) ) {
while (((int *)table_entry->sname)) {
obj_t pair = MAKE_PAIR(string_to_bstring(table_entry->sname), src_info);
src_info = pair;

table_entry++;
}

mod_lnum = (long)table_entry->cname;
src_info = MAKE_PAIR( init_info, src_info );
lnum_info = MAKE_PAIR( BINT( mod_lnum ), src_info );
mod_info = MAKE_PAIR( mod_info, lnum_info );
src_info = MAKE_PAIR(init_info, src_info);
lnum_info = MAKE_PAIR(BINT(mod_lnum), src_info);
mod_info = MAKE_PAIR(mod_info, lnum_info);
table_entry++;

/* then we fetch global variables informations */
while( *((int *)table_entry) && table_entry->sname ) {
while (*((int *)table_entry) && table_entry->sname) {
char *fname, *sname, *cname;
long lnum;
obj_t pair = BNIL;
Expand All @@ -85,7 +85,7 @@ bdb_table_to_list( obj_t bdb ) {
cname = table_entry->cname;

/* is it a global function or a global variable ? */
if( !cname ) {
if (!cname) {
/* thie is a global function */
char *bp_cname;
obj_t pair2;
Expand All @@ -95,50 +95,50 @@ bdb_table_to_list( obj_t bdb ) {
cname = table_entry->sname;
bp_cname = table_entry->cname;

pair2 = MAKE_PAIR( cname ? string_to_bstring( cname ) : BUNSPEC,
BINT( lnum ) );
pair2 = MAKE_PAIR( pair2, string_to_bstring( bp_cname ) );
pair2 = MAKE_PAIR(cname ? string_to_bstring(cname) : BUNSPEC,
BINT(lnum));
pair2 = MAKE_PAIR(pair2, string_to_bstring(bp_cname));
table_entry++;

/* this is a global function, we are now free */
/* to parse the local variables */
while( table_entry->sname ) {
pair = MAKE_PAIR( string_to_bstring( table_entry->sname ),
string_to_bstring( table_entry->cname ) );
while (table_entry->sname) {
pair = MAKE_PAIR(string_to_bstring(table_entry->sname),
string_to_bstring(table_entry->cname));

entry = MAKE_PAIR( pair, entry );
entry = MAKE_PAIR(pair, entry);

table_entry++;
}

pair2 = MAKE_PAIR( pair2, BNIL );
pair = MAKE_PAIR( string_to_bstring( sname ), pair2 );
pair2 = MAKE_PAIR(pair2, BNIL);
pair = MAKE_PAIR(string_to_bstring(sname), pair2);
} else {
/* this is a global variable. */
pair = MAKE_PAIR( string_to_bstring( sname ),
string_to_bstring( cname ) );
pair = MAKE_PAIR(string_to_bstring(sname),
string_to_bstring(cname));
}

entry = MAKE_PAIR( pair, entry );
entry = MAKE_PAIR( string_to_bstring( fname ), entry );
entry = MAKE_PAIR(pair, entry);
entry = MAKE_PAIR(string_to_bstring(fname), entry);

table_entry++;
glo_info = MAKE_PAIR( entry, glo_info );
glo_info = MAKE_PAIR(entry, glo_info);
}
table_entry++;

/* then we fetch classes information */
while( *((int *)table_entry) && table_entry->sname ) {
cla_info = MAKE_PAIR( string_to_bstring( table_entry->sname ),
cla_info );
while (*((int *)table_entry) && table_entry->sname) {
cla_info = MAKE_PAIR(string_to_bstring(table_entry->sname),
cla_info);
table_entry++;
}

/* We now build the returned list to Bdb */
{
obj_t aux;

aux = MAKE_PAIR( glo_info, cla_info );
return MAKE_PAIR( mod_info, aux );
aux = MAKE_PAIR(glo_info, cla_info);
return MAKE_PAIR(mod_info, aux);
}
}
3 changes: 2 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#* ------------------------------------------------------------- */
#* Author : Manuel Serrano */
#* Creation : Tue Jan 25 16:05:10 1994 */
#* Last change : Thu Dec 12 08:19:46 2024 (serrano) */
#* Last change : Thu Dec 12 12:08:21 2024 (serrano) */
#* Last change : Thu May 14 09:43:33 2020 (serrano) */
#* Copyright : 1994-2024 Manuel Serrano, see LICENSE file */
#* ------------------------------------------------------------- */
Expand Down Expand Up @@ -4854,6 +4854,7 @@ if [ $action = "all" -o $action = "Makefile.config" ]; then
$echo "LIBBACKTRACEBOOTINCDIR=$bootdir/libbacktrace/libbacktrace-$libbacktraceversion" >> $makefile_cfg
else
$echo "LIBBACKTRACECUSTOM=no" >> $makefile_cfg
$echo "LIBBACKTRACECUSTOMVERSION=$libbacktraceversion" >> $makefile_cfg
$echo "LIBBACKTRACEBOOTINCDIR=." >> $makefile_cfg
fi

Expand Down
7 changes: 6 additions & 1 deletion runtime/Include/bigloo_bignum.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* ------------------------------------------------------------- */
/* Author : Manuel Serrano */
/* Creation : Wed Jul 26 08:58:25 2017 */
/* Last change : Thu Dec 12 08:54:12 2024 (serrano) */
/* Last change : Thu Dec 12 11:45:51 2024 (serrano) */
/* Copyright : 2017-24 Manuel Serrano */
/* ------------------------------------------------------------- */
/* Bigloo BIGNUMs */
Expand Down Expand Up @@ -93,6 +93,11 @@ extern obj_t bgl_safe_quotient_llong(BGL_LONGLONG_T, BGL_LONGLONG_T);
#else
# define BGL_BIGNUM_U16VECT(bx) (BIGNUM(bx).u16vect)
// since bigloo4.6a, the fx-functions are implemented in bignumber-generic.sch
extern obj_t BGL_SAFE_BX_TO_FX(obj_t);
extern obj_t BGL_SAFE_PLUS_FX(long, long);
extern obj_t BGL_SAFE_MINUS_FX(long, long);
extern obj_t BGL_SAFE_MUL_FX(long, long);
extern obj_t BGL_SAFE_QUOTIENT_FX(long, long);
/* # define BGL_SAFE_BX_TO_FX(x) (x) */
/* # define BGL_SAFE_PLUS_FX(x, y) BINT((x) + (y)) */
/* # define BGL_SAFE_MINUS_FX(x, y) BINT((x) - (y)) */
Expand Down

0 comments on commit 67446e4

Please sign in to comment.