Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Sherrill <joel.sherrill@oarcorp.com>
To: Ralf Corsepius <ralf.corsepius@rtems.org>
Cc: Mike Frysinger <vapier@gentoo.org>,
	 "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: [gdb-7.5.91] mips sim fails to build on mingw32
Date: Sun, 17 Mar 2013 16:05:00 -0000	[thread overview]
Message-ID: <5145E9AF.9080401@oarcorp.com> (raw)
In-Reply-To: <51454320.1090000@rtems.org>

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

Comments interspersed but the bottom line is that this is
an ugly issue where I believe a number of the simulators
have hard-coded dependencies on dv-sockser.o and do
not link without it even on CentOS. These sims are:

frv/Makefile.in:CONFIG_DEVICES = dv-sockser.o
iq2000/Makefile.in:CONFIG_DEVICES = dv-sockser.o
m32r/Makefile.in:CONFIG_DEVICES = dv-sockser.o
mn10300/Makefile.in:    dv-sockser.o
sh64/Makefile.in:CONFIG_DEVICES = dv-sockser.o

Plus m68hc11 which does not honor --enable-sim-hardware
in its configure.ac. Based on the target name, it just enables
hardware. It appears to be broken in another way.

I have attached a patch which addresses common, mips, bfin
and makes m68hc11 use the conditional for dv-sockser.o.  It
doesn't make m68hc11 honor --enable-sim-hardware.

mips and bfin build fine with this patch with or without
--enable-sim-hardware.

I don't know what to do about the other targets. My recommendation
would be:

+ m68hc11 -minimum  honor --enable-sim-hardware
+ others - if dependency on dv-sockser.o is hard-coded and unavoidable,
the entire simulator is unsupported on mingw32.

I am certainly open for suggestions.




On 3/16/2013 11:14 PM, Ralf Corsepius wrote:
> On 03/16/2013 04:08 PM, Joel Sherrill wrote:
>> On 3/16/2013 1:52 AM, Ralf Corsepius wrote:
>>> On 03/16/2013 05:33 AM, Ralf Corsepius wrote:
>>>> On 03/15/2013 07:37 PM, Joel Sherrill wrote:
>>>>> My recollection is that it did not link on CentOS 6 and was missing
>>>>> these symbols. Disabling it again should make it obvious.
>>>>     Reverting your patch lets build mips-rtems*gdb-7.5.91 build
>>>> successfully on all hosts I am build gdb on [1]
>>>>
>>>>     This is not surprising to me, as reverting the patch pushes
>>>> mips*gdb-7.5.91's configuration into a similar state as gdb-7.5.1 was,
>>>> which built for all of my build hosts.
>>>>
>>>>> But I didn't build in any particularly special way and it failed.
>>>> I am suspecting you were building mipstx39-rtems-gdb.
>>> OK, I found the original thread:
>>> http://www.sourceware.org/ml/gdb-patches/2012-09/msg00030.html
>>>
>>> All I can say, I can not reproduce the issue you were reporting with
>>> gdb-7.5.1 and gdb-7.5.91. Reverting this change brings back
>>> mingw32-w64/gdb-7.5.91.
>> It is still there if you configure correctly.
> "Correctly" is a bold term!
>
>> On a completely up to date
>> CentOS 6.x install. I reversed the patch locally and configured like this:
>>
>> ../gdb-7.5.91/configure --target=mips-rtems4.11 \
>>     --prefix=/home/joel/test-gdb/install/ --enable-sim \
>>     --enable-sim-hardware --enable-timebase --enable-sim-trace &&
>> make
>>
>> And the build failed like this:
>>
>> -o run \
>>         nrun.o libsim.a ../../bfd/libbfd.a ../../opcodes/libopcodes.a
>> ../../libiberty/libiberty.a -lm -lm -lz -lnsl
>> libsim.a(interp.o): In function `sim_open':
>> /home/joel/test-gdb/b-gdb/sim/mips/../../../gdb-7.5.91/sim/mips/interp.c:552:
>> undefined reference to `sockser_addr'
> This fails on all hosts for me.
FWIW the host pattern is mingw32 for the work around and
mingw64 may have this as well. I have no way to test this.
> But ... this provides further insights:
>
> I configure using "default" simulator flags:
> --enable-sim
>
> You configure using "exotic" simulator flags:
> --enable-sim --enable-sim-hardware --enable-timebase --enable-sim-trace
>
> Why you're using them, I don't know.
Very simple.  configure options are supposed to be used or ignored
by each component.  That is by definition.

