- Adds the dependency on the Bash's libmalloc - Removes the libintl dependency, since it's unused - Adds the `running_trap' global variable, since libmalloc depends on it when the `SHELL' macro is defined (see [1]) - Removes compiler warning due to missing return type in main function
After these changes, the `hashtest' target can be built with: | dualbus@system76-pc:~/src/gnu/bash$ CC=gcc ./configure --silent --with-bash-malloc && make -j$(nproc) -s hashtest | | Beginning configuration for bash-5.0-rc1 for x86_64-pc-linux-gnu | | config.status: creating po/POTFILES | config.status: creating po/Makefile | ./parse.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] | | *********************************************************** | * * | * GNU bash, version 5.0.0(1)-rc1 (x86_64-pc-linux-gnu) | * * | *********************************************************** | | make[1]: warning: -j16 forced in submake: resetting jobserver mode. | | dualbus@system76-pc:~/src/gnu/bash$ echo hi | ./hashtest >/dev/null 2>&1; echo $? | 0 It doesn't work if `--without-bash-malloc' is specified. [1] /usr/bin/ld: ./lib/malloc/libmalloc.a(malloc.o): in function `morecore': /home/dualbus/src/gnu/bash/lib/malloc/malloc.c:602: undefined reference to `running_trap' --- Makefile.in | 4 ++-- hashlib.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5fcb44b0..76a51b19 100644 --- a/Makefile.in +++ b/Makefile.in @@ -967,8 +967,8 @@ depends: force $(Program) $(SUPPORT_SRC)mkdep -c ${CC} -- ${CCFLAGS} ${CSOURCES} #### PRIVATE TARGETS #### -hashtest: hashlib.c - $(CC) -DTEST_HASHING $(CCFLAGS) $(TEST_NBUCKETS) -o $@ $(srcdir)/hashlib.c xmalloc.o $(INTL_LIB) +hashtest: hashlib.c xmalloc.o $(MALLOC_LIBRARY) + $(CC) -DTEST_HASHING $(CCFLAGS) $(TEST_NBUCKETS) -o $@ $(srcdir)/hashlib.c xmalloc.o $(MALLOC_LIBRARY) ############################ DEPENDENCIES ############################### diff --git a/hashlib.c b/hashlib.c index 8adbe221..f8e3b09a 100644 --- a/hashlib.c +++ b/hashlib.c @@ -392,6 +392,7 @@ hash_pstats (table, name) HASH_TABLE *table, *ntable; int interrupt_immediately = 0; +int running_trap = 0; int signal_is_trapped (s) @@ -417,6 +418,7 @@ internal_warning (const char *format, ...) { } +int main () { char string[256]; -- 2.20.1