Error when compiling for Linux PowerPC 32-bit
Hello,
When trying to compile on powerpc 32-bit running linux, it fails with multiple errors: undefinied reference to sqrtf
Adding -lm to LIBS += fixes that, compiles and works.
I dind't make a PR about it because I don't know it it breaks for other linux platforms or not.
Best regards, Link.
Which compiler are you using? And how specifically are you compiling it?
GCC 15.2.1
compiling by just tyíng make. It doesn't happen with ppc64. Is this gcc fault, how it was compiled for this platform?
Regards, Link.
__builtin_sqrtf can resolve to either
- the
sqrtffunction in libm - native assembly instruction(s) for calculating the square root
In the case of the PowerPC ISA, although there is a fsqrts instruction for calculating the square root, it is only an optional instruction.
So I guess what happens is that the 32 bit compiler assumes it is NOT supported by default, while the 64 bit compiler assumes it is. (Apparently -mpowerpc-gpopt enables assuming that fsqrts is supported)
b4fdd26946256a1d3327fcd89d70d160986b3f98 changes the makefile so that -lm is always linked, which should resolve this.