Subject: Re: Heads Up: Migration to gcc4
To: None <current-users@netbsd.org, port-cobalt@netbsd.org,>
From: Markus W Kilbinger <mk@kilbi.de>
List: port-cobalt
Date: 06/02/2006 16:15:56
>>>>> "Allen" == Allen Briggs <briggs@netbsd.org> writes:

    Allen> [...]
    Allen> I encourage you, current-users, to give it a workout sooner
    Allen> rather than later so we can catch any issues as early as
    Allen> possible.

I've tried gcc4 for cobalt/mipsel (cross compiled on i386):

- ./build ... distribution failed in/with:

  #     build  libgcc_s/libgcc_s.so.1.0
  rm -f libgcc_s.so.1.0
  /usr/toolchain-mipsel/bin/mipsel--netbsd-gcc -Wl,-nostdlib -B/usr/cobalt-dest/usr/lib/ -B/usr/cobalt-dest/usr/lib/   -Wl,-rpath-link,/usr/cobalt-dest/lib:/usr/cobalt-dest/usr/lib  -L/usr/cobalt-dest/lib  -Wl,-x -shared -Wl,-soname,libgcc_s.so.1  -nodefaultlibs -Wl,--version-script=/usr/src/gnu/lib/libgcc4/libgcc_s/obj.cobalt/libgcc.map  -o libgcc_s.so.1.0  -Wl,--whole-archive libgcc_s.a  -Wl,--no-whole-archive   -L/usr/cobalt-dest/usr/lib
  /usr/toolchain-mipsel/lib/gcc/mipsel--netbsd/4.1.1/../../../../mipsel--netbsd/bin/ld: /usr/cobalt-dest/usr/lib/crti.o: CALL16 reloc at 0xc not against global symbol
  /usr/cobalt-dest/usr/lib/crti.o: could not read symbols: Bad value
  collect2: ld returned 1 exit status
  
  *** Failed target:  libgcc_s.so.1.0

- Building a cobalt kernel fails with:

  cat ../../../../arch/mips/mips/genassym.cf  |  /usr/toolchain-mipsel/bin/nbgenassym -- /usr/toolchain-mipsel/bin/mipsel--netbsd-gcc  -G 0 -mno-abicalls -msoft-float -ffreestanding   -pipe -O2 -mips2 -mtune=vr5000 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-sign-compare -Wno-pointer-sign -Wno-attributes  -fno-zero-initialized-in-bss -fno-strict-aliasing    -Dcobalt -I.  -I../../../../../common/include -I../../../../arch  -I../../../.. -nostdinc -DMIPS3 -DMSGMNB="16384" -DMSGSSZ="64" -DMSGTQL="512" -DLKM -DDIAGNOSTIC -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -I../../../../lib/libkern/../../../common/lib/libc/quad -I../../../../lib/libkern/../../../common/lib/libc/string -I../../../../lib/libkern/../../../common/lib/libc/arch/mips/string  -I../../../../dist/pf   > assym.h.tmp &&  mv -f assym.h.tmp assym.h
  cc1: warnings being treated as errors
  In file included from ./machine/lock.h:3,
                   from ../../../../sys/lock.h:87,
                   from ../../../../sys/ucred.h:37,
                   from ../../../../sys/param.h:127,
                   from /tmp/genassym.1739/assym.c:2:
  ./mips/lock.h: In function '__cpu_simple_lock':
  ./mips/lock.h:100: warning: matching constraint does not allow a register
  ./mips/lock.h:75: warning: matching constraint does not allow a register
  ./mips/lock.h: In function '__cpu_simple_lock_try':
  ./mips/lock.h:129: warning: matching constraint does not allow a register
  ./mips/lock.h:108: warning: matching constraint does not allow a register
  
  *** Failed target:  assym.h

Izumi Tsutsui already mailed a solution for that:

  http://mail-index.netbsd.org/port-cobalt/2006/06/01/0001.html

... which works for me.

Markus.