[Vm-dev] fdlibm is not C99 conformant
siguctua at gmail.com
Thu Dec 30 21:36:22 UTC 2010
On 30 December 2010 20:25, David T. Lewis <lewis at mail.msen.com> wrote:
> On Thu, Dec 30, 2010 at 01:48:55AM +0100, Nicolas Cellier wrote:
>> > OK, got it, you have to compile with -D__LITTLE_ENDIAN
>> > This macro is set automatically in fdlibm.h when compiled ith -m32 but
>> > not when compiled with -m64
>> > Nicolas
>> We can add something like
>> || defined(__x86_64)
>> in fdlibm.h
>> your macro definitions can be obtained via
>> gcc -E -dM - < /dev/null
> Bravo, good catch! This solves the problem, and all KernelTests-Numbers
> are now green with a 64-bit Linux VM.
> Patching fdlibm.h solves the problem, but it is probably not good policy
> to be making local patches to the library, so I think a more general fix
> is to set __LITTLE_ENDIAN properly in the build system.
> Attached is a platforms/unix/plugins/FloatMathPlugin/config.cmake that
> addresses this, and that also sets the -O0 flag to disable gcc optimization.
> I'll forward this to Ian also for the platforms/unix update.
> Igor and Esteban, you may need to do something similar if you build a
> 32/64 bit Mac VM.
Thanks for good harvesting & team work!
> Eliot, I'm not sure if something needs to be done for the Cog platform
> tree, but if so I would expect that it is a matter of adjusting the
> makefiles to use " -D__LITTLE_ENDIAN=1 -O0"
Igor Stasenko AKA sig.
More information about the Vm-dev