Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 821871 - app-text/calibre links with bad libdir
Summary: app-text/calibre links with bad libdir
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Zac Medico
Depends on:
Blocks: LD-is-lld, systemwide-lld
  Show dependency tree
Reported: 2021-11-04 23:49 UTC by Jannik Glückert
Modified: 2021-11-05 02:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

updated ebuild (0001-app-text-calibre-fix-821871.patch,1.02 KB, patch)
2021-11-05 01:09 UTC, Jannik Glückert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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):

commit 15d2fc6b3583b2b9431ab5f7c4afa8c38ed40d68
Author:     Jannik Glückert <>
AuthorDate: 2021-11-05 01:04:32 +0000
Commit:     Zac Medico <>
CommitDate: 2021-11-05 02:56:22 +0000

    app-text/calibre: fix libdir #821871
    Signed-off-by: Jannik Glückert <>
    Signed-off-by: Zac Medico <>

 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