Path: csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: =?UTF-8?q?Eduardo=20A=2E=20Bustamante=20L=C3=B3pez?= Newsgroups: gnu.bash.bug Subject: [PATCH 2/3] Fix `hashtest' target in Makefile Date: Fri, 4 Jan 2019 12:25:41 -0800 Lines: 77 Approved: bug-bash@gnu.org Message-ID: References: <20190104202542.4626-1-dualbus@gmail.com> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Trace: usenet.stanford.edu 1546633582 18514 208.118.235.17 (4 Jan 2019 20:26:22 GMT) X-Complaints-To: action@cs.stanford.edu Cc: =?UTF-8?q?Eduardo=20A=2E=20Bustamante=20L=C3=B3pez?= To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oNHkfGKi+zx/pt5XktRnR8kVJ4v0v6TT+9dV7GsjMIc=; b=QvuiUOjhgKSrz93yrVCW4V9+GmK9yOCks0o1tLuAIkSesjzo2qkAQzpnkXRVzuqRtH zGkfmfeYdorn1kjamt7eYxXQSwd+eBBFSkM2z95DC+mmDyPMxFro5ZjKl7E9LYq0XXFz zY994AWs6kiZsnTI85ejt1T3Syrr8ABCDFQV0WXzWJjjjvLTF1RoPRTzaoPfJHL3wmbX BG6wycr65dkWFL4ZhmC/jqvB3Lr2tHqvtTnzNBF1w/QPKCPjqhUTD2Zl9t95a7vFWRDG qcoyVeUSIDSa/fP5DFE0sETzgylTefEju472IeHu/Zdn5pefk9ZrbVcwRd1PzE7qvFhS Fg1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oNHkfGKi+zx/pt5XktRnR8kVJ4v0v6TT+9dV7GsjMIc=; b=A7kUEAZFHsnf719fh5lMRIzJ6EGRPrFe3G97/mh6ZAi+R8SA4GGjJKdI1IH8f/9bKC n2mhNeSV3adbzO4JjXsaSjXKBlki/EDBKX9lIPFCRB5SvZceYN9AR3JLe3NYFCkJ14/O pLkxTB9esk/SE8Ja+P4ZV9bgqV+e3V5UT9pHLF+hAvA2DQviDHfRkpJh1nEt1gzB+qJj FqtBs8OFazYiN5AS3TOVR1bALtDKWmiJ6M/i9QcZBE337BcLhljxxp4RfFyG4yoFpM0G RLqwIPFUX8dF0YLS6Q60/KUPeJzmuO+XQdTle+sSJ0RNDtxfONiAo1T+VYTy0b0vSIXh 3LJQ== X-Gm-Message-State: AA+aEWZvn44KqFvzSCmXz+M+M4XqotRCP1/5bDwekfPbFS9Jl5LHvNA7 j0O9uP5bKI/6LelBXo40J+3mHjAT X-Google-Smtp-Source: ALg8bN7i1OPi+54O/Hc0HLbRPuHLhrVDopHcHf8qVKb92ipAUJ1ODoJYF9P+uURH982anDJ/TL+Ogw== X-Received: by 2002:a62:56c7:: with SMTP id h68mr56057677pfj.134.1546633573642; Fri, 04 Jan 2019 12:26:13 -0800 (PST) X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190104202542.4626-1-dualbus@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:15040 - 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