I wanted to compile a source which uses feclearexcept and fetestexcept. Unfortunately the compilation ended in an error with undefined reference...
After that, I found this code for testing somewhere on the internet:
And tried to build a binary:
Code: Select all
#include <stdio.h> #include <math.h> #include <fenv.h> #pragma STDC FENV_ACCESS on int main () { feclearexcept (FE_ALL_EXCEPT); sqrt(-1); if (fetestexcept(FE_INVALID)) printf ("sqrt(-1) raises FE_INVALID\n"); return 0; }
Yeah, it looks like uClibc isn't supports the fe*except, but just to be definitely sure, I ran this command too:
Code: Select all
root@NSA320S:~# gcc -o /tmp/test /tmp/test.c -lm /tmp/ccKyBcNO.o: In function `main': test.c:(.text+0xc): undefined reference to `feclearexcept' test.c:(.text+0x20): undefined reference to `fetestexcept' collect2: error: ld returned 1 exit status
This is really strange, because the package, that I tried to compile could be a lifesaver. Is there an easy way to implement this into uClibc somehow @barmalej2?
Code: Select all
root@NSA320S:~# strings /ffp/lib/libm.so.0 | grep -E ^fe root@NSA320S:~#
Thanks