]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Fix false positives from cmake when probing for compiler flags
authorSimon Ruderich <simon@ruderich.org>
Tue, 5 Oct 2021 10:30:15 +0000 (12:30 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 5 Oct 2021 10:30:15 +0000 (12:30 +0200)
Modified the suggested regex slightly. See also upstream bug report
https://gitlab.kitware.com/cmake/cmake/-/issues/20631#note_746828

NEWS
bin/blhc
t/logs/false-positives

diff --git a/NEWS b/NEWS
index 9c9f8bcb06699a9d261b5b784bd253ce09e4ff7e..1d73ccd4a04fe3966fbe05ac9bc2fdb6b02e8406 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ Version 0.XX
   negatives. This could also trigger more false positives.
 - Fix false positive when calling make; reported by Fabian Wolff (Debian Bug
   #975650).
+- Fix false positives from cmake which probes for compiler flags without
+  setting CPPFLAGS; reported and suggested fix by Joao Eriberto Mota Filho
+  (Debian Bug #994154).
 
 
 Version 0.12
index b4fbbdacb1eed2492e3c6bb8607ad381671b9175..8606368f9f34e112582c4fe3a7a4ef02477b794d 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -1087,6 +1087,8 @@ foreach my $file (@ARGV) {
             next if $line =~ /^C\+\+ linker for the host machine: /;
             # 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\+\+ -dM -E -c /usr/share/cmake-\S+/Modules/CMakeCXXCompilerABI\.cpp};
 
             # Check if additional hardening options were used. Used to ensure
             # they are used for the complete build.
index 467ab6a03b1fe451dbe5e4b476789731268f7529..a9e461b1c92c3a4ee075c323e59f1c7535787d67 100644 (file)
@@ -72,3 +72,5 @@ C++ linker for the host machine: c++ ld.bfd 2.34
 mv -f /build/nvidia-cuda-toolkit-10.1.243/debian/tmp/usr/lib/x86_64-linux-gnu/`gcc -g -O2 -fdebug-prefix-map=/build/nvidia-cuda-toolkit-10.1.243=. -fstack-protector-strong -Wformat -Werror=format-security -print-multi-os-directory`/./libiberty.an /build/nvidia-cuda-toolkit-10.1.243/debian/tmp/usr/lib/x86_64-linux-gnu/`gcc -g -O2 -fdebug-prefix-map=/build/nvidia-cuda-toolkit-10.1.243=. -fstack-protector-strong -Wformat -Werror=format-security -print-multi-os-directory`/./libiberty.a
 
 (cd ../c-libs/posix-os; make VERSION="v-amd64-linux" MAKE="make" CC="gcc -std=gnu99 -Wall" CFLAGS="-O2 -m64 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro" DEFS="-DARCH_AMD64 -DSIZE_64 -DOPSYS_UNIX -DOPSYS_LINUX -D_GNU_SOURCE -DGNU_ASSEMBLER -DDLOPEN -DINDIRECT_CFUNC" CPPFLAGS="-Wdate-time -D_FORTIFY_SOURCE=2" LDFLAGS="-Wl,-z,relro" AR="ar" ARFLAGS="rcv" RANLIB="ranlib" INCLUDES="-I../../objs -I../../include -I.." libposix-os.a)
+
+/usr/lib/ccache/c++ -dM -E -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -DKCOREADDONS_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -Dlatte2plugin_EXPORTS -I/builds/qt-kde-team/extras/latte-dock/debian/output/latte-dock-0.9.11/obj-x86_64-linux-gnu/liblatte2 -I/builds/qt-kde-team/extras/latte-dock/debian/output/latte-dock-0.9.11/liblatte2 -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtQuick -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/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/KF5/KCoreAddons -I/usr/include/KF5 -I/usr/include/KF5/Plasma -I/usr/include/KF5/KService -I/usr/include/KF5/KConfigCore -I/usr/include/KF5/KPackage -I/usr/include/KF5/KWindowSystem -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/KF5/KDeclarative -I/usr/include/KF5/KIconThemes -I/usr/include -I/usr/include/c++/9 -I/usr/include/x86_64-linux-gnu/c++/9 -I/usr/include/c++/9/backward -I/usr/lib/gcc/x86_64-linux-gnu/9/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu