Skip to content

Disable fatal_linker_warnings for Qt 5.15.2

Milian Wolff requested to merge work/fix-qtwebengine-centos-linker-errors into master

This hopefully unbreaks the centos cache generation, which currently fails with this error:

[2021-04-06T20:50:04.897Z] rm -f libQt5WebEngineCore.so.5.15.2 libQt5WebEngineCore.so libQt5WebEngineCore.so.5 libQt5WebEngineCore.so.5.15
[2021-04-06T20:50:04.898Z] g++ -m64 @/home/appimage/Craft/BC/linux-centos_64-gcc/build/libs/qt5/qtwebengine/work/build/src/core/release/QtWebEngineCore_o.rsp -Wl,--start-group @/home/appimage/Craft/BC/linux-centos_64-gcc/build/libs/qt5/qtwebengine/work/build/src/core/release/QtWebEngineCore_a.rsp -Wl,--end-group -Wl,-z,noexecstack -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -m64 -Wl,-O2 -Wl,--gc-sections -rdynamic -m64 -Wl,--enable-new-dtags -Wl,-rpath=/home/appimage/Craft/BC/linux-centos_64-gcc/lib -Wl,-rpath=/home/appimage/Craft/BC/linux-centos_64-gcc/lib -Wl,-whole-archive -lqtwebenginecoreapi -Wl,-no-whole-archive -Wl,--no-undefined -Wl,--version-script,QtWebEngineCore.version -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN -Wl,-rpath,\$ORIGIN -shared -Wl,-Bsymbolic-functions -Wl,-soname,libQt5WebEngineCore.so.5 -o libQt5WebEngineCore.so.5.15.2   -L/usr/X11R6/lib64 -L/home/appimage/Craft/BC/linux-centos_64-gcc/lib /home/appimage/Craft/BC/linux-centos_64-gcc/lib/libQt5Quick.so /home/appimage/Craft/BC/linux-centos_64-gcc/lib/libQt5Gui.so /home/appimage/Craft/BC/linux-centos_64-gcc/lib/libQt5QmlModels.so /home/appimage/Craft/BC/linux-centos_64-gcc/lib/libQt5WebChannel.so /home/appimage/Craft/BC/linux-centos_64-gcc/lib/libQt5Qml.so /home/appimage/Craft/BC/linux-centos_64-gcc/lib/libQt5Network.so /home/appimage/Craft/BC/linux-centos_64-gcc/lib/libQt5Positioning.so /home/appimage/Craft/BC/linux-centos_64-gcc/lib/libQt5Core.so -lpthread -L/usr/lib64 -lGL -lpthread -ldl -lrt -licui18n -licuuc -licudata -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lresolv -ljpeg -lm -lopus -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrender -lXrandr -lpng16 -lz -lwebpmux -lwebpdemux -lwebp -lfreetype -lexpat -lfontconfig -lharfbuzz -lX11-xcb -lxcb -lxcb-dri3 -lXcursor -lXi -lXtst -lxkbcommon -ldbus-1 -lpci -lasound -lavcodec -lavformat -lavutil -llcms2 -L/home/appimage/Craft/BC/linux-centos_64-gcc/build/libs/qt5/qtwebengine/work/build/src/core/api/release -lGL
[2021-04-06T20:50:26.785Z] /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: warning: /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libstdc++_nonshared.a(cow-sstream-inst.o): conflicting default version definition for _ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEED0Ev@@Qt_5
[2021-04-06T20:50:26.785Z] /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /usr/lib64/libstdc++.so.6: previous definition of _ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEED0Ev@@GLIBCXX_3.4 here
[2021-04-06T20:50:26.785Z] /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: warning: /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libstdc++_nonshared.a(cow-sstream-inst.o): conflicting default version definition for _ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEED1Ev@@Qt_5
[2021-04-06T20:50:26.785Z] /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /usr/lib64/libstdc++.so.6: previous definition of _ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEED1Ev@@GLIBCXX_3.4 here
[2021-04-06T20:50:26.785Z] /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: warning: /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libstdc++_nonshared.a(cow-sstream-inst.o): conflicting default version definition for _ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEED0Ev@@Qt_5
[2021-04-06T20:50:26.785Z] /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /usr/lib64/libstdc++.so.6: previous definition of _ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEED0Ev@@GLIBCXX_3.4 here
[2021-04-06T20:50:26.785Z] /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: warning: /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libstdc++_nonshared.a(cow-sstream-inst.o): conflicting default version definition for _ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEED1Ev@@Qt_5
[2021-04-06T20:50:26.785Z] /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /usr/lib64/libstdc++.so.6: previous definition of _ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEED1Ev@@GLIBCXX_3.4 here
[2021-04-06T20:50:26.785Z] /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: error: treating warnings as errors
[2021-04-06T20:50:26.785Z] collect2: error: ld returned 1 exit status
[2021-04-06T20:50:26.785Z] make[3]: *** [Makefile.core_module:81: ../../lib/libQt5WebEngineCore.so.5.15.2] Error 1

I have tried to hunt down the reason for this ODR violation, but I cannot figure it out so far... I'd say let's try and see if this works and if not, then we can always roll it back later again if needed.

There's prior art for this in the gentoo world though, see:

https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-qt/qtwebengine/files/qtwebengine-5.15.0-disable-fatal-warnings.patch

@vonreth @bcooksley

Edited by Milian Wolff

Merge request reports