Re: S/390 Linux doesn't link on trunk

Dr. Jochen Röhrig
2002-04-15T17:06:33Z

On Sunday, 7. April 2002 23:38, you wrote:
> Just FYI; I didn't try the branch. The error is:
>
> gcc -O2 -g -Wl,-rpath,/usr/lib -o gdb \
> main.o libgdb.a cli-dump.o cli-decode.o cli-script.o cli-cmds.o
> cli-setshow.o cli-utils.o mi-out.o mi-console.o mi-cmds.o mi-cmd-var.o
> mi-cmd-break.o mi-cmd-stack.o mi-cmd-disas.o mi-main.o mi-parse.o
> mi-getopt.o tui-file.o tui.o tuiData.o tuiSource.o tuiStack.o tuiIO.o
> tuiGeneralWin.o tuiLayout.o tuiWin.o tuiCommand.o tuiDisassem.o
> tuiSourceWin.o tuiRegs.o tuiDataWin.o tui-out.o tui-hooks.o
> ../bfd/libbfd.a -lreadline ../opcodes/libopcodes.a
> ../libiberty/libiberty.a -lncurses -lm ../libiberty/libiberty.a \ -ldl
> -rdynamic
> libgdb.a(inftarg.o): In function `init_child_ops':
> /home/buildd/build/gdb-5.2.cvs20020401/objdir/gdb/../../gdb/inftarg.c:754:
> undefined reference to `child_pid_to_exec_file' collect2: ld returned 1

The problem can be circumvented by adding a

#undef CHILD_PID_TO_EXEC_FILE

after the "#include "config/nm-linux.h"-line in config/s390/nm-linux.h (at
least the current Debian gdb-source package version 5.2.cvs20020401-3 builds
after this modification and gbd seems to work).

The problem arises from the unconditional definition of
CHILD_PID_TO_EXEC_FILE at the end of config/nm-linux.h. According to the
CVS-log this was added in Revision 1.11 of config/nm-linux.h on January, 8th.
There were also changes made in config/<arch>/linux.mh for some architectures
(linking with linux-proc.o), which, as far as I can judge it, avoid the above
described problem on theses architectures. However s390 (and, as it seems,
some other architectures), doesn't have a config/<arch>/linux.mh so no
modifications were made for s390.

My question now: are we missing something for s390 because we don't have the
config/s390/linux.mh-file or are the changes to config/s390/nm-linux.h that I
described above a correct solution for the problem? Or would it instead be a
better solution to add a "NATDEPFILES += linux-proc.o" to config/s390/s390.mh?

Jochen

--
Dr. Jochen Röhrig
Linux for eServer Development
IBM Deutschland Entwicklung GmbH, Schönaicher Str. 220, 71032 Böblingen
roehrig@de.ibm.com