yajl does not build on uclibc because it uses math functions without linking to libm. The patch adds -lm to the compile command line Reproducible: Always Steps to Reproduce: 1. Install lilblue 2. emerge -1 dev-libs/yajl Actual Results: emake failed (compile phase) Expected Results: yajl installed on system
Created attachment 378474 [details, diff] yajl-add_libm.patch
Created attachment 378476 [details, diff] yajl-2.0.3.ebuild.patch
Comment on attachment 378474 [details, diff] yajl-add_libm.patch (In reply to René Rhéaume from comment #0) > yajl does not build on uclibc because it uses math functions without > linking to libm. The patch adds -lm to the compile command line That would apply equally to building against glibc or any other C library implementation that splits off libm. Injecting -lm into CFLAGS isn't the proper place, either.
1) Please post your `emerge --info' output in a comment. 2) Please attach the entire build log to this bug report.
Created attachment 378494 [details] build.log
Created attachment 378496 [details] emerge --info output
Should this bug added as one blocking bug 372079?
(In reply to Jeroen Roovers from comment #3) > Comment on attachment 378474 [details, diff] [details, diff] > yajl-add_libm.patch > > (In reply to René Rhéaume from comment #0) > > yajl does not build on uclibc because it uses math functions without > > linking to libm. The patch adds -lm to the compile command line > > That would apply equally to building against glibc or any other C library > implementation that splits off libm. > > Injecting -lm into CFLAGS isn't the proper place, either. I've reproduced this: emerge -1 dev-libs/yajl #fails LDFLAGS=-lm emerge -1 dev-libs/yajl #works So I suspect there is some problem with automatically linking against libm because I've seen this issue with some other packages too, nettle comes to mind. Adding LDFLAGS=-lm is harmless enough but its only a workaround, not a fix. I'm going to have to learn what makes -lm automatic.
Created attachment 411882 [details, diff] yajl-add_libm-r1.patch A better patch, in which -lm is prepended to linker flags. Another thing to note is that on glibc, the isnan symbol is inside libc.so even though the manual page states "Link with -lm"
(In reply to René Rhéaume from comment #9) > Created attachment 411882 [details, diff] [details, diff] > yajl-add_libm-r1.patch > > A better patch, in which -lm is prepended to linker flags. > > Another thing to note is that on glibc, the isnan symbol is inside libc.so > even though the manual page states "Link with -lm" This patch does not fix static build. Furthermore, TARGET_LINK_LIBRARIES is a better place for specifying libraries to use for linking.
(In reply to Jörg Krause from comment #10) > This patch does not fix static build. Furthermore, TARGET_LINK_LIBRARIES is > a better place for specifying libraries to use for linking. Can you provide a patch?
Created attachment 432412 [details, diff] yajl-add_libm-r2.patch (In reply to René Rhéaume from comment #11) > (In reply to Jörg Krause from comment #10) > > This patch does not fix static build. Furthermore, TARGET_LINK_LIBRARIES is > > a better place for specifying libraries to use for linking. > > Can you provide a patch? Well, I am providing a new patch, after reading how to use TARGET_LINK_LIBRARIES. However, when someone already knows how to make the patch, I prefer that the person makes it. It means a quicker resolution of the bug.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e0a99479df558044065d9040b535bd7068981c1 commit 8e0a99479df558044065d9040b535bd7068981c1 Author: Michael Weber <xmw@gentoo.org> AuthorDate: 2018-08-19 21:25:43 +0000 Commit: Michael Weber <xmw@gentoo.org> CommitDate: 2018-08-19 21:25:43 +0000 dev-libs/yajl: Use EAPI=6, fix build with uclibc (bug 512738). Thanks a17r and René Rhéaume. Closes: https://github.com/gentoo/gentoo/pull/9620 Closes: https://bugs.gentoo.org/512738 Package-Manager: Portage-2.3.45, Repoman-2.3.10 dev-libs/yajl/files/yajl-2.1.0-uclibc.patch | 14 +++++++++++ dev-libs/yajl/yajl-2.1.0-r1.ebuild | 38 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+)