Re: [rfc/rft] ppc gdbserver: autodetect AltiVec and SPE

Thiago Jung Bauermann
2008-04-20T04:54:24Z

On Fri, 2008-04-18 at 23:58 -0400, Daniel Jacobowitz wrote:
> On Fri, Apr 18, 2008 at 09:07:25PM -0300, Thiago Jung Bauermann wrote:
> > gdbserver is not compiling anymore on Linux/ppc. I believe this patch is
> > the cause:
> >
> > gcc -Wall -g -O2 -I. -I../../../gdb.hg/gdb/gdbserver -I../../../gdb.hg/gdb/gdbserver/../regformats -I../../../gdb.hg/gdb/gdbserver/../../include -I../../bfd -I../../../gdb.hg/gdb/gdbserver/../../bfd -rdynamic -o gdbserver inferiors.o regcache.o remote-utils.o server.o signals.o target.o utils.o version.o mem-break.o hostio.o xml-builtin.o reg-ppc.o powerpc-32.o reg-ppc64.o powerpc-64.o linux-low.o linux-ppc-low.o hostio-errno.o thread-db.o proc-service.o \
> > -lthread_db
> > linux-ppc-low.o: In function `ppc_arch_setup':
> > ../../../gdb.hg/gdb/gdbserver/linux-ppc-low.c:255: undefined reference to `init_registers_powerpc_e500'
> > collect2: ld returned 1 exit status
> > make[4]: *** [gdbserver] Error 1
> > make[4]: Leaving directory `/home/bauermann/tmp/remove-dead-fn/build/gdb/gdbserver'
>
> Looks like you have to rerun configure. Maybe a missing dependency
> somewhere (Makefile on configure.srv?).

No, it was a clean build. I got what's happening. The patch removed
powerpc-e500.o from powerpc64-*-linux*, because e500 is 32-bit only. The
call to init_registers_powerpc_e500 is protected by an #ifndef
__powerpc64__, so it shouldn't be a problem. But in practice it is,
because when using plain "../src/configure && make" in a ppc64 machine
with a 32-bit default gcc, the target is autodetected to be
powerpc64-unknown-linux-gnu. Thus, that call to
init_registers_powerpc_e500 will be compiled in (it's a 32 bit
compilation), but powerpc-e500.o won't be included (it's a powerpc64
target).

Is such way of compiling 32-bit GDB in a ppc64 machine with 32-bit
default gcc not supported? Must one always use --target option to
configure in such case?
--
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center