From patchwork Sat Oct 19 21:47:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 35164 Received: (qmail 52620 invoked by alias); 19 Oct 2019 21:47:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 52607 invoked by uid 89); 19 Oct 2019 21:47:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.51.36) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 19 Oct 2019 21:47:06 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 62527BD62 for ; Sat, 19 Oct 2019 16:47:04 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id LwYyiTg8hPUvSLwYyizcYL; Sat, 19 Oct 2019 16:47:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3Q38zf69Lwjrf04nfEHvmcMHtYC5KNMXjZoUc3GqHng=; b=mmDNTVrc78TuInTHks5h+zGTDu 7vduGRvUVSD2ej9jWYSs6vYW56uQPGCvgLkBUsUo2Hr//e4MDO3O4N1yz2cIY3atNjOFj62uz/h0W XxLjbd6mQY1qBqLHpmuXKl/Pl; Received: from 75-166-66-104.hlrn.qwest.net ([75.166.66.104]:49108 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iLwYy-001qk1-5z; Sat, 19 Oct 2019 15:47:04 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Fix creation of nm.h when configure is changed Date: Sat, 19 Oct 2019 15:47:00 -0600 Message-Id: <20191019214700.31107-1-tom@tromey.com> My earlier patch -- commit c5adaa192 ("Fix creation of stamp-h by gdb's configure script") -- broke the creation of nm.h. In particular, configure removes nm.h, so if you touch configure and rebuild, nothing will re-create the link, breaking the build. This patch fixes the bug, and also updates configure.ac to use AC_CONFIG_LINKS, rather than the obsolete AC_LINK_FILES. Finally, I noticed that gcore is in generated_files in the Makefile.in. I think this is incorrect, as generated_files is only needed for files that can be the target of a #include. So, this patch removes it. gdb/ChangeLog 2019-10-19 Tom Tromey * configure.ac (nm.h): Conditionally create nm.h link. Subst NM_H. Use AC_CONFIG_LINKS. * configure: Rebuild. * Makefile.in (NM_H): New variable. (generated_files): Add NM_H. Remove gcore. (nm.h, stamp-nmh): New targets. Change-Id: I8dd539785d52455e85389425e4bb996c8a127a0e --- gdb/ChangeLog | 9 +++++++++ gdb/Makefile.in | 9 +++++++-- gdb/configure | 28 +++++++++------------------- gdb/configure.ac | 15 +++++---------- 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 9d07ac0d974..b6caa2c220b 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -812,6 +812,7 @@ LOADLIBES = @LOADLIBES@ MH_CFLAGS = @MH_CFLAGS@ XM_CLIBS = @XM_CLIBS@ NAT_GENERATED_FILES = @NAT_GENERATED_FILES@ +NM_H = @NM_H@ HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@ # Native-target dependent makefile fragment comes in here. @@ -1617,9 +1618,9 @@ DISTSTUFF = $(YYFILES) generated_files = \ ada-lex.c \ config.h \ - gcore \ jit-reader.h \ - $(NAT_GENERATED_FILES) + $(NAT_GENERATED_FILES) \ + $(NM_H) # Flags needed to compile Python code PYTHON_CFLAGS = @PYTHON_CFLAGS@ @@ -2021,6 +2022,10 @@ config.h: stamp-h ; @true stamp-h: $(srcdir)/config.in config.status $(SHELL) config.status config.h +nm.h: stamp-nmh ; @true +stamp-nmh: config.status + $(SHELL) config.status nm.h + config.status: $(srcdir)/configure configure.nat configure.tgt configure.host ../bfd/development.sh $(SHELL) config.status --recheck diff --git a/gdb/configure b/gdb/configure index 70ce52fa1e8..737b426058c 100755 --- a/gdb/configure +++ b/gdb/configure @@ -626,6 +626,7 @@ LIBOBJS GCORE_TRANSFORM_NAME GDB_TRANSFORM_NAME XSLTPROC +NM_H GDB_NM_FILE LTLIBBABELTRACE LIBBABELTRACE @@ -17556,28 +17557,25 @@ $as_echo "$as_me: WARNING: babeltrace is missing or unusable; GDB is unable to r fi fi -# If nativefile (NAT_FILE) is not set in configure.nat, we link to an -# empty version. - -files= -links= - +NM_H= rm -f nm.h if test "${nativefile}" != ""; then case "${nativefile}" in nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;; * ) GDB_NM_FILE="${nativefile}" esac - files="${files} ${GDB_NM_FILE}" - links="${links} nm.h" + ac_config_links="$ac_config_links nm.h:$GDB_NM_FILE" + cat >>confdefs.h <<_ACEOF #define GDB_NM_FILE "${GDB_NM_FILE}" _ACEOF + NM_H=nm.h fi + for ac_prog in xsltproc do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -17631,16 +17629,6 @@ if test "x$USE_MAINTAINER_MODE" = xyes; then fi -ac_sources="$files" -ac_dests="$links" -while test -n "$ac_sources"; do - set $ac_dests; ac_dest=$1; shift; ac_dests=$* - set $ac_sources; ac_source=$1; shift; ac_sources=$* - ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source" -done -ac_config_links="$ac_config_links $ac_config_links_1" - - @@ -18406,6 +18394,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # INIT-COMMANDS # ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR +GDB_NM_FILE=$GDB_NM_FILE _ACEOF @@ -18418,7 +18407,7 @@ do "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;; "jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;; - "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;; + "nm.h") CONFIG_LINKS="$CONFIG_LINKS nm.h:$GDB_NM_FILE" ;; "gcore") CONFIG_FILES="$CONFIG_FILES gcore" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "gdb-gdb.gdb") CONFIG_FILES="$CONFIG_FILES gdb-gdb.gdb" ;; @@ -19053,6 +19042,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in "config.h":H) echo > stamp-h ;; "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;; + "nm.h":L) echo > stamp-nmh ;; "gcore":F) chmod +x gcore ;; esac diff --git a/gdb/configure.ac b/gdb/configure.ac index c4e0dbf9952..dbe01509b91 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -2217,23 +2217,20 @@ else fi fi -# If nativefile (NAT_FILE) is not set in configure.nat, we link to an -# empty version. - -files= -links= - +NM_H= rm -f nm.h if test "${nativefile}" != ""; then case "${nativefile}" in nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;; * ) GDB_NM_FILE="${nativefile}" esac - files="${files} ${GDB_NM_FILE}" - links="${links} nm.h" + AC_CONFIG_LINKS([nm.h:$GDB_NM_FILE], [echo > stamp-nmh], + [GDB_NM_FILE=$GDB_NM_FILE]) AC_DEFINE_UNQUOTED(GDB_NM_FILE, "${GDB_NM_FILE}", [nativefile]) + NM_H=nm.h fi AC_SUBST(GDB_NM_FILE) +AC_SUBST(NM_H) dnl Add dependency for xsltproc if building with maintainer-mode enabled. AC_PATH_PROGS(XSLTPROC, xsltproc, missing) @@ -2244,8 +2241,6 @@ if test "x$USE_MAINTAINER_MODE" = xyes; then fi AC_SUBST(XSLTPROC) -AC_LINK_FILES($files, $links) - dnl Check for exe extension set on certain hosts (e.g. Win32) AC_EXEEXT