From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id B848D3858D35 for ; Thu, 25 Jun 2020 08:23:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B848D3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=none smtp.mailfrom=ro@cebitec.uni-bielefeld.de Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id AF769A72AD; Thu, 25 Jun 2020 10:23:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bvbqttsu80ty; Thu, 25 Jun 2020 10:23:11 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p4fddbb33.dip0.t-ipconnect.de [79.221.187.51]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id EDDB7A72AC; Thu, 25 Jun 2020 10:23:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=CeBiTec.Uni-Bielefeld.DE; s=20200306; t=1593073391; bh=0mtLq+KRHKDOQ7G5PHiEFZrbSQyX5mpIAxsYTTeTl6g=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ebPLOu/hGFXAORPJSILhb5JO6eIr7u/CmfunV2WsJK6qGvu3D1eLAY3rPT602eQxv U6wCkE9azNrGLiJTuxNGwLgnzhgd0Jg3/f8DHksRXHBZCGm6MvqC1kmNGMyDp7DexJ KWp/I/Q2qKxoy7X+9RDCDAnUdX0vd93qCOceligFsPg83QDBhVKhfbzvP31D9j4dhW lmpvWZFjMQnSuO3SRO0Zj8XYr4HQn+WLiOCcuLZlz8obxAWJlVeSD+dixT+e4kxnVl TDO4mb1TNmIRn/oSO++co1rAN8HB4zjDXTUcueBXez2If97m2/nrp4EkfRi+aynyiF JtmIlgYKFQwKQ== From: Rainer Orth To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: [PATCH] Don't include *sol2-tdep.o on Linux/sparc* References: <00d11a67-fb37-52de-859d-f8055c841668@simark.ca> Date: Thu, 25 Jun 2020 10:23:09 +0200 In-Reply-To: (Rainer Orth's message of "Wed, 24 Jun 2020 22:57:51 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (usg-unix-v) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Status: No, score=-3795.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, 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: Thu, 25 Jun 2020 08:23:14 -0000 --=-=-= Content-Type: text/plain Hi Simon, >>> However, I just discovered that there are two targets that would break >>> with this patch: both sparc-*-linux* and sparc64-*-linux* include >>> sparc-sol2-tdep.o and sparc64-sol2-tdep.o in configure.tgt. With the >>> new call to sol2_init_abi which only lives in sol2-tdep.o, gdb would >>> fail to link. I have no idea what business they have with >>> Solaris-specific files: I suspect that's to allow debugging of >>> Solaris/SPARC binaries (i.e. GDB_OSABI_SOLARIS). What should I do about >>> this? Maybe I also could include sol2-tdep.o on Linux/SPARC, but is >>> this TRT? AFAICS those files received only mechanical changes over the >>> last two years (haven't looked further), and I have no way of testing >>> changes. >> >> Hmm, sparc-*-linux* and sparc64-*-linux* have no business including some >> Solaris-specific files in the build. >> >> When building a GDB on sparc64/Linux, it shouldn't have support for debugging >> sparc64/Solaris binaries. If you want that, you need to pass >> --enable-targets=sparc64-solaris-something (I don't know what the actual >> triplet >> would be). > > sparc{v9,64}-sun-solaris2.11 > >> So it seems like there is some untangling here, putting the functions on the >> files that they really belong to, until you can successfully build a >> sparc64/Linux >> GDB without including the sol2 tdep files. I haven't looked much at the patch > > From a quick check, this should just work today: the functions declared > in sparc*-sol2-tdep.c are only called in Solaris-specific files already. > I'll give it a try separately. sparc{32,64}_sol2_init_abi are currently > declared in common files (sparc*-tdep.h), but they can just be made > static and the declarations removed. the following patch does just that: tested on sparc64-unknown-linux-gnu (build only due to PR tdep/26170) and sparcv9-sun-solaris2.11. Ok for master? Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2020-06-24 Rainer Orth * configure.tgt (gdb_target_obs): Remove sparc-sol2-tdep.o, sol2-tdep.o, sparc64-sol2-tdep.o. (gdb_target_obs): Remove sparc64-sol2-tdep.o, sol2-tdep.o, sparc-sol2-tdep.o. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Make static. * sparc-tdep.h (sparc32_sol2_init_abi): Remove. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Make static. * sparc64-tdep.h (sparc64_sol2_init_abi): Remove. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=sol2-no-sol2-tdep-linux.patch # HG changeset patch # Parent 3a3a48c067f99b6fc95d7b297570b179fd575e9c Don't include *sol2-tdep.o on Linux/sparc* diff --git a/gdb/configure.tgt b/gdb/configure.tgt --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -585,20 +585,20 @@ sh*) sparc-*-linux*) # Target: GNU/Linux SPARC - gdb_target_obs="sparc-tdep.o sparc-sol2-tdep.o sol2-tdep.o \ + gdb_target_obs="sparc-tdep.o \ sparc-linux-tdep.o solib-svr4.o symfile-mem.o \ linux-tdep.o \ ravenscar-thread.o sparc-ravenscar-thread.o" if test "x$enable_64_bit_bfd" = "xyes"; then # Target: GNU/Linux UltraSPARC - gdb_target_obs="sparc64-tdep.o sparc64-sol2-tdep.o \ + gdb_target_obs="sparc64-tdep.o \ sparc64-linux-tdep.o ${gdb_target_obs}" fi ;; sparc64-*-linux*) # Target: GNU/Linux UltraSPARC - gdb_target_obs="sparc64-tdep.o sparc64-sol2-tdep.o sol2-tdep.o \ - sparc64-linux-tdep.o sparc-tdep.o sparc-sol2-tdep.o \ + gdb_target_obs="sparc64-tdep.o \ + sparc64-linux-tdep.o sparc-tdep.o \ sparc-linux-tdep.o solib-svr4.o linux-tdep.o \ ravenscar-thread.o sparc-ravenscar-thread.o" ;; diff --git a/gdb/sparc-sol2-tdep.c b/gdb/sparc-sol2-tdep.c --- a/gdb/sparc-sol2-tdep.c +++ b/gdb/sparc-sol2-tdep.c @@ -192,7 +192,7 @@ static const struct frame_unwind sparc32 -void +static void sparc32_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); diff --git a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h --- a/gdb/sparc-tdep.h +++ b/gdb/sparc-tdep.h @@ -245,9 +245,6 @@ extern int sparc_is_annulled_branch_insn extern const struct sparc_gregmap sparc32_sol2_gregmap; extern const struct sparc_fpregmap sparc32_sol2_fpregmap; -extern void sparc32_sol2_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch); - /* Functions and variables exported from sparcnbsd-tdep.c. */ /* Register offsets for NetBSD. */ diff --git a/gdb/sparc64-sol2-tdep.c b/gdb/sparc64-sol2-tdep.c --- a/gdb/sparc64-sol2-tdep.c +++ b/gdb/sparc64-sol2-tdep.c @@ -195,7 +195,7 @@ static const struct frame_unwind sparc64 -void +static void sparc64_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); diff --git a/gdb/sparc64-tdep.h b/gdb/sparc64-tdep.h --- a/gdb/sparc64-tdep.h +++ b/gdb/sparc64-tdep.h @@ -119,9 +119,6 @@ extern void sparc64_collect_fpregset (co extern const struct sparc_gregmap sparc64_sol2_gregmap; extern const struct sparc_fpregmap sparc64_sol2_fpregmap; -extern void sparc64_sol2_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch); - /* Variables exported from sparc64-fbsd-tdep.c. */ /* Register offsets for FreeBSD/sparc64. */ --=-=-=--