[Vm-dev] FloatMathPlugin: patch for squeak 4.19.2 fdlibm.h header

David T. Lewis lewis at mail.msen.com
Sun Dec 13 18:26:49 UTC 2020

On Sun, Dec 13, 2020 at 07:03:47PM +0100, stes at PANDORA.BE wrote:
> In the cmake.config
> platforms/unix/plugins/FloatMathPlugin/config.cmake
> it says:
> # fdlibm.h does not recognize x86_64, so set endianness here for all platforms.
> ENDIF ()
> So basically the cmake is testing IS_BIG_ENDIAN and if not so,
> then it defines __LITTLE_ENDIAN.
> That's fine but the problem is that the old code in the fdlibm.h header
> is #define __LITTLE_ENDIAN which (1) is a duplicate def and (2) defines
> to a different value (because it does not define it =1).
> So assuming you want to keep the definition at the cmake level (for x64),
> then in the header file it should be conditional
> #ifndef __LITTLE_ENDIAN  (if not already defined on the command line)
> David Stes

Oh, that is good, the config.cmake is already handling it. I like your idea
of using  #ifndef __LITTLE_ENDIAN to prevent redefinition in fdlibm.h. It is
a minimal change to the original Sun code and it will have no adverse effect
on other platforms.

I tried this on my Linux box. It compiles without warnings, and all of the
FloatMathPluginTests tests are green (these are in the VMMaker package, not
Squeak trunk).

It's a trivial change but I'm attaching a copy of the file I used for reference.
If you can confirm that this does what is needed on Solaris, I'll push the
update to SVN for you.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fdlibm.h
Type: text/x-chdr
Size: 6283 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20201213/bd8fa0b7/attachment.h>

More information about the Vm-dev mailing list