ThomasMertes / seed7

Source code of Seed7
GNU General Public License v2.0
207 stars 11 forks source link

Seed7 fails on ARM #6

Closed mingodad closed 3 years ago

mingodad commented 3 years ago

While trying to build seed7 on ARM devices (Android 32/64 bits, Pinephone 64 bits) there are several tests that fail (see attached logs) for example:

chkflt 
 *** The interpreted chkflt does not work okay:

Float literals work correct.
...
Conversion from integer to float works correct.
 ***** Truncation of float does not work correct. (1)
 ***** Truncation of float does not work correct. (2)
 ***** Truncation of float does not work correct.
 ***** Rounding of float does not work correct. (1)
 ***** Rounding of float does not work correct. (2)
 ***** Rounding of float does not work correct.
...
chkbin 
 *** The interpreted chkbin does not work okay:

 ***** Converting IEEE single precision float to bin32 does not work correct.
 ***** Converting IEEE double precision float to bin64 does not work correct.
Converting bin32 and bin64 values to float works correct.

On Android 32 bits with termux it doesn't build, on 64 bits it builds with warnings and also fail tests with floating point.

make.log.zip

ThomasMertes commented 3 years ago

These errors have probably all the same source: The C run-time library function strtod(). This function is used by the Seed7 parser and by the Seed7 run-time library to convert a float literal to a Seed7 float value. Seed7 uses C run-time library functions for many purposes. The reason for that is simple. The C run-time is usually tuned for performance and is heavily tested. The problem is that Seed7 is more strict on how certain functions should work. Obviously strtod() from the C run-time library is not at a level that Seed7 expects. As long as Seed7 has not an own implementation of the strtod() function (that would be used if strtod() from the C run-time is not sufficient) this problem will persist. But basically this is not a severe problem: The float literals will just be as good as the float literals of C. Beyond corner cases in float literals you can trust the Seed7 implementation on your Android.

mingodad commented 3 years ago

And what about 32 bits on ARM ?

ThomasMertes commented 3 years ago

I assume that make.log.zip refers to the 64-bit build. So far make.log.zip looks okay (except for the strtod() issues mentioned above). Please provide also log information for the 32 bit build on ARM. If make depend succeeds the file version.h would also be helpful.

ThomasMertes commented 3 years ago

I was able to install termux on my Android 10 phone.

All this changes are in GitHub and I tested Seed7 with two makefiles (makefile and mk_clang.mak) and all the tests pass in both cases.

I cannot test 32-bit ARM. If you have information about Seed7 on 32-bit ARM please tell me. Don't hesitate to open a new issue for 32-bit ARM if building Seed7 failed or the tests fail.

So Seed7 works on 64-bit ARM.