Summary: | dev-db/mysql-5.1.51 fails to compile. strings/.libs/libmystrings.so: undefined reference to `finite' | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Tom Lloyd <napalmllama> |
Component: | Current packages | Assignee: | Gentoo Linux MySQL bugs team <mysql-bugs> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | embedded |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Full build log |
Description
Tom Lloyd
2011-02-18 17:04:42 UTC
Created attachment 262929 [details]
Full build log
Sorry, forgot to add this may be related to bug 344885, which appears to fail in the same file but with a different error. Bug 344885 seems unrelated - here libmystrings.so doesn't get linked with libm. Actually it is being linked to libm: ../strings/.libs/libmystrings.so -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -L/usr//lib -lz -lpthread -lcrypt -lnsl -lm but checking 'man finite': Note that these functions are obsolete. C99 defines macros isfinite(), isinf(), and isnan() (for all types) replacing them. and the problem turns out to be that uclibc libm has the C99 standard name isfinite() instead of the BSDism finite(), while glibc supports both. Replacing finite() calls by isfinite() should solve this problem. embedded: mysql-$PV/include/my_global.h contains the following (whitespace added for legibility): #ifndef isfinite # ifdef HAVE_FINITE # define isfinite(x) finite(x) # else # define finite(x) (1.0 / fabs(x) > 0.0) # endif /* HAVE_FINITE */ #endif /* isfinite */ Ergo we do NOT need to change finite() -> isfinite(), and your headers should instead not be exporting HAVE_FINITE if it's not available. See also the HAVE_ISINF block in the same file. nowhere does uClibc define HAVE_FINITE. it does however #define isfinite. so your own snippet shows the problem. mysql does not correctly provide a replacement for finite() in its headers when HAVE_FINITE is not defined but isfinite is. (In reply to comment #5) > embedded: > mysql-$PV/include/my_global.h contains the following (whitespace added for > legibility): > #ifndef isfinite > # ifdef HAVE_FINITE > # define isfinite(x) finite(x) > # else > # define finite(x) (1.0 / fabs(x) > 0.0) > # endif /* HAVE_FINITE */ > #endif /* isfinite */ > > Ergo we do NOT need to change finite() -> isfinite(), and your headers > should instead not be exporting HAVE_FINITE if it's not available. See also > the HAVE_ISINF block in the same file. I've confirmed this is still present on mysql / mariadb 5.5.28, so I assume mysql will still fail to build on uclibc. (In reply to comment #7) > (In reply to comment #5) > > Ergo we do NOT need to change finite() -> isfinite(), and your headers > > should instead not be exporting HAVE_FINITE if it's not available. See also > > the HAVE_ISINF block in the same file. > > I've confirmed this is still present on mysql / mariadb 5.5.28, so I assume > mysql will still fail to build on uclibc. Actually, the answer lies in data no longer available. From build log: checking for finite... no so config.log would have most likely given the answer, but it's not here and has been most likely long deleted since. (In reply to comment #8) you don't need a log to figure this out. uclibc's libm doesn't provide finite(). $ readelf -sW /lib/libm.so.0 | grep finite 15: 000081b0 17 FUNC GLOBAL DEFAULT 8 __finitef 24: 00008c80 36 FUNC GLOBAL DEFAULT 8 __finitel 25: 00006b88 35 FUNC GLOBAL DEFAULT 8 __finite Lets change the question then. For recent glibc, _GNU_SOURCE among other sets (in a way) -std=c99, so isinf/isfinite are defined. Could is be that uclibc provides a combination of conditions for those two, that my_global.h doesn't cover correctly ? (In reply to comment #10) uClibc provides isinf/isfinite in the headers. but configure is doing a link test for the finite symbols in libm which uClibc doesn't currently provide. if all the code cares about is isinf/isfinite, then it should do a compile test on that and skip checking for specific finite symbols. |