Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 821871

Summary: app-text/calibre links with bad libdir
Product: Gentoo Linux Reporter: Jannik Glückert <jannik.glueckert>
Component: Current packagesAssignee: Zac Medico <zmedico>
Status: RESOLVED FIXED    
Severity: normal CC: sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 731004    
Attachments: updated ebuild

Description Jannik Glückert 2021-11-04 23:49:28 UTC
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)
Comment 1 Jannik Glückert 2021-11-05 01:09:45 UTC
Created attachment 748716 [details, diff]
updated ebuild
Comment 2 Larry the Git Cow gentoo-dev 2021-11-05 02:58:19 UTC
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(+)
Comment 3 Zac Medico gentoo-dev 2021-11-05 02:59:36 UTC
Thanks!