Closed pekn closed 4 years ago
Hi. It builds fine on x86_64, but it looks like there's a CPU instruction that handles it. Can you change fmin
in the code to __builtin_fmin
and see if that will make it work without libm?
Also according to this: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html GCC should automatically handle fmin and some others as builtin functions... so hmm...
I changed to __builtin_fmin and still gives same error.
Out in left field here with this stuff but is fmin part of the math.h? if so this says to link the math library by adding the -lm flags when compiling with gcc
I can confirm the error message on Ubuntu 18.04 on a x64 as well as arm architecture (raspian buster).adding -lm to the compiler flags doesn't help.
@grubec it's in plist.c not in plist.h
@zinglax @pekn I just pushed commit ce1092a5fc83e1b5590128b5f642200c382451a6 which should add -lm
to the linker flags if required. Let me know if this works.
@nikias Thank you very much! ... just figured out my mistake as well ;)
tried it, but is still gives me a: CC plistutil.o CCLD plistutil ../src/.libs/libplist.so: undefined reference to `fmin' collect2: error: ld returned 1 exit status Makefile:418: recipe for target 'plistutil' failed make[2]: *** [plistutil] Error 1
same as if I add -lm manually :(
Yes... I just started an old ubuntu 12.04 VM and it shows me the same. Working on it.
Can you try with commit https://github.com/libimobiledevice/libplist/commit/a2d66545d1303dd2cb5e0d56761aaf8a96bbc282 ?
Make sure to also do make clean
and run autogen.sh
again.
Yes, that did the trick. Thanks @nikias
It also works on my ubuntu 18.04 x86_64 but my compiler just replaces it with a floating point CPU instruction 🤷♂️ With the check I added it will add -lm if required. Anyway, @pekn it should also work for you now. Feel free to re-open if the problem persists.
Latest libplist does not link properly
The following error occurs:
(Tested with Ubuntu 18.04)
Should libplist link against libm as well?