Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Simon Marchi <simark@simark.ca>
Cc: gdb-patches@sourceware.org
Subject: [PATCH] Don't include *sol2-tdep.o on Linux/sparc*
Date: Thu, 25 Jun 2020 10:23:09 +0200	[thread overview]
Message-ID: <ydda70ro8pe.fsf_-_@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <yddeeq4npv4.fsf@CeBiTec.Uni-Bielefeld.DE> (Rainer Orth's message of "Wed, 24 Jun 2020 22:57:51 +0200")

[-- Attachment #1: Type: text/plain, Size: 2531 bytes --]

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  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.tgt <sparc-*-linux*> (gdb_target_obs): Remove
	sparc-sol2-tdep.o, sol2-tdep.o, sparc64-sol2-tdep.o.
	<sparc64-*-linux*> (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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-no-sol2-tdep-linux.patch --]
[-- Type: text/x-patch, Size: 2736 bytes --]

# 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
 
 \f
 
-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
 
 \f
 
-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.  */

  reply	other threads:[~2020-06-25  8:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 13:15 [RFC][PATCH] Move common handlers to sol2_init_abi Rainer Orth
2020-06-24 10:27 ` Rainer Orth
2020-06-24 14:56 ` Simon Marchi
2020-06-24 20:57   ` Rainer Orth
2020-06-25  8:23     ` Rainer Orth [this message]
2020-06-25  9:57       ` [PATCH] Don't include *sol2-tdep.o on Linux/sparc* Pedro Alves
2020-06-25 12:03         ` Rainer Orth
2020-06-25  8:26     ` [PATCH] Remove obsolete gdbarch_static_transform_name Rainer Orth
2020-06-25  9:18       ` Pedro Alves
2020-06-25 12:07         ` Rainer Orth
2020-06-25 15:20           ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ydda70ro8pe.fsf_-_@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox