Subject: link trouble on hp700
To: None <tech-toolchain@NetBSD.org>
From: Jochen Kunz <jkunz@unixag-kl.fh-kl.de>
List: tech-toolchain
Date: 12/27/2003 12:46:56
Hi.

I tried to build a hp700 user land. Besides other problems I got:
---------->
#      link  ld.elf_so
/usr/src/src-current/tooldir/bin/hppa--netbsd-ld  -Bshareable -Bsymbolic -e=
 '$rtld_start' --script /usr/src/src-current/src/libexec/ld.elf_so/arch/hpp=
a/ld.so.script  -o ld.elf_so rtld_start.o hppa_reloc.o rtld.o reloc.o symbo=
l.o malloc.o xmalloc.o xprintf.o debug.o map_object.o load.o search.o heade=
rs.o paths.o `/usr/src/src-current/tooldir/bin/hppa--netbsd-gcc -print-libg=
cc-file-name` -L/usr/src/src-current/objdir/hp700/lib/libc -L/usr/src/src-c=
urrent/destdir/hp700/usr/lib -non_shared -lc_pic=20
/usr/src/src-current/tooldir/bin/hppa--netbsd-ld: cannot open libgcc.a: No =
such file or directory

*** Failed target:  ld.elf_so
*** Failed command: /usr/src/src-current/tooldir/bin/hppa--netbsd-ld -Bshar=
eable -Bsymbolic -e '$rtld_start' --script /usr/src/src-current/src/libexec=
/ld.elf_so/arch/hppa/ld.so.script -o ld.elf_so rtld_start.o hppa_reloc.o rt=
ld.o reloc.o symbol.o malloc.o xmalloc.o xprintf.o debug.o map_object.o loa=
d.o search.o headers.o paths.o `/usr/src/src-current/tooldir/bin/hppa--netb=
sd-gcc -print-libgcc-file-name` -L/usr/src/src-current/objdir/hp700/lib/lib=
c -L/usr/src/src-current/destdir/hp700/usr/lib -non_shared -lc_pic=20
*** Error code 1

Stop.
nbmake: stopped in /usr/src/src-current/src/libexec/ld.elf_so
<----------

But libgcc.a is in the include path:
---------->
$ find /usr/src/src-current/destdir -name 'lib*gcc*'=20
/usr/src/src-current/destdir/hp700/usr/lib/libgcc.a
/usr/src/src-current/destdir/hp700/usr/lib/libgcc_pic.a
<----------

So I run ktrace on nbmake and got:
---------->
$ kdump | grep -A4 -B10 'L/usr/src/src-current/destdir/hp700/usr/lib'      =
      <
        \^Y\^Q\^S\^V\^O\^A\0\^T\M^?\0\0%\M^@\0\0%\M^@"
  5620 nbmake   RET   ioctl 0, 1076655123/0x402c7413
  5620 nbmake   CALL  write(0x1,0xd0000,0x1f4)
  5620 nbmake   GIO   fd 1 wrote 500 bytes
       "/usr/src/src-current/tooldir/bin/hppa--netbsd-ld  -Bshareable -Bsym=
bol\
        ic -e '$rtld_start' --script /usr/src/src-current/src/libexec/ld.el=
f_s\
        o/arch/hppa/ld.so.script  -o ld.elf_so rtld_start.o hppa_reloc.o rt=
ld.\
        o reloc.o symbol.o malloc.o xmalloc.o xprintf.o debug.o map_object.=
o l\
        oad.o search.o headers.o paths.o `/usr/src/src-current/tooldir/bin/=
hpp\
        a--netbsd-gcc -print-libgcc-file-name` -L/usr/src/src-current/objdi=
r/h\
        p700/lib/libc -L/usr/src/src-current/destdir/hp700/usr/lib -non_sha=
red\
         -lc_pic=20
       "
  5620 nbmake   RET   write 500/0x1f4, 851968/0xd0000
  5620 nbmake   CALL  __vfork14

$ kdump |grep -A2 /libgcc.a
  3941 hppa--netbsd-gcc NAMI  "/usr/src/src-current/tooldir/lib/gcc-lib/hpp=
a--netbsd/3.3.2/libgcc.a"
  3941 hppa--netbsd-gcc RET   access -1 errno 2 No such file or directory
  3941 hppa--netbsd-gcc CALL  access(0x3d600,0x4)
  3941 hppa--netbsd-gcc NAMI  "/usr/lib/gcc/hppa--netbsd/3.3.2/libgcc.a"
  3941 hppa--netbsd-gcc RET   access -1 errno 2 No such file or directory
  3941 hppa--netbsd-gcc CALL  access(0x3d600,0x4)
  3941 hppa--netbsd-gcc NAMI  "/usr/src/src-current/tooldir/lib/gcc-lib/hpp=
a--netbsd/3.3.2/../../../../hppa--netbsd/lib/hppa--netbsd/3.3.2/libgcc.a"
  3941 hppa--netbsd-gcc RET   access -1 errno 2 No such file or directory
  3941 hppa--netbsd-gcc CALL  access(0x3d600,0x4)
  3941 hppa--netbsd-gcc NAMI  "/usr/src/src-current/tooldir/lib/gcc-lib/hpp=
a--netbsd/3.3.2/../../../../hppa--netbsd/lib/libgcc.a"
  3941 hppa--netbsd-gcc RET   access -1 errno 2 No such file or directory
  3941 hppa--netbsd-gcc CALL  __fstat13(0x1,0xefffebc0)
<----------

So ld is called with the correct -L but it ignores it?!
Is this some strange bug or do I miss somthing here?=20
Why is libgcc.a searched only in the tooldir?
--=20


tsch=FC=DF,
       Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/