On Thu, Jan 14, 2010 at 10:21 AM, <Clement.FOUCHER@unice.fr> wrote:
Hi everybody,
I'm trying to compile glibc for a powerpc board using eldk configured for
powerpc 4XX.
I configure glibc using the following:
foucher@gentiane:~/Bureau/sources/glibc-build$
../glibc-2.9-20090518/configure
--prefix=/opt/glibc --build=x86_64-linux --host=powerpc-linux
Firstly to build the 4xx series you should be using the glibc-ports
add-on since this is an embedded processor, and soft-fp for that
matter. Glibc-ports contains the soft-fp code for the 4xx line.
git clone git://sources.redhat.com/git/glibc.git glibc
git checkout -b glibc_2.11 origin/release/2.11/master
cd glibc
git clone git://sources.redhat.com/git/glibc-ports.git ports
cd ports
git checkout -b ports_2.11 origin/release/2.11/master
To use ports you need to enable the ports add-on using:
--enable-add-ons=ports
Do you know your 4xx variant? For the sake of an example I'll use 440.
I believe by default 440 most 4xx variants are default soft-fp. The
corresponding hard-fp variants are 440fp.
I suggest that you build using --with-cpu=440. This will cause gcc to
build using -mcpu=440. I don't think using --without-fp is necessary
in this case but it can't hurt.
If you want the hard-fp variant you can do either -mcpu=440fp or
-mcpu=440 --with-fp I believe.
Since you're building on x86_64 you'll also want to cross compile so
that the build doesn't try to use itself:
echo "cross-compiling=yes" >> configparms
Here's how I've been configuring for a non-cross ppc476:
echo "cross-compiling=yes" >> configparms
AUTOCONF=/usr/local/bin/autoconf AS=/opt/toolchain/bin/as
CC='/opt/toolchain/bin/gcc -m32' CXX='/opt/toolchain/bin/g++ -m32'
CFLAGS='-O2 -g -mlong-double-128'
/home/ryanarn/glibc/stage_476_2/glibc/configure --build=powerpc-linux
--host=powerpc-linux --target=powerpc-linux --prefix=/ --exec-prefix=/
--libdir=/lib --libexecdir=/usr/lib --infodir=/usr/share/info
--mandir=/usr/share/man --datadir=/usr/share
--with-headers=/opt/at05/include --with-tls --without-fp
--with-__thread --enable-shared --enable-kernel=2.6.16 --without-cvs
--with-cpu=476 --enable-add-ons=ports,nptl
I hope this helps.
Ryan S. Arnold
IBM Linux Technology Center
(powerpc libc-ports maintainer)