Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb: sim: disable integration w/some multitarget configs [PR sim/13418]
@ 2016-01-02  8:42 Mike Frysinger
  2016-01-04 13:38 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2016-01-02  8:42 UTC (permalink / raw)
  To: gdb-patches

Multitarget builds currently fail when:
(1) simulator support is enabled
(2) powerpc is included in the target list
(3) powerpc is not the main/default target

This is because the powerpc sim provides a non-standard API function
sim_spr_register_name which the powerpc gdb utilizes.  Since the sim
does not yet support multitarget, only the sim for the main target
(if one exists) is built.  When that target isn't powerpc, this func
is not available leading to linking errors.

Since multitarget support is going to take a while, and specifically
the powerpc target is going to take even longer, disable sim support
automatically when the aforementioned conditions are met.

2016-01-02  Mike Frysinger  <vapier@gentoo.org>

	PR sim/13418
	* configure.ac: Set gdb_sim= when target is not powerpc*, and
	all_targets is true or rs6000-tdep.o is in TARGET_OBS.
	* configure: Regenerate.
---
 gdb/configure    | 14 ++++++++++++++
 gdb/configure.ac | 13 +++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/gdb/configure b/gdb/configure
index 5afdbbc..57c1ea7 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -15840,6 +15840,20 @@ fi
 SIM=
 SIM_OBS=
 if test "${ignore_sim}" = "false"; then
+  # The ppc gdb/sim only works when it's the main target.  PR sim/13418
+  case $target in
+  powerpc*-*-*) ;;
+  *)
+    case "${all_targets}: ${TARGET_OBS} " in
+    true:*|*" rs6000-tdep.o "*)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling sim integration for multitarget powerpc configs" >&5
+$as_echo "$as_me: WARNING: Disabling sim integration for multitarget powerpc configs" >&2;}
+      gdb_sim=
+      ;;
+    esac
+    ;;
+  esac
+
   if test x"${gdb_sim}" != x ; then
     SIM="${gdb_sim}"
     SIM_OBS="remote-sim.o"
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 5b618c9..458605f 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2256,6 +2256,19 @@ fi
 SIM=
 SIM_OBS=
 if test "${ignore_sim}" = "false"; then
+  # The ppc gdb/sim only works when it's the main target.  PR sim/13418
+  case $target in
+  powerpc*-*-*) ;;
+  *)
+    case "${all_targets}: ${TARGET_OBS} " in
+    true:*|*" rs6000-tdep.o "*)
+      AC_MSG_WARN([Disabling sim integration for multitarget powerpc configs])
+      gdb_sim=
+      ;;
+    esac
+    ;;
+  esac
+
   if test x"${gdb_sim}" != x ; then
     SIM="${gdb_sim}"
     SIM_OBS="remote-sim.o"
-- 
2.6.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gdb: sim: disable integration w/some multitarget configs [PR sim/13418]
  2016-01-02  8:42 [PATCH] gdb: sim: disable integration w/some multitarget configs [PR sim/13418] Mike Frysinger
