From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id AC130385ED4D for ; Tue, 6 Oct 2020 14:10:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AC130385ED4D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 435771E4B5; Tue, 6 Oct 2020 10:10:26 -0400 (EDT) Subject: Re: [PATCH] gnulib: Ensure all libraries are used when building gdb/gdbserver To: Andrew Burgess Cc: gdb-patches@sourceware.org References: <20201005165134.1620549-1-andrew.burgess@embecosm.com> <2feb66c2-8f65-7cbf-d1be-ae3d04b45d9a@simark.ca> <20201006121751.GK605036@embecosm.com> From: Simon Marchi Message-ID: <95d52add-47c2-9621-7e60-1ff9a4331324@simark.ca> Date: Tue, 6 Oct 2020 10:10:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201006121751.GK605036@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2020 14:10:27 -0000 On 2020-10-06 8:17 a.m., Andrew Burgess wrote: > The problem here was me unconditionally trying to include > Makefile.gnulib.inc from the gdb and gdbserver Makefile. The very > first time you run 'make clean' after applying the patch > Makefile.gnulib.inc doesn't exist, but the gdb/gdbserver makefiles > still try to pull the file in unconditionally. If the file is generated at configure-time, I think it would be ok for Makefile.gnulib.inc to be included unconditionally. As when you run "make clean" after pulling some changes, you're supposed to do to it from the top level, so Makefile.gnulib.inc will be created before "make clean" runs in GDB. Building GDB (i.e. running "make" in gdb/) requires some other directories (like gnulib/) to have been configured first. So if you pull changes that affect these other directories and try to run "make" just in gdb/ (instead of at the top-level), it's expected that some things may not work (I think). If there is no other legitimate situation where Makefile.gnulib.inc may not exist, I'd slightly prefer for the include to be unconditional. Simply because if Makefile.gnulib.inc doesn't exist, for some reason, the error message will be much more straightforward. This: $ make /bin/sh config.status Makefile config.status: creating Makefile Makefile:242: ../gnulib/Makefile.gnulib: No such file or directory make: *** No rule to make target '../gnulib/Makefile.gnulib'. Stop. vs $ make CXX gdb.o cc1plus: warning: command-line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++ In file included from /home/simark/src/binutils-gdb/gdb/defs.h:28, from /home/simark/src/binutils-gdb/gdb/gdb.c:19: /home/simark/src/binutils-gdb/gdb/../gdbsupport/common-defs.h:120:10: fatal error: pathmax.h: No such file or directory 120 | #include "pathmax.h" | ^~~~~~~~~~~ compilation terminated. make: *** [Makefile:1618: gdb.o] Error 1 Finally, I don't know if the change was intentional, but the file was previously named Makefile.gnulib.inc and is now named Makefile.gnulib. I liked Makefile.gnulib.inc, as it shows it's not a "top-level" Makefile, it's meant to be included. Otherwise, the patch LGTM, thanks! Simon