calibres build system does the following for querying library search dirs: ft_lib_dirs = pkgconfig_lib_dirs('freetype2', 'FT_LIB_DIR', '/usr/lib') which translates to "take the output of pkg-config --libs-only-L freetype2, and if it fails use -L/usr/lib" - the problem is that the implementation has a bug and doesn't distinguish between failure and empty string returned - which is the case for most libraries it checks. Most notably, this causes build failures with lld, as lld now finds the linker script of 32-bit glibc which sets the link mode to elf32-i386 - which of course is wrong with a 64-bit link. This leads to errors like ld.lld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crti.o is incompatible with elf32-i386 A fix would be to set the FT_LIB_DIR, HUNSPELL_LIB_DIR and PODOFO_LIB_DIR to $(get_libdir)
Created attachment 748716 [details, diff] updated ebuild
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15d2fc6b3583b2b9431ab5f7c4afa8c38ed40d68 commit 15d2fc6b3583b2b9431ab5f7c4afa8c38ed40d68 Author: Jannik Glückert <jannik.glueckert@gmail.com> AuthorDate: 2021-11-05 01:04:32 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-11-05 02:56:22 +0000 app-text/calibre: fix libdir #821871 Closes: https://bugs.gentoo.org/821871 Signed-off-by: Jannik Glückert <jannik.glueckert@gmail.com> Signed-off-by: Zac Medico <zmedico@gentoo.org> app-text/calibre/calibre-5.31.1.ebuild | 4 ++++ 1 file changed, 4 insertions(+)
Thanks!