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 0035938582AE for ; Thu, 22 Sep 2022 16:26:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0035938582AE Received: from [10.0.0.11] (unknown [217.28.27.60]) (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 51DE31E0D5; Thu, 22 Sep 2022 12:26:17 -0400 (EDT) Message-ID: Date: Thu, 22 Sep 2022 12:26:15 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] gdb/testsuite/lib/future.exp: follow dejagnu default_target_compile Content-Language: en-US To: Lancelot SIX , gdb-patches@sourceware.org Cc: lsix@lancelotsix.com References: <20220905182616.621993-1-lancelot.six@amd.com> From: Simon Marchi In-Reply-To: <20220905182616.621993-1-lancelot.six@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Thu, 22 Sep 2022 16:26:21 -0000 On 2022-09-05 14:26, Lancelot SIX via Gdb-patches wrote: > GDB's testsuite can override dejagnu's default_target_compile if the > system provided dejagnu installation does not provide support to compile > languages GDB needs. > > Recent version of dejagnu (1.6.3, installed on REHL-9) includes ba60272 > "Establish a default C compiler by evaluating [find_gcc] if no other > compiler is given."[1]. This commit removed calls such as > `set_board_info compiler "[find_gcc]"` from the various baseboards > and has default_target_compile call `find_gcc` itself to find a compiler > if none was specified by the board description. > > On systems with dejagnu-1.6.3, if GDB's overrides is needed to support > languages still unknown to dejagnu, we end up in the following > situation: > - The system board files do not set the C compiler anymore, > - GDB's replacement for default_target_compile assumes that the > compiler should have been set up by the board file. > > In this situation, no one sets the C compiler for the board and as a > result many test are not compiled and not executed: > > [...] > Running .../gdb/testsuite/gdb.base/bt-on-error-and-warning.exp ... > gdb compile failed, default_target_compile: No compiler to compile with > Running .../gdb/testsuite/gdb.base/dprintf-non-stop.exp ... > gdb compile failed, default_target_compile: No compiler to compile with > Running .../gdb/testsuite/gdb.base/structs3.exp ... > gdb compile failed, default_target_compile: No compiler to compile with > [...] > > We are observing this error with ROCgdb[2], a downstream port of GDB > supporting AMD GPUs. This port needs to use GDB's override of > default_target_compile to compile HIP programs since dejagnu does not > provide support for this language yet. > > This patch changes gdb_default_target_compile_1 in a similar way > default_target_compile has been updated so both implementations remain > compatible. Even if this is not strictly required by GDB just yet, > I believe keeping both implementations in sync desirable. > > Using board files provided with dejagnu <=1.6.2 is still supported: if > the compiler is set by the board file, gdb_default_target_compile_1 uses > it and does not need `find_gcc`. > > Patch tested on x86_64 REHL-9 and ubuntu-20.04 on top of GDB and ROCgdb. > > [1] http://git.savannah.gnu.org/gitweb/?p=dejagnu.git;a=commit;h=ba60272a5ac6f6a7012acca03f596a6ed003f044 > [2] https://github.com/ROCm-Developer-Tools/ROCgdb Thanks, this is ok. OOC, does this mean we can remove the "find_gcc" calls in our own boards? The override in future.exp does not systematically get used when running on a system with an older DejaGNU, so I would guess not. Simon