--enable-sim-hardware
====================
It is a generic option to indicate that if the simulator has optional
devices, enable them all.

Simulators that don't have anything to enable should just work or ignore
the flag.

The PowerPC simulator does something meaningful with this. All simulators
using common/acinclude.m4 are apparently broken when this is enabled.

--enable-sim-timease
==================
sim/ppc specific. Correctly ignored everywhere else. No issue.

--enable-sim-trace
================
This enables execution trace capabilities which are useful in debug.
This option is present in 26 subdirectories in sim so appears to be
universal or close.
>
> Further trial and error with your patch reversed shows:
> --enable-sim-hardware triggers the link-error your reported on all hosts.
> All other permutations of --enable-sim --enable-sim-{timebase,sim-trace}
> build.
>
> I conclude from this:
> sim/mips only needs dv-sockser.o for tx39* targets or when
> --enable-sim-hardware is used.
>
> => The patch is wrong and should be reverted. The configuration magic to
> pull in dv-socksers.o should be reworked and likely needs to be keyed to
> -enable-sim-hardware.
Agreed. This is a bug in common/acinclude.m4  and (possibly) the Makefile.in
for the actual simulators.
>   
>
> Ralf
>


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985


[-- Attachment #2: sockser_diff_v1.txt --]
[-- Type: text/plain, Size: 3286 bytes --]

common/ChangeLog:
2013-03-17  Joel Sherrill <joel.sherrill@oarcorp.com>

	* acinclude.m4: Add SIM_DV_SOCKSER_O which is empty on hosts
	which do not support dv-sockser.o.

bfin/ChangeLog:
2013-03-17  Joel Sherrill <joel.sherrill@oarcorp.com>

	* configure.ac: Use $SIM_DV_SOCKSER_O
	* configure: Regenerated.

m68hc11/ChangeLog:
2013-03-17  Joel Sherrill <joel.sherrill@oarcorp.com>

	* configure.ac: Use $SIM_DV_SOCKSER_O
	* configure: Regenerated.

mips/ChangeLog:
2013-03-17  Joel Sherrill <joel.sherrill@oarcorp.com>

	* configure.ac: Use $SIM_DV_SOCKSER_O
	* configure: Regenerated.

diff -uNr gdb-7.5.91-virgin/sim/bfin/configure.ac gdb-7.5.91/sim/bfin/configure.ac
--- gdb-7.5.91-virgin/sim/bfin/configure.ac	2012-04-09 01:13:06.000000000 -0500
+++ gdb-7.5.91/sim/bfin/configure.ac	2013-03-17 10:29:12.831880985 -0500
@@ -56,17 +56,7 @@
 	sys/mman.h \
 ])
 
-BFIN_SIM_EXTRA_OBJS=
-
-dnl make sure the dv-sockser code can be supported (i.e. windows)
-case ${host} in
-  *mingw32*) ;;
-  *)
-    AC_DEFINE_UNQUOTED([HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.])
-    BFIN_SIM_EXTRA_OBJS="${BFIN_SIM_EXTRA_OBJS} dv-sockser.o"
-    ;;
-esac
-
+BFIN_SIM_EXTRA_OBJS="${BFIN_SIM_EXTRA_OBJS} ${SIM_DV_SOCKSER_O}"
 AC_SUBST([BFIN_SIM_EXTRA_OBJS], ${BFIN_SIM_EXTRA_OBJS})
 
 PKG_PROG_PKG_CONFIG
Binary files gdb-7.5.91-virgin/sim/bfin/.configure.ac.swp and gdb-7.5.91/sim/bfin/.configure.ac.swp differ
diff -uNr gdb-7.5.91-virgin/sim/common/acinclude.m4 gdb-7.5.91/sim/common/acinclude.m4
--- gdb-7.5.91-virgin/sim/common/acinclude.m4	2012-11-20 08:41:08.000000000 -0600
+++ gdb-7.5.91/sim/common/acinclude.m4	2013-03-17 10:24:21.757167294 -0500
@@ -647,6 +647,16 @@
       *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
     esac
   done