@ 2016-01-04 13:38 ` Pedro Alves
  2016-01-05  0:55   ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2016-01-04 13:38 UTC (permalink / raw)
  To: Mike Frysinger, gdb-patches

On 01/02/2016 08:42 AM, Mike Frysinger wrote:
> Multitarget builds currently fail when:
> (1) simulator support is enabled
> (2) powerpc is included in the target list
> (3) powerpc is not the main/default target
> 
> This is because the powerpc sim provides a non-standard API function
> sim_spr_register_name which the powerpc gdb utilizes.  Since the sim
> does not yet support multitarget, only the sim for the main target
> (if one exists) is built.  When that target isn't powerpc, this func
> is not available leading to linking errors.
> 
> Since multitarget support is going to take a while, and specifically
> the powerpc target is going to take even longer, disable sim support
> automatically when the aforementioned conditions are met.

> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index 5b618c9..458605f 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -2256,6 +2256,19 @@ fi
>  SIM=
>  SIM_OBS=
>  if test "${ignore_sim}" = "false"; then
> +  # The ppc gdb/sim only works when it's the main target.  PR sim/13418
> +  case $target in
> +  powerpc*-*-*) ;;
> +  *)
> +    case "${all_targets}: ${TARGET_OBS} " in
> +    true:*|*" rs6000-tdep.o "*)
> +      AC_MSG_WARN([Disabling sim integration for multitarget powerpc configs])
> +      gdb_sim=
> +      ;;
> +    esac
> +    ;;
> +  esac
> +

Now sure about that.  It penalizes non-PPC sims for a PPC sim issue.

How about this instead?

From e05ef2bec1b3843c87dd06a7680f7d6e1c13ba1e Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Mon, 4 Jan 2016 13:01:25 +0000
Subject: [PATCH] ppc sim

---
 gdb/config.in     |  3 +++
 gdb/configure     | 10 ++++++++++
 gdb/configure.ac  |  8 ++++++++
 gdb/rs6000-tdep.c |  2 +-
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/gdb/config.in b/gdb/config.in
index ccc0098..6196fa0 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -758,6 +758,9 @@
    when building for Cygwin. */
 #undef USE_WIN32API
 
+/* Define if the PPC simulator is being linked in. */
+#undef WITH_PPC_SIM
+
 /* Define if --with-python provides a path, either directly or via
    python-config.py --exec-prefix. */
 #undef WITH_PYTHON_PATH
diff --git a/gdb/configure b/gdb/configure
index 5afdbbc..15383d6 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -15846,6 +15846,16 @@ if test "${ignore_sim}" = "false"; then
 
 $as_echo "#define WITH_SIM 1" >>confdefs.h
 
+
+    # Some tdep code should only be compiled in when the ppc sim is
+    # built.  PR sim/13418.
+    case $target in
+      powerpc*-*-*)
+
+$as_echo "#define WITH_PPC_SIM 1" >>confdefs.h
+
+	;;
+    esac
   fi
 fi
 
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 5b618c9..d102640 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2260,6 +2260,14 @@ if test "${ignore_sim}" = "false"; then
     SIM="${gdb_sim}"
     SIM_OBS="remote-sim.o"
     AC_DEFINE(WITH_SIM, 1, [Define if the simulator is being linked in.])
+
+    # Some tdep code should only be compiled in when the ppc sim is
+    # built.  PR sim/13418.
+    case $target in
+      powerpc*-*-*)
+	AC_DEFINE(WITH_PPC_SIM, 1, [Define if the PPC simulator is being linked in.])
+	;;
+    esac
   fi
 fi
 AC_SUBST(SIM)
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 47b0749..599b076 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -328,7 +328,7 @@ init_sim_regno_table (struct gdbarch *arch)
     set_sim_regno (sim_regno, tdep->ppc_acc_regnum, sim_ppc_acc_regnum);
   /* spefscr is a special-purpose register, so the code below handles it.  */
 
-#ifdef WITH_SIM
+#ifdef WITH_PPC_SIM
   /* Now handle all special-purpose registers.  Verify that they
      haven't mistakenly been assigned numbers by any of the above
      code.  */
-- 
1.9.3



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gdb: sim: disable integration w/some multitarget configs [PR sim/13418]
  2016-01-04 13:38 ` Pedro Alves
@ 2016-01-05  0:55   ` Mike Frysinger
  2016-01-05 11:09     ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2016-01-05  0:55 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

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

On 04 Jan 2016 13:38, Pedro Alves wrote:
> On 01/02/2016 08:42 AM, Mike Frysinger wrote:
> > Multitarget builds currently fail when:
> > (1) simulator support is enabled
> > (2) powerpc is included in the target list
> > (3) powerpc is not the main/default target
> > 
> > This is because the powerpc sim provides a non-standard API function
> > sim_spr_register_name which the powerpc gdb utilizes.  Since the sim
> > does not yet support multitarget, only the sim for the main target
> > (if one exists) is built.  When that target isn't powerpc, this func
> > is not available leading to linking errors.
> > 
> > Since multitarget support is going to take a while, and specifically
> > the powerpc target is going to take even longer, disable sim support
> > automatically when the aforementioned conditions are met.
> 
> > diff --git a/gdb/configure.ac b/gdb/configure.ac
> > index 5b618c9..458605f 100644
> > --- a/gdb/configure.ac
> > +++ b/gdb/configure.ac
> > @@ -2256,6 +2256,19 @@ fi
> >  SIM=
> >  SIM_OBS=
> >  if test "${ignore_sim}" = "false"; then
> > +  # The ppc gdb/sim only works when it's the main target.  PR sim/13418
> > +  case $target in
> > +  powerpc*-*-*) ;;
> > +  *)
> > +    case "${all_targets}: ${TARGET_OBS} " in
> > +    true:*|*" rs6000-tdep.o "*)
> > +      AC_MSG_WARN([Disabling sim integration for multitarget powerpc configs])
> > +      gdb_sim=
> > +      ;;
> > +    esac
> > +    ;;
> > +  esac
> > +
> 
> Now sure about that.  It penalizes non-PPC sims for a PPC sim issue.
> 
> How about this instead?

i'm fine with this, so lgtm
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gdb: sim: disable integration w/some multitarget configs [PR sim/13418]
  2016-01-05  0:55   ` Mike Frysinger
@ 2016-01-05 11:09     ` Pedro Alves
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2016-01-05 11:09 UTC (permalink / raw)
  To: gdb-patches

On 01/05/2016 12:55 AM, Mike Frysinger wrote:

>> Now sure about that.  It penalizes non-PPC sims for a PPC sim issue.
>>
>> How about this instead?
> 
> i'm fine with this, so lgtm

Pushed.

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-05 11:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-02  8:42 [PATCH] gdb: sim: disable integration w/some multitarget configs [PR sim/13418] Mike Frysinger
2016-01-04 13:38 ` Pedro Alves
2016-01-05  0:55   ` Mike Frysinger
2016-01-05 11:09     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox