Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.3, 6.6.2
-
None
-
bdb2f2015 (dev), a40532054 (6.7), dc118ad13 (6.6), 3f222b6dd (tqtc/lts-6.5)
Description
If I build qtpaths (from qtbase) with these CFLAGS/CXXFLAGS set, the resulting binary doesn't honor the file set with --qtconf option.
Tested on qt6.5.3 on Ubuntu jammy (gcc-11)
Tested on qt6.5.3 on Debian testing (gcc-13)
Tested on qt6.6.2 on Debian testing (gcc-13)
-flto=auto -ffat-lto-objects
Actually, these flags are set by default in Ubuntu 22.04. I had to remove them so that the resulting qmake/qtpaths honor --qtconf file.
Also, probably because of the same reason, qmake is affected too because the qtconf file is not taken into account to compute the correct paths. This is problematic when cross building with qmake, for example for Android.
Configuration is done this way:
cd debian/build-host && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -GNinja -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu --log-level=STATUS -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_BINDIR=lib/qt-android-6.5-host/bin -DINSTALL_LIBDIR=lib/x86_64-linux-gnu/qt-android-6.5-host -DINSTALL_LIBEXECDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/libexec -DINSTALL_ARCHDATADIR=lib/x86_64-linux-gnu/qt-android-6.5-host -DINSTALL_EXAMPLESDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/examples -DINSTALL_DATADIR=share/qt-android-6.5-host -DINSTALL_DESCRIPTIONSDIR=share/qt-android-6.5-host/modules -DINSTALL_DOCDIR=share/qt-android-6.5-host/doc -DINSTALL_SYSCONFDIR=lib/qt-android-6.5-host/etc/xdg -DINSTALL_INCLUDEDIR=include/x86_64-linux-gnu/qt-android-6.5-host -DINSTALL_PLUGINSDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/plugins -DINSTALL_TESTSDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/tests -DINSTALL_TRANSLATIONSDIR=share/qt-android-6.5-host/translations -DINSTALL_MKSPECSDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/mkspecs -DINSTALL_PUBLICBINDIR=lib/qt-android-6.5-host/bin -DBUILD_WITH_PCH=OFF -DBUILD_qt3d=OFF -DBUILD_qt5compat=OFF -DBUILD_qtactiveqt=OFF -DBUILD_qtbase=ON -DBUILD_qtcharts=OFF -DBUILD_qtcoap=OFF -DBUILD_qtconnectivity=OFF -DBUILD_qtdatavis3d=OFF -DBUILD_qtdeclarative=ON -DBUILD_qtdoc=OFF -DBUILD_qtgrpc=OFF -DBUILD_qthttpserver=OFF -DBUILD_qtimageformats=OFF -DBUILD_qtlanguageserver=OFF -DBUILD_qtlocation=OFF -DBUILD_qtlottie=OFF -DBUILD_qtmqtt=OFF -DBUILD_qtmultimedia=OFF -DBUILD_qtnetworkauth=OFF -DBUILD_qtopcua=OFF -DBUILD_qtpositioning=OFF -DBUILD_qtquick3d=ON -DBUILD_qtquick3dphysics=OFF -DBUILD_qtquickeffectmaker=OFF -DBUILD_qtquicktimeline=OFF -DBUILD_qtremoteobjects=ON -DBUILD_qtscxml=ON -DBUILD_qtsensors=OFF -DBUILD_qtserialbus=OFF -DBUILD_qtserialport=OFF -DBUILD_qtshadertools=ON -DBUILD_qtspeech=OFF -DBUILD_qtsvg=OFF -DBUILD_qttools=ON -DBUILD_qttranslations=OFF -DBUILD_qtvirtualkeyboard=OFF -DBUILD_qtwayland=OFF -DBUILD_qtwebchannel=OFF -DBUILD_qtwebengine=OFF -DBUILD_qtwebsockets=OFF -DBUILD_qtwebview=OFF -DFEATURE_accessibility=OFF -DFEATURE_assistant=ON -DFEATURE_brotli=OFF -DFEATURE_calendarwidget=ON -DFEATURE_concurrent=ON -DFEATURE_contextmenu=ON -DFEATURE_cssparser=ON -DFEATURE_cups=OFF -DFEATURE_cursor=ON -DFEATURE_dbus=OFF -DFEATURE_designer=OFF -DFEATURE_egl=OFF -DFEATURE_evdev=OFF -DFEATURE_fontconfig=OFF -DFEATURE_fontdialog=OFF -DFEATURE_freetype=OFF -DFEATURE_gif=OFF -DFEATURE_glib=OFF -DFEATURE_graphicseffect=OFF -DFEATURE_graphicsview=ON -DFEATURE_gssapi=OFF -DFEATURE_gtk3=OFF -DFEATURE_harfbuzz=OFF -DFEATURE_http=OFF -DFEATURE_ico=OFF -DFEATURE_icu=OFF -DFEATURE_islamiccivilcalendar=OFF -DFEATURE_jalalicalendar=OFF -DFEATURE_jpeg=OFF -DFEATURE_libinput=OFF -DFEATURE_libinput_hires_wheel_support=OFF -DFEATURE_linuxfb=OFF -DFEATURE_movie=OFF -DFEATURE_mtdev=OFF -DFEATURE_network=ON -DFEATURE_openssl=OFF -DFEATURE_pdf=ON -DFEATURE_pkg_config=OFF -DFEATURE_printsupport=ON -DFEATURE_qml_debug=ON -DFEATURE_qml_delegate_model=ON -DFEATURE_qml_jit=OFF -DFEATURE_qml_list_model=OFF -DFEATURE_qml_locale=ON -DFEATURE_qml_network=ON -DFEATURE_qml_preview=OFF -DFEATURE_qml_profiler=OFF -DFEATURE_qml_worker_script=OFF -DFEATURE_qml_xml_http_request=OFF -DFEATURE_qml_xmllistmodel=OFF -DFEATURE_quick3d_assimp=OFF -DFEATURE_quick_designer=OFF -DFEATURE_quick_draganddrop=ON -DFEATURE_quick_particles=OFF -DFEATURE_quick_path=OFF -DFEATURE_quickcontrols2_basic=OFF -DFEATURE_quickcontrols2_fusion=OFF -DFEATURE_quickcontrols2_imagine=OFF -DFEATURE_quickcontrols2_ios=OFF -DFEATURE_quickcontrols2_macos=OFF -DFEATURE_quickcontrols2_material=OFF -DFEATURE_quickcontrols2_universal=OFF -DFEATURE_quickcontrols2_windows=OFF -DFEATURE_quicktemplates2_calendar=OFF -DFEATURE_quicktemplates2_hover=OFF -DFEATURE_quicktemplates2_multitouch=OFF -DFEATURE_regularexpression=ON -DFEATURE_scxml_ecmascriptdatamodel=OFF -DFEATURE_sessionmanager=OFF -DFEATURE_sql=ON -DFEATURE_sql_db2=OFF -DFEATURE_sql_ibase=OFF -DFEATURE_sql_mysql=OFF -DFEATURE_sql_oci=OFF -DFEATURE_sql_odbc=OFF -DFEATURE_sql_psql=OFF -DFEATURE_sql_sqlite=ON -DFEATURE_sqlmodel=OFF -DFEATURE_ssl=OFF -DFEATURE_style_fusion=OFF -DFEATURE_style_stylesheet=ON -DFEATURE_style_windows=ON -DFEATURE_system_doubleconversion=ON -DFEATURE_system_libb2=ON -DFEATURE_system_pcre2=ON -DFEATURE_system_png=ON -DFEATURE_system_zlib=ON -DFEATURE_testlib=ON -DFEATURE_texthtmlparser=ON -DFEATURE_textmarkdownreader=OFF -DFEATURE_textmarkdownwriter=OFF -DFEATURE_textodfwriter=OFF -DFEATURE_tslib=OFF -DFEATURE_vnc=OFF -DFEATURE_vulkan=OFF -DFEATURE_widgets=ON -DFEATURE_xkbcommon=OFF -DFEATURE_xkbcommon_x11=OFF -DFEATURE_xlib=OFF -DFEATURE_xml=ON -DFEATURE_zstd=OFF -DINPUT_opengl=no -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON ../..
The set of flags shown below works fine, but if I add -flto=auto -ffat-lto-objects it would create buggy qtpaths/qmake binaries
-- [QtBase] Building architecture extraction project with the following CMake arguments: -DCMAKE_C_FLAGS=-g -O2 -ffile-prefix-map=/build/qt-android-6.5-RfNqjp/qt-android-6.5-6.5.3+ds.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DCMAKE_C_FLAGS_DEBUG=-g -DCMAKE_C_FLAGS_RELEASE=-O3 -DNDEBUG -DCMAKE_C_FLAGS_RELWITHDEBINFO=-O2 -g -DNDEBUG -DCMAKE_CXX_FLAGS=-g -O2 -ffile-prefix-map=/build/qt-android-6.5-RfNqjp/qt-android-6.5-6.5.3+ds.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DCMAKE_CXX_FLAGS_DEBUG=-g -DCMAKE_CXX_FLAGS_RELEASE=-O3 -DNDEBUG -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O2 -g -DNDEBUG -DCMAKE_OBJCOPY=/usr/bin/objcopy -DCMAKE_EXE_LINKER_FLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -DCMAKE_C_STANDARD=11 -DCMAKE_C_STANDARD_REQUIRED=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_MODULE_PATH:STRING=/build/qt-android-6.5-RfNqjp/qt-android-6.5-6.5.3+ds.2/qtbase/cmake/platforms