This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gdb-7.5.91] mips sim fails to build on mingw32


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: sockser_diff_v1.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]