coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
516 stars 258 forks source link

libjson.so: undefined reference to `__isinf' when compile with commit a4a67f193e6a8087050a8148e26c5e03f5dd12b8 #184

Closed bingyunxl closed 8 years ago

bingyunxl commented 8 years ago

/home/wplus/openwrt_x86_1407/build_dir/target-i386_i486_uClibc-0.9.33.2/coova-chilli-master/json/.libs/libjson.so: undefined reference to __isinf' /home/wplus/openwrt_x86_1407/build_dir/target-i386_i486_uClibc-0.9.33.2/coova-chilli-master/json/.libs/libjson.so: undefined reference to__isnan' collect2: error: ld returned 1 exit status make[6]: * [chilli] Error 1 make[6]: Leaving directory `/home/wplus/openwrt_x86_1407/build_dir/target-i386_i486_uClibc-0.9.33.2/coova-chilli-master/src' make[5]: * [all-recursive] Error 1 make[5]: Leaving directory/home/wplus/openwrt_x86_1407/build_dir/target-i386_i486_uClibc-0.9.33.2/coova-chilli-master/src' make[4]: **\* [all-recursive] Error 1 make[4]: Leaving directory/home/wplus/openwrt_x86_1407/build_dir/target-i386_i486_uClibc-0.9.33.2/coova-chilli-master' make[3]: [all] Error 2 make[3]: Leaving directory`/home/wplus/openwrt_x86_1407/build_dir/target-i386_i486_uClibc-0.9.33.2/coova-chilli-master' make[2]: \ [/home/wplus/openwrt_x86_1407/build_dir/target-i386_i486_uClibc-0.9.33.2/coova-chilli-master/.built] Error 2 make[2]: Leaving directory /home/wplus/openwrt_x86_1407/feeds/oldpackages/net/coova-chilli' make[1]: *** [package/feeds/oldpackages/coova-chilli/install] Error 2 make[1]: Leaving directory/home/wplus/openwrt_x86_1407' make: *\ [package/coova-chilli/install] Error 2

bingyunxl commented 8 years ago

env: openwrt 1407

bingyunxl commented 8 years ago

203-fix-json-compile.patch.txt

this patch file can fix this error, pls close this issue

sevan commented 8 years ago

thanks for the patch, instead of adding a new test, can you try replacing float.h with math.h on lines 115 & 116 of configure.ac and reporting back the result. (remove the change you proposed in the patch as well before running the build).

AC_CHECK_DECLS([_isnan], [], [], [[#include <float.h>]]) AC_CHECK_DECLS([_finite], [], [], [[#include <float.h>]])

bingyunxl commented 8 years ago

@sevan sorry, it dosen't work, still print this error

sevan commented 8 years ago

And if you try

AC_CHECK_DECLS([_isnan], [LIBS="$LIBS -lm"], [], [[#include <math.h>]]) AC_CHECK_DECLS([_finite], [LIBS="$LIBS -lm"], [], [[#include <math.h>]])

bingyunxl commented 8 years ago

It dosen't work again, but follow your mind, I change configure.ac at line 113 & 114 like this:

AC_CHECK_DECLS([isnan], [LIBS="$LIBS -lm"], [], [[#include ]]) AC_CHECK_DECLS([isinf], [LIBS="$LIBS -lm"], [], [[#include ]])

then, compile pass

sevan commented 8 years ago

Thanks, I'll follow up with upstream to see why they take this approach, according to the POSIX spec, those functions should be defined in math.h, I'm assuming this may have something to do with Windows based on a comment but not sure, either way, It's redundant in coova as we don't support Windows

sevan commented 8 years ago

Asked a question upstream, json-c/json-c/issues/217

CristiCimpianu commented 8 years ago

isnan and isinf are defined in glibc, but not in uclibc. I stumbled accross this yesterday and came up with 0d523af6cf213aeac4752597df635a636c759553.