f9548114d8
While cross-compiling, qt5webengine is building a host tool, 'gn', and
by default wants to link it statically with libstdc++, when the tool is
otherwise dynamically linked with other libraries:
$ ldd 3rdparty/gn/out/Release/gn
linux-vdso.so.1 (0x00007ffc1c999000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f48a3c06000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f48a3be4000)
libc.so.6 => /lib64/libc.so.6 (0x00007f48a3a1b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f48a3c53000)
Not all ditributions have the static libraries installed by default; for
example, on Fedora, libstdc++-static is not installed on a fresh system,
leading to build issues:
[185/185] LINK gn
FAILED: gn
/usr/bin/g++ -O3 -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-strip-all -Wl,--as-needed -static-libstdc++ -pthread -o gn -Wl,--start-group tools/gn/gn_main.o base.a gn_lib.a -Wl,--end-group -ldl
/usr/bin/ld : unable to find -lstdc++
[...]
Project ERROR: GN build error!
The root cause is the addition in [0] of a command line option to the
build of gn, that requests static linking with libstdc++ by default.
Explicitly pass that option now, to avoid static linking with libstdc++
and get a fully dynamicallty linked executable:
$ ldd 3rdparty/gn/out/Release/gn
linux-vdso.so.1 (0x00007ffd3f160000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f68138e7000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f68138c5000)
libc.so.6 => /lib64/libc.so.6 (0x00007f68136fc000)
libm.so.6 => /lib64/libm.so.6 (0x00007f68135b6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6813b13000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f681359c000)
[0]
|
||
---|---|---|
.. | ||
qt5base | ||
qt5charts | ||
qt5connectivity | ||
qt5declarative | ||
qt5enginio | ||
qt5graphicaleffects | ||
qt5imageformats | ||
qt5location | ||
qt5multimedia | ||
qt5quickcontrols | ||
qt5quickcontrols2 | ||
qt5script | ||
qt5scxml | ||
qt5sensors | ||
qt5serialbus | ||
qt5serialport | ||
qt5svg | ||
qt5tools | ||
qt5virtualkeyboard | ||
qt5wayland | ||
qt5webchannel | ||
qt5webengine | ||
qt5webkit | ||
qt5webkit-examples | ||
qt5websockets | ||
qt5webview | ||
qt5x11extras | ||
qt5xmlpatterns | ||
qt53d | ||
Config.in | ||
qt5.mk |