[Buildroot] [PATCH] qt: fix static linking

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Apr 15 07:42:23 UTC 2016


Hello,

On Fri, 15 Apr 2016 08:54:45 +0200, Jörg Krause wrote:
> `-ldl` option is used unconditionally in `QMAKE_LIBS_DYNLOAD` while libdl is
> not supported when libc is static. As the value of `QMAKE_LIBS_DYNLOAD` goes
> into 'Libs.private' field of the pkgconfig files created by qmake, static
> linking with qt will fail with:
>   /usr/bin/ld: cannot find -ldl
> 
> Fix this issue by adding a build test to configure to check if libdl is
> supported. `QMAKE_LIBS_DYNLOAD` in "src/corelib/plugin/plugin.pri" is now used
> only if libdl is available.
> 
> Fixes:
> http://autobuild.buildroot.net/results/459/4596b9c69cbc387f1071c730aaac76723afaa853/
> http://autobuild.buildroot.net/results/459/4596b9c69cbc387f1071c730aaac76723afaa853/
> 
> Backported from Qt5:
> https://github.com/qtproject/qtbase/commit/f669ea0d54302de31456d57286aa0e4ca1443e98
> 
> Signed-off-by: Jörg Krause <joerg.krause at embedded.rocks>
> ---
>  ...with-ldl-option-only-when-it-is-supported.patch | 116 +++++++++++++++++++++
>  1 file changed, 116 insertions(+)
>  create mode 100644 package/qt/0011-Link-with-ldl-option-only-when-it-is-supported.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list