Bug while cross compiling for powerpc

Justin P. Mattock justinmattock@gmail.com
Mon Jan 18 09:26:00 GMT 2010


On 01/18/10 01:21, Clément Foucher wrote:
> Hi Ryan,
>
> Thank you for your help.
>
> I just tested using your advices, but there are some problems, and I'm
> not sure what to do about that:
>
> First, my PowerPC is a 440, as you guessed (included in Xilinx ml507
> testboard).
>
> So I've retried from scratch, re-downloading glibc and glibc-ports using
> git (since I'm not familiar with git, I haven't understood the
> 'checkout" step, but no matter)
>
> I've added to my command lines the following, as you said:
> --enable-add-ons=ports
> --with-cpu=440
>
> But then, I have this message:
>
> "Checking sysdep dirs... configure: error; The 440 subspecies of PowerPc
> is not supported"
>
> ...
>
> So I tried without the "--with-cpu=440", and hope that will work. But I
> then got the following message:
>
> "'NPTL' -> if you really mean to not use this add-on, run configure
> again using the extra parameter '--disable-sanity-checks'"
>
> Before, I hadn't this message. Is this because of the version I
> downloaded? Of because I added libc-ports?
>
> Anyway, at this point, I don't know what to do... And I'm afraid that,
> since 440 is not supported, I can't use that library... But I need it
> since the applications I use on the board requires it...
>
>
> Any idea?
>
> Thank you.
>
>
> --------------------------------------------------
> From: "Ryan Arnold" <ryan.arnold@gmail.com>
> Sent: Thursday, January 14, 2010 5:53 PM
> To: <Clement.FOUCHER@unice.fr>; <libc-help@sourceware.org>
> Subject: Re: Bug while cross compiling for powerpc
>
>> 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)
>
>


what CFLAGS have you set?(-mtune=? -march=? etc..)

Justin P. Mattock



More information about the Libc-help mailing list