This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: patch to split embedded and linux sh targets


>>>>> "Michael" == Michael Snyder <msnyder@redhat.com> writes:
Michael> What exactly is broken?  What are you fixing?  As far as I
Michael> know, "sh-elf" builds, and so does "sh-linux-elf".

Because sh.mt includes solib.o and solib-svr4.o in TDEPFILES, it does
not build on systems without SysVr4-like shared libraries.

For example, on NetBSD/i386 1.3, the sh-elf build fails like:

In file included from ../../gdb/solib-svr4.c:40:
/usr/include/link.h:85: field `nlist' has incomplete type
../../gdb/solib-svr4.c: In function `default_svr4_fetch_link_map_offsets':
../../gdb/solib-svr4.c:146: sizeof applied to an incomplete type
../../gdb/solib-svr4.c:148: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c:149: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c:151: sizeof applied to an incomplete type
../../gdb/solib-svr4.c:153: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c:154: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c:156: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c:157: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c:159: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c:160: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c:162: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c:163: dereferencing pointer to incomplete type
../../gdb/solib-svr4.c: In function `elf_locate_base':
../../gdb/solib-svr4.c:681: `DT_NULL' undeclared (first use this function)
../../gdb/solib-svr4.c:681: (Each undeclared identifier is reported only once
../../gdb/solib-svr4.c:681: for each function it appears in.)
../../gdb/solib-svr4.c:683: `DT_DEBUG' undeclared (first use this function)

I suspect that this is because in 1.3, NetBSD/i386 used a SunOS like
shared library scheme and it's link.h header is quite different than
what you'd find on a SysVr4/ELF system.

Since the shared library support is unnecessary for an embedded
target, the easiest thing was to split apart the linux and embedded
configs.  

The problem remains that you won't be able to build a sh-linux cross
GDB on some systems.  I think that will require that we add a header
file to src/include/elf (or something like that) so that solib-svr4.c
is not dependent on any host includes.

        --jtc

-- 
J.T. Conklin
RedBack Networks

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