From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 804C63858400 for ; Wed, 17 Nov 2021 14:48:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 804C63858400 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 1AHElwBU017543 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Nov 2021 09:48:03 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1AHElwBU017543 Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 18D6F1ECEB; Wed, 17 Nov 2021 09:47:58 -0500 (EST) Subject: Re: [PUSHED] [gdb/build, s390x] Fix build after gdbarch_tdep changes To: Andreas Arnez , Simon Marchi via Gdb-patches References: <20211116024005.500676-1-simon.marchi@polymtl.ca> <20211116024005.500676-3-simon.marchi@polymtl.ca> <87pmqyoncb.fsf_-_@li-32acfd01-53a8-11cb-b225-9c4f961b6dbf.ibm.com> From: Simon Marchi Message-ID: Date: Wed, 17 Nov 2021 09:47:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <87pmqyoncb.fsf_-_@li-32acfd01-53a8-11cb-b225-9c4f961b6dbf.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 17 Nov 2021 14:47:58 +0000 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 17 Nov 2021 14:48:07 -0000 On 2021-11-17 9:42 a.m., Andreas Arnez wrote: > On Mon, Nov 15 2021, Simon Marchi via Gdb-patches wrote: > >> Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") forgot to >> update the gdbarch_tdep calls in the native files other than x86-64 >> Linux. This patch updates them all (to the best of my knowledge). >> These are the files I was able to build-test: >> >> aarch64-linux-nat.c >> amd64-bsd-nat.c >> arm-linux-nat.c >> ppc-linux-nat.c >> windows-nat.c >> xtensa-linux-nat.c >> >> And these are the ones I could not build-test: >> >> aix-thread.c >> arm-netbsd-nat.c >> ppc-fbsd-nat.c >> ppc-netbsd-nat.c >> ia64-tdep.c (the part that needs libunwind) >> ppc-obsd-nat.c >> rs6000-nat.c > > Hm, I wonder why s390-linux-nat.c is missing from both lists. That's > not intentional, right? Because I was looking (grepping) for gdbarch_tdep calls to update, and there are none in s390-linux-nat.c. It still needed some fixing, as you found out. > >> If there are still some build problems related to gdbarch_tdep in them, >> they should be pretty obvious to fix. > > Yeah, the s390x native build was broken by the original commit as well. > I pushed the (obvious) patch below to fix this. > > ---- 8< ---- > From 0df670bbe009d3b57f5dbf9599913ad06013ec4e Mon Sep 17 00:00:00 2001 > From: Andreas Arnez > Date: Wed, 17 Nov 2021 11:46:36 +0100 > Subject: [PATCH] [gdb/build, s390x] Fix build after gdbarch_tdep changes > > Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") changes a > declaration in s390-tdep.h from > > struct gdbarch_tdep { ... }; > > to > > struct s390_gdbarch_tdep : gdbarch_tdep { ... }; > > and now requires that gdbarch_tdep has been declared before. Which is > usually the case, except when compiling s390-linux-nat.c, where > s390-tdep.h is included before gdbarch.h. Thus the s390x build errors out > with the compiler complaining about a missing class name after the colon. > > Fix this in s390-linux-nat.c, by including gdbarch.h before s390-tdep.h. > --- > gdb/s390-linux-nat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c > index 8f6eb61505b..4c64a854803 100644 > --- a/gdb/s390-linux-nat.c > +++ b/gdb/s390-linux-nat.c > @@ -29,6 +29,7 @@ > #include "regset.h" > #include "nat/linux-ptrace.h" > #include "gdbcmd.h" > +#include "gdbarch.h" > > #include "s390-tdep.h" > #include "s390-linux-tdep.h" > @@ -43,7 +44,6 @@ > #include > #include "inf-ptrace.h" > #include "linux-tdep.h" > -#include "gdbarch.h" I would have suggested that s390-tdep.h should include gdbarch.h, since it now relies on being able to see the struct gdbarch definition. Simon