+  # mingw32 does not support sockser
+ SIM_DV_SOCKSER_O=""
+  case ${host} in
+    *mingw32*) ;;
+    *) SIM_DV_SOCKSER_O="dv-sockser.o"
+       AC_DEFINE_UNQUOTED(
+         [HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.])
+       ;;
+  esac
+  AC_SUBST(SIM_DV_SOCKSER_O)
 fi
 if test x"$silent" != x"yes" && test "$sim_hw_p" = "yes"; then
   echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
diff -uNr gdb-7.5.91-virgin/sim/m68hc11/configure.ac gdb-7.5.91/sim/m68hc11/configure.ac
--- gdb-7.5.91-virgin/sim/m68hc11/configure.ac	2011-10-17 19:30:58.000000000 -0500
+++ gdb-7.5.91/sim/m68hc11/configure.ac	2013-03-17 10:17:21.532456675 -0500
@@ -19,7 +19,7 @@
   m68hc11-*-*|m6811-*-*)
 	hw_enabled=yes
 	hw_extra_devices="m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram"
-	m68hc11_extra_objs="dv-sockser.o"
+	m68hc11_extra_objs="$SIM_SV_SOCKSER_O"
 	SIM_SUBTARGET="$SIM_SUBTARGET -DTARGET_M68HC11=1"
 	;;
   *)
diff -uNr gdb-7.5.91-virgin/sim/mips/configure.ac gdb-7.5.91/sim/mips/configure.ac
--- gdb-7.5.91-virgin/sim/mips/configure.ac	2013-01-01 00:41:39.000000000 -0600
+++ gdb-7.5.91/sim/mips/configure.ac	2013-03-17 10:36:33.251716513 -0500
@@ -414,12 +414,12 @@
 	hw_enabled=yes
 	hw_extra_devices="tx3904cpu tx3904irc tx3904tmr tx3904sio" 
 	SIM_SUBTARGET="$SIM_SUBTARGET -DTARGET_TX3904=1"
+	mips_extra_objs="$SIM_DV_SOCKSER_O"
 	;;
   *)
 	;;
 esac
 SIM_AC_OPTION_HARDWARE($hw_enabled,$hw_devices,$hw_extra_devices)
-mips_extra_objs="dv-sockser.o"
 AC_SUBST(mips_extra_objs)
 
 

  reply	other threads:[~2013-03-17 16:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15 18:38 Joel Sherrill
     [not found] ` <5143F627.3030905@rtems.org>
2013-03-16  6:56   ` Ralf Corsepius
2013-03-16 15:08     ` Joel Sherrill
2013-03-16 18:11       ` Joel Brobecker
2013-03-16 18:48         ` Joel Sherrill
2013-03-16 23:24           ` Mike Frysinger
2013-03-17  1:03             ` Joel Brobecker
2013-03-17 15:10               ` Mike Frysinger
2013-03-17  1:13             ` Joel Sherrill
2013-03-17 15:09               ` Mike Frysinger
2013-03-17 16:02               ` Joel Brobecker
2013-03-17 16:11                 ` Joel Sherrill
2013-03-17  4:16       ` Ralf Corsepius
2013-03-17 16:05         ` Joel Sherrill [this message]
     [not found]           ` <201303181405.55098.vapier@gentoo.org>
2013-03-20 17:51             ` Joel Sherrill
2013-03-20 18:29               ` Mike Frysinger
2013-03-20 18:48                 ` Joel Sherrill
2013-03-27 11:21           ` Pedro Alves
2013-03-27 17:00             ` Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2013-03-12 23:17 GDB 7.5.91 available for testing Joel Brobecker
     [not found] ` <5140894E.6000308@oarcorp.com>
2013-03-15 12:52   ` [gdb-7.5.91] mips sim fails to build on mingw32 Ralf Corsepius
2013-03-15 18:13     ` Mike Frysinger
2013-03-15 18:32       ` Ralf Corsepius

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=5145E9AF.9080401@oarcorp.com \
    --to=joel.sherrill@oarcorp.com \
    --cc=gdb@sourceware.org \
    --cc=ralf.corsepius@rtems.org \
    --cc=vapier@gentoo.org \
    /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