On 1/19/10 11:27 AM, Zhiyong Wu wrote:
HI, openbios guys,

Today i compiled openbios on my ppc64 box, encoutered some questions:

[root@945n03 openbios]# uname -a
Linux 945n03 2.6.31.5-127.fc12.ppc64 #1 SMP Sat Nov 7 20:58:24 EST
2009 ppc64 ppc64 ppc64 GNU/Linux

[root@945n03 openbios]# rpm -qa | grep glibc
glibc-2.11-2.ppc
glibc-2.11-2.ppc64
glibc-devel-2.11-2.ppc
glibc-common-2.11-2.ppc
glibc-headers-2.11-2.ppc

[root@945n03 openbios]# rpm -qa | grep gcc
libgcc-4.4.2-7.fc12.ppc64
gcc-4.4.2-7.fc12.ppc
libgcc-4.4.2-7.fc12.ppc
gcc-c++-4.4.2-7.fc12.ppc
gcc-gfortran-4.4.2-7.fc12.ppc

[root@945n03 openbios]# gcc -v
Using built-in specs.
Target: ppc64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--disable-libjava-multilib --with-ppl --with-cloog --enable-secureplt
--with-long-double-128 --build=ppc64-redhat-linux
--target=ppc64-redhat-linux --with-cpu=default32
Thread model: posix
gcc version 4.4.2 20091027 (Red Hat 4.4.2-7) (GCC)

[root@945n03 openbios]# ./config/scripts/switch-arch ppc
Configuring OpenBIOS on ppc64 for ppc
ERROR: no powerpc cross-compiler found !

When i run "setarch 32 bash", "switch-arch" can work well, but it
fails to run "make"

[root@945n03 openbios]# uname -a
Linux 945n03 2.6.31.5-127.fc12.ppc64 #1 SMP Sat Nov 7 20:58:24 EST
2009 ppc ppc ppc GNU/Linux

[root@945n03 openbios]# ./config/scripts/switch-arch ppc
Configuring OpenBIOS on ppc for ppc
Initializing build tree obj-ppc...ok.
Creating target Makefile...ok.
Creating config files...ok.

Building OpenBIOS for ppc
Building...error:
/kvm/openbios/obj-ppc/../libc/string.c:499: undefined reference to
`_restgpr_31_x'
liblibc.a(vsprintf.o): In function `number':
/kvm/openbios/obj-ppc/../libc/vsprintf.c:55: undefined reference to
`_savegpr_19'
/kvm/openbios/obj-ppc/../libc/vsprintf.c:145: undefined reference to
`_restgpr_19_x'
liblibc.a(vsprintf.o): In function `vsnprintf':
/kvm/openbios/obj-ppc/../libc/vsprintf.c:158: undefined reference to
`_savegpr_22'
/kvm/openbios/obj-ppc/../libc/vsprintf.c:388: undefined reference to
`_restgpr_22_x'
libgcc.a(__divdi3.o): In function `__divdi3':
/kvm/openbios/obj-ppc/../libgcc/__divdi3.c:8: undefined reference to
`_savegpr_31'
/kvm/openbios/obj-ppc/../libgcc/__divdi3.c:26: undefined reference to
`_restgpr_31_x'
libgcc.a(__udivmoddi4.o): In function `__udivmoddi4':
/kvm/openbios/obj-ppc/../libgcc/__udivmoddi4.c:4: undefined reference
to `_savegpr_26'
/kvm/openbios/obj-ppc/../libgcc/__udivmoddi4.c:31: undefined reference
to `_restgpr_26_x'
make[1]: *** [openbios-qemu.elf] Error 1
make[1]: Leaving directory `/kvm/openbios/obj-ppc'
make: *** [build] Error 1

Who can give me some advices?
  

I think we need to add this somewhere... :

._savegpr_13:        stw r.13, -76(r.12)
._savegpr_14:        stw r.14, -72(r.12)
._savegpr_15:        stw r.15, -68(r.12)
._savegpr_16:        stw r.16, -64(r.12)
._savegpr_17:        stw r.17, -60(r.12)
._savegpr_18:        stw r.18, -56(r.12)
._savegpr_19:        stw r.19, -52(r.12)
._savegpr_20:        stw r.20, -48(r.12)
._savegpr_21:        stw r.23, -44(r.12)
._savegpr_22:        stw r.23, -40(r.12)
._savegpr_23:        stw r.23, -36(r.12)
._savegpr_24:        stw r.23, -32(r.12)
._savegpr_25:        stw r.23, -28(r.12)
._savegpr_26:        stw r.23, -24(r.12)
._savegpr_27:        stw r.23, -20(r.12)
._savegpr_28:        stw r.23, -16(r.12)
._savegpr_29:        stw r.23, -12(r.12)
._savegpr_30:        stw r.33, -8(r.12)
._savegpr_31:        stw r.33, -4(r.12)
                     blr


._restgpr_13:        lwz r.13, -76(r.12)
._restgpr_14:        lwz r.14, -72(r.12)
._restgpr_15:        lwz r.15, -68(r.12)
._restgpr_16:        lwz r.16, -64(r.12)
._restgpr_17:        lwz r.17, -60(r.12)
._restgpr_18:        lwz r.18, -56(r.12)
._restgpr_19:        lwz r.19, -52(r.12)
._restgpr_20:        lwz r.20, -48(r.12)
._restgpr_21:        lwz r.23, -44(r.12)
._restgpr_22:        lwz r.23, -40(r.12)
._restgpr_23:        lwz r.23, -36(r.12)
._restgpr_24:        lwz r.23, -32(r.12)
._restgpr_25:        lwz r.23, -28(r.12)
._restgpr_26:        lwz r.23, -24(r.12)
._restgpr_27:        lwz r.23, -20(r.12)
._restgpr_28:        lwz r.23, -16(r.12)
._restgpr_29:        lwz r.23, -12(r.12)
._restgpr_30:        lwz r.33, -8(r.12)
._restgpr_31:        lwz r.33, -4(r.12)
                     blr


But frankly, the better solution would be to drop our libgcc copy and use that of gcc again... It was a design mistake to let our own copy sneak in.


Stefan