[oe] powerpc-g++ 4.2.4 problem casting long long to double

Vitus Jensen vjensen at gmx.de
Fri May 21 11:12:25 UTC 2010


On Wed, 19 May 2010, Koen Kooi wrote:

> On 19-05-10 17:46, Vitus Jensen wrote:
>> On Wed, 19 May 2010, Vitus Jensen wrote:
>>> On Wed, 19 May 2010, Gary Thomas wrote:
>>>>  On 05/19/2010 03:38 AM, Vitus Jensen wrote:
>>>>>>   We noticed a strange problem with C++ code casting long long
>>>> variables
>>>>>   to double, as a lot of qt-embedded code is doing.
>>>>>>   =================
>>>>>   double
>>>>>   convert(long long l)
>>>>>   {
>>>>>   return (double)l; // or double(l)
>>>>>   }
>>>>>>   int
>>>>>   main(int argc, char * argv[])
>>>>>   {
>>>>>   long long l = 10;
>>>>>   double f;
>>>>>>   f = convert(l);
>>>>>   printf("convert: %lld => %f\n", l, f);
>>>>>   return 0;
>>>>>   }
>>>>>   ====================
>>>>>>   output:
>>>>>   convert: 10 => 0.000000
>>>>>>   C++ compiled via powerpc-angstrom-linux-g++ gives the above
>>>> result.
>>>>>   Compiling the same code as C using powerpc-angstrom-linux-gcc works
>>>>>   fine. But when looking at the assembler code both compiler produce
>>>>>   virtually identical output and both call __floatdidf to do the
>>>> actual
>>>>>   conversion. Very strange, has anyone ever seen similar effects?
>>>>
>>>>  Is this from a recent tree (i.e. post Richard Purdie's restructuring)?
>>>>
>>>>  I've seen similar problems with C++ code on Poky which uses the same
>>>>  changes.
>>>
>>> No, I'm building everything from the stable branch.  There were some
>>> commits cherry-picked from .dev but those only add Qt 4.5.2.
>>>
>>> Poky is ARM only, right?  Perhaps it would be helpfull to build a
>>> compiler from .dev and for a widely used powerpc-platform?  How does
>>> n1200 sound? It uses the same ppc603e.
>>
>> Unfortunately .dev switched to gcc-4.3.3 in the meantime which fails for
>> ppc603e platforms because of undefined references to __nldbl_fprintf and
>> __nldbl_sprintf during compile.
>>
>> Platform tqm8540 (ppce500, just to try some other ppc cpu) fails in
>> gcc-4.3.3 compile, too.  Possible related to this:
>>
>> endian.h:34:4: warning: #warning Cannot determine current byte order,
>> assuming big-endian.
>>
>> So currently .dev should be unbuildable for ppc users?  Without
>> selecting a non-default compiler that is.
>
> I thought I pinned powerpc at 4.1.1, but it turns out that it was only
> for ppc405:
>
> ANGSTROM_GCC_VERSION_ppc405         ?= "4.1.1"
>
> Feel free to send patches to add that for other ppc platforms.

I'd loved to but it should be a usable version for ppc603e.  We have used 
ELDK gcc 3.3.3 in the past so that version would be a known good one.

[stable/2009]
4.2.4  wrong result
4.1.1  wrong result (see first posting)
3.3.3  doesn't compile, obstack macro problem
3.3.4  doesn't compile, signal.h stack_t problem

[org.openembedded.dev]
4.3.3  doesn't compile
4.1.1  doesn't compile
4.2.4  doesn't compile, libstdc++ problem

All compilations in the .dev branch used MACHINE=n1200, in stable I used 
our bluepro.  Always a clean build of meta-toolchain.  I know that there 
are currently problems in .dev so I will wait/monitor the list and try to 
get 3.3.3 and something newer than 4.3.3. to compile.

Vitus

-- 
Vitus Jensen, Hannover, Germany, Universe (current)
pgp public key available from keyservers




More information about the Openembedded-devel mailing list