]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Handle more cases of `moc-qt4` and support `moc-qt5`.
authorSimon Ruderich <simon@ruderich.org>
Thu, 4 Oct 2012 19:29:39 +0000 (21:29 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 4 Oct 2012 20:49:22 +0000 (22:49 +0200)
Fixes false positives.

Thanks to Felix Geyer for informing me of this issue. For more
information see Debian bug #689616.

bin/blhc
t/logs/qt4

index f2f0d6f1253055d81c918f23ca64670c37826b51..01c0e0223499d5a436cd6ec181bab6a4c20546ed 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -852,12 +852,15 @@ foreach my $file (@ARGV) {
                                 [Cc]ompiler[\s.]*:?\s+
                                 /x;
             next if $line =~ /^\s*(?:- )?(?:HOST_)?(?:CC|CXX)\s*=\s*$cc_regex_full\s*$/o;
-            # `moc-qt4`, contains '-I/usr/share/qt4/mkspecs/linux-g++' (or
-            # similar for other architectures) which gets recognized as a
-            # compiler line. Ignore it.
-            next if $line =~ m{^/usr/bin/moc-qt4
+            # `moc-qt4`/`moc-qt5` contain '-I.../linux-g++' in their command
+            # line (or similar for other architectures) which gets recognized
+            # as a compiler line, but `moc-qt*` is only a preprocessor for Qt
+            # C++ files. No hardening flags are relevant during this step,
+            # thus ignore `moc-qt*` lines. The resulting files will be
+            # compiled in a separate step (and therefore checked).
+            next if $line =~ m{^\S+/bin/moc-qt[45]
                                \s.+\s
-                               -I/usr/share/qt4/mkspecs/[a-z]+-g\++(?:-64)?
+                               -I\S+/mkspecs/[a-z]+-g\++(?:-64)?
                                \s}x;
             # Ignore false positives when the line contains only CC=gcc but no
             # other gcc command.
index c707639832c11badff9f5098f3944cb0432ed749..c5823bbdb2e136c9115e1073c93a87efdd6a3420 100644 (file)
@@ -1,8 +1,16 @@
 dpkg-buildpackage: source package test
 
-# Output by qt4 which should be ignored.
+# `moc-qt4`/`moc-qt5` are preprocessors and don't require any hardening flags.
 
 /usr/bin/moc-qt4 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtDBus -I/include -I.. -I. -I. test.h -o moc_test.cpp
 
 /usr/bin/moc-qt4 -DQT_NO_DEBUG_OUTPUT -DAPP_VERSION=1.1 -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_DBUS_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/glibc-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Ilocale -Ibuild/moc -o build/moc/moc_test.cpp
 /usr/bin/moc-qt4 -DQT_NO_DEBUG_OUTPUT -DAPP_VERSION=1.1 -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_DBUS_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Ilocale -Ibuild/moc -o build/moc/moc_test.cpp
+
+# Tests for Debian bug #678616.
+
+/tmp/buildd/qt4-x11-4.8.3+dfsg/bin/moc-qt4 -DQT_OPENGL_SUPPORT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -DQT_SHARED -I../../mkspecs/linux-g++-64 -I. -I../../include/QtCore -I../../include/QtNetwork -I../../include/QtGui -I../../include/QtOpenGL -I../../include/QtXml -I../../include/QtSql -I../../include/QtDeclarative -I../../include -I../../include/QtHelp -I/usr/X11R6/include -I/usr/X11R6/include -I.moc/release-shared demoitemanimation.h -o .moc/release-shared/moc_demoitemanimation.cpp
+
+/tmp/buildd/qtbase-opensource-src-5.0.0~beta1/bin/moc-qt5 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++-64 -I. -I../../../../include -I../../../../include/QtWidgets -I../../../../include/QtGui -I../../../../include/QtCore -I.moc/release-shared norwegianwoodstyle.h -o .moc/release-shared/moc_norwegianwoodstyle.cpp
+/tmp/buildd/qtbase-opensource-src-5.0.0~beta1/bin/moc-qt5 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++-64 -I. -I../../../../include -I../../../../include/QtWidgets -I../../../../include/QtGui -I../../../../include/QtCore -I.moc/release-shared norwegianwoodstyle.h -o .moc/release-shared/moc_norwegianwoodstyle.cpp
+/tmp/buildd/qtbase-opensource-src-5.0.0~beta1/bin/moc-qt5 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++-64 -I. -I../../../../include -I../../../../include/QtWidgets -I../../../../include/QtGui -I../../../../include/QtCore -I.moc/release-shared norwegianwoodstyle.h -o .moc/release-shared/moc_norwegianwoodstyle.cpp