From 7a47949db90313c85d223f793eb18e18da469d5f Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 13 Jul 2026 07:19:12 +0200 Subject: [PATCH] Relax detection of cmake's compiler detection --- NEWS | 2 ++ bin/blhc | 2 +- t/logs/false-positives | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 69f73f7..ce0871d 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ Version 0.xx - Permit "no compiler commands" for cargo/rust projects. - Fix false positive in C++ compiler detection; reported by Rafael Laboissière (Debian Bug #1069576). +- Relax detection of cmake's compiler detection; reported by Sébastien Noel, + patch by Alex Muntada (Debian Bug #1125781). Version 0.14 ------------ diff --git a/bin/blhc b/bin/blhc index f90fd7a..e21528f 100755 --- a/bin/blhc +++ b/bin/blhc @@ -1151,7 +1151,7 @@ foreach my $file (@ARGV) { # Embedded `gcc -print-*` commands next if $line =~ /`$cc_regex_normal\s*[^`]*-print-\S+`/; # cmake checking for compiler flags without setting CPPFLAGS - next if $line =~ m{^\s*/usr/(bin|lib)/(ccache/)?c\+\+ (?:-std=\S+ )?-dM -E -c /usr/share/cmake-\S+/Modules/CMakeCXXCompilerABI\.cpp}; + next if $line =~ m{[cg]\+\+ .*?/usr/share/cmake-\S+/Modules/CMakeCXXCompilerABI\.cpp}; # Some rustc lines look like linker commands next if $cargo and $line =~ /$rustc_regex/o; diff --git a/t/logs/false-positives b/t/logs/false-positives index d612886..228783b 100644 --- a/t/logs/false-positives +++ b/t/logs/false-positives @@ -83,3 +83,4 @@ mv -f /build/nvidia-cuda-toolkit-10.1.243/debian/tmp/usr/lib/x86_64-linux-gnu/`g /usr/bin/c++ -std=gnu++11 -dM -E -c /usr/share/cmake-3.27/Modules/CMakeCXXCompilerABI.cpp -DKCOREADDONS_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_POSITIONING_LIB -DQT_PRINTSUPPORT_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_SQL_LIB -DQT_WEBCHANNEL_LIB -DQT_WEBENGINECORE_LIB -DQT_WEBENGINEWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/<>/obj-x86_64-linux-gnu/src -I/<>/src -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtSql -I/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtWebEngineCore -I/usr/include/x86_64-linux-gnu/qt5/QtQuick -I/usr/include/x86_64-linux-gnu/qt5/QtQmlModels -I/usr/include/x86_64-linux-gnu/qt5/QtQml -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtWebChannel -I/usr/include/x86_64-linux-gnu/qt5/QtPositioning -I/usr/include/x86_64-linux-gnu/qt5/QtWebEngineWidgets -I/usr/include/KF5/KCompletion -I/usr/include/KF5 -I/usr/include/KF5/KConfigWidgets -I/usr/include/KF5/KWidgetsAddons -I/usr/include/KF5/KConfig -I/usr/include/KF5/KConfigGui -I/usr/include/x86_64-linux-gnu/qt5/QtXml -I/usr/include/KF5/KConfigCore -I/usr/include/KF5/KCoreAddons -I/usr/include/KF5/KCodecs -I/usr/include/KF5/KAuthWidgets -I/usr/include/KF5/KAuthCore -I/usr/include/KF5/KAuth -I/usr/include/KF5/KCrash -I/usr/include/KF5/KDBusAddons -I/usr/include/x86_64-linux-gnu/qt5/QtDBus -I/usr/include/KF5/KDocTools -I/usr/include/KF5/KI18n -I/usr/include/KF5/KNotifications -I/usr/include/KF5/KIOCore -I/usr/include/KF5/KIO -I/usr/include/KF5/KService -I/usr/include/x86_64-linux-gnu/qt5/QtConcurrent -I/usr/include/KF5/KIOWidgets -I/usr/include/KF5/KIOGui -I/usr/include/KF5/KWindowSystem -I/usr/include/KF5/KJobWidgets -I/usr/include/KF5/Solid -I/usr/include/KF5/KXmlGui -I/usr/include -I/usr/include/c++/13 -I/usr/include/x86_64-linux-gnu/c++/13 -I/usr/include/c++/13/backward -I/usr/lib/gcc/x86_64-linux-gnu/13/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu /usr/lib/ccache/c++ -std=gnu++20 -dM -E -c /usr/share/cmake-3.27/Modules/CMakeCXXCompilerABI.cpp -DHAVE_OBSCONFIG_H -DQT_CORE_LIB -DQT_GUI_LIB [...] +/usr/bin/c++ -std=gnu++17 -w -dM -E /usr/share/cmake-4.2/Modules/CMakeCXXCompilerABI.cpp "-DFEATHER_TARGET_TRIPLET=\"\"" "-DFEATHER_VERSION=\"2.8.1\"" -DHAS_WEBSOCKET=1 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_NO_DEBUG=1 -DQT_SVGWIDGETS_LIB -DQT_SVG_LIB -DQT_WAYLANDCLIENT_LIB -DQT_WEBSOCKETS_LIB -DQT_WIDGETS_LIB "-DTOR_VERSION=\"\"" -DWITH_SCANNER=1 -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/obj-x86_64-linux-gnu/src/feather_autogen/include -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/monero/include -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/monero/src -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/monero/external -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/monero/external/easylogging++ -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/monero/contrib/epee/include -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/src -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/src/libwalletqt -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/src/model -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/src/utils -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/src/qrcode -I/build/reproducible-path/feather-wallet-2.8.1+dfsg/monero/contrib/epee/include -I/usr/include/x86_64-linux-gnu/qt6/QtCore -I/usr/include/x86_64-linux-gnu/qt6 -I/usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -I/usr/include/x86_64-linux-gnu/qt6/QtWidgets -I/usr/include/x86_64-linux-gnu/qt6/QtGui -I/usr/include/x86_64-linux-gnu/qt6/QtNetwork -I/usr/include/x86_64-linux-gnu/qt6/QtSvg -I/usr/include/x86_64-linux-gnu/qt6/QtWebSockets -I/usr/include/x86_64-linux-gnu/qt6/QtSvgWidgets -I/usr/include/x86_64-linux-gnu/qt6/QtMultimedia -I/usr/include/x86_64-linux-gnu/qt6/QtMultimediaWidgets -I/usr/include/x86_64-linux-gnu/qt6/QtWaylandClient -I/usr/include -I/usr/include/c++/15 -I/usr/include/x86_64-linux-gnu/c++/15 -I/usr/include/c++/15/backward -I/usr/lib/gcc/x86_64-linux-gnu/15/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -- 2.54.0