Building libstdc++ for the PowerPC

John Fardo jfardo@laurelnetworks.com
Mon Jun 19 14:15:00 GMT 2000


Hi,

I'm trying to cross compile libstdc++-2.90.8 for the PowerPC750 on a Pentium
machine running Linux and haven't been having much success. The build fails
with warnings of multiple definitions of LITTLE_ENDIAN and BYTE_ORDER and
conflicting definitions of nan() (See below). When I build using the
libstdc++ (-v2) sources that came with gcc2.95.2, everything builds
successfully without any problems.

I've installed the libstdc++-2.90.8 sources in my gcc2.95.2 source directory
as specified in the installation docs.

I am using the following components -
    gcc-2.95.2
    binutils-2.95.0.22
    Linux header files (v. 2_2_14-1).

I am configuring gcc using the following:

../gcc-2.95.2/configure --prefix=/ppc/7xx --host=i386-linux
--target=powerpc-linux --program-prefix=powerpc-linux- --with-cpu=750
--enable-cross --enable-shared --enable-languages=c,c++
--with-headers=/ppc/7xx/powerpc-linux/include

When I do a make, I get the following errors:

/usr/src/redhat/BUILD/gcc-obj/gcc/xgcc -B/usr/src/redhat/BUILD/gcc-obj/gcc/
-B/ppc/7xx/powerpc-linux/bin/ -DHAVE_CONFIG_H -I.
-I../../../../gcc-2.95.2/libstdc++/src -I.. -nostdinc++
-I../../../../gcc-2.95.2/libstdc++ -I../../../../gcc-2.95.2/libstdc++/stl
-I../../../../gcc-2.95.2/libstdc++/libio
-I../../../../gcc-2.95.2/libstdc++/config/cpu/powerpc
-I../../../../gcc-2.95.2/libstdc++/config/newlib
-I/ppc/7xx/include -D_GNU_SOURCE -fno-implicit-templates
-Wall -Wno-format -W -Wwrite-strings -Winline -g -fhonor-std -g -O2
-fvtable-thunks -D_GNU_SOURCE -c
../../../../gcc-2.95.2/libstdc++/src/complex.cc -o complex.o
In file included from ../../../../gcc-2.95.2/libstdc++/src/complex.cc:34:
../../../../gcc-2.95.2/libstdc++/math/mathconf.h:62: warning: `LITTLE_ENDIAN'
redefined
/ppc/7xx/lib/gcc-lib/powerpc-linux/2.95.2/../../../../powerpc-linux/sys-include/endian.h:44:
warning: this is the location of the previous definition
../../../../gcc-2.95.2/libstdc++/math/mathconf.h:64: warning: `BYTE_ORDER'
redefined
/ppc/7xx/lib/gcc-lib/powerpc-linux/2.95.2/../../../../powerpc-linux/sys-include/endian.h:47:
warning: this is the location of the previous definition
In file included from ../../../../gcc-2.95.2/libstdc++/math/mathconf.h:230,
                 from ../../../../gcc-2.95.2/libstdc++/src/complex.cc:34:
../../../../gcc-2.95.2/libstdc++/math/complex-stub.h:85: declaration of C
function `double nan()' conflicts with
/ppc/7xx/lib/gcc-lib/powerpc-linux/2.95.2/../../../../powerpc-linux/sys-include/bits/mathcalls.h:209:
previous declaration `double nan(const char *)' here
make[3]: *** [complex.lo] Error 1
make[3]: Leaving directory
`/usr/src/redhat/BUILD/gcc-obj/powerpc-linux/libstdc++/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/usr/src/redhat/BUILD/gcc-obj/powerpc-linux/libstdc++'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory
`/usr/src/redhat/BUILD/gcc-obj/powerpc-linux/libstdc++'
make: *** [all-target-libstdc++] Error 2

Thanks,
John Fardo
Laurel Networks



More information about the Libstdc++ mailing list