This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Fix for sparc-lynxos build
From: Michael Snyder <msnyder@redhat.com>
Date: Tue, 23 Apr 2002 12:05:36 -0700
"David S. Miller" wrote:
>
> remote.c, if SOLIB_CREATE_INFERIOR_HOOK is define, calls
> no_shared_libraries. sparc-lynxos uses coff-solib.c which
> does not provide this function, thus the final link of the
> build fails.
>
> This adds a dummy definition so at least this target can link
> successfully, but keep a FIXME comment there so that this gets
> some attention in the future.
>
> Ok to install?
I'm worried that, once this goes in, it may never get fixed.
How about at least making it print a warning?
>
> 2002-04-21 David S. Miller <davem@redhat.com>
>
> * coff-solib.c (no_shared_libraries): Add dummy implementation.
>
I looked some more into this, and there are many other problems
to do with this function.
First of all, if we add an implementation to coff-solib.c we
have a problem for the rs6000lynx configuration because:
config/rs6000/rs6000lynx.mt:TDEPFILES= coff-solib.o rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o
This brings in both coff-solib.o and solib.o, thus we would end up
with two instances of this symbol and the build would fail....
Well, even now rs6000-lynxos fails to link for other reasons:
libgdb.a(buildsym.o): In function `end_symtab':
_SC_REALTIME_SIGNALS/../../src/gdb/buildsym.c:951: undefined reference to `aix_process_linenos'
Oops.
Not only that, this situation exists already via xcoffsolib.o,
consider:
config/rs6000/rs6000.mh: xcoffsolib.o
config/rs6000/rs6000.mt:TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o solib.o solib-svr4.o
Ie. this configuration brings in both xcoffsolib.o (which has an empty
no_shared_libraries implementation) as well as solib.o (which has a
real implementation). This should cause a build failure too.
It seems that implementing no_shared_libraries for xcoffsolib.c and
coff-solib.c with just a call to objfile_purge_solibs() would be
correct.
However, maybe an even more correct solution is to not have any
implementation in xcoffsolib.c and coff-solib.c. Then add solib.o
to the appropriate target makefile fragments.
Comments?