[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#958479: marked as done (qmake passes unsupported -isystem to gcc)



Your message dated Sun, 02 Aug 2020 09:05:24 +0000
with message-id <E1k29vo-0007z5-OX@fasolo.debian.org>
and subject line Bug#958479: fixed in qtbase-opensource-src 5.14.2+dfsg-5
has caused the Debian Bug report #958479,
regarding qmake passes unsupported -isystem to gcc
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
958479: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958479
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: qt5-qmake
Version: 5.12.5+dfsg-10
Severity: important
Tags: ftbfs patch upstream
Control: affects -1 + src:deepin-music
Control: block 798955 by -1

The context of this bug is #798955 aka moving glibc headers from
/usr/include to /usr/include/<triplet>. When doing this, some packages
FTBFS with the symptom that <cstdlib> or <cmath> fail to find
#include_next <stdlib.h> or #include_next <math.h> respectively. The
cause is passing -isystem /usr/include/<triplet> to the compiler. I
asked libstdc++ upstream to fix this, but the reply was that passing
this flag is unsupported (see bug log of #798955). The takeaway is:
Pass -isystem /usr/include or -isystem /usr/include/<triplet> is broken.

Unfortunately, qmake does exactly that. It collects include directories
(e.g. from pkg-config file). For instance libavutil.pc contains
includedir=/usr/include/<triplet>. The collected directories reside in a
variable INCLUDEPATH. It then passes -isystem for every path that
resides below a set of compiler include directories and -I for
everything else. Since /usr/include/<triplet> resides below
/usr/include, qmake turns the flag into -isystem. Doing so changes the
order of -isystem directories and breaks gcc. I think this is a bug in
qmake. The resuling flags are assigned to a variable INCPATH. The
relevant source can be found at:
https://sources.debian.org/src/qtbase-opensource-src/5.12.5+dfsg-10/qmake/generators/unix/unixmake2.cpp/#L196

An example of an affected package is deepin-music. I think around 10 (an
upper bound seems to be 30, but that includes other causes). You can
quickly check whether a package is affected by grepping a build log for
"-isystem /usr/include/<triplet>".

I can also propose a solution. When constructing INCPATH, any directory
that directly is a compiler search directory (not a subdirectory
thereof), the directory should be skipped. Doing so ensures that the
order of compiler search directories is not changed. The possible harm
seems quite limited given that the compiler will already search these
directories (just in the correct order).

What do you think?

Please expect that this bug becomes a regular ftbfs bug eventually.

Helmut
--- qtbase-opensource-src-5.12.5+dfsg.orig/qmake/generators/makefiledeps.cpp
+++ qtbase-opensource-src-5.12.5+dfsg/qmake/generators/makefiledeps.cpp
@@ -359,6 +359,11 @@
     return false;
 }
 
+bool QMakeSourceFileInfo::isCompilerInclude(const QString &name)
+{
+    return systemIncludes.contains(name);
+}
+
 char *QMakeSourceFileInfo::getBuffer(int s) {
     if(!spare_buffer || spare_buffer_size < s)
         spare_buffer = (char *)realloc(spare_buffer, spare_buffer_size=s);
--- qtbase-opensource-src-5.12.5+dfsg.orig/qmake/generators/makefiledeps.h
+++ qtbase-opensource-src-5.12.5+dfsg/qmake/generators/makefiledeps.h
@@ -106,6 +106,7 @@
     void addSourceFile(const QString &, uchar seek, SourceFileType type=TYPE_C);
     bool containsSourceFile(const QString &, SourceFileType type=TYPE_C);
     bool isSystemInclude(const QString &);
+    bool isCompilerInclude(const QString &);
 
     int included(const QString &file);
     QStringList dependencies(const QString &file);
--- qtbase-opensource-src-5.12.5+dfsg.orig/qmake/generators/unix/unixmake2.cpp
+++ qtbase-opensource-src-5.12.5+dfsg/qmake/generators/unix/unixmake2.cpp
@@ -202,11 +202,12 @@
             if (inc.isEmpty())
                 continue;
 
-            if (!isystem.isEmpty() && isSystemInclude(inc.toQString()))
-                t << ' ' << isystem << ' ';
+	    if (isCompilerInclude(inc.toQString()))
+		;
+	    else if (!isystem.isEmpty() && isSystemInclude(inc.toQString()))
+                t << ' ' << isystem << ' ' << escapeFilePath(inc);
             else
-                t << " -I";
-            t << escapeFilePath(inc);
+                t << " -I" << escapeFilePath(inc);
         }
     }
     if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))

--- End Message ---
--- Begin Message ---
Source: qtbase-opensource-src
Source-Version: 5.14.2+dfsg-5
Done: Dmitry Shachnev <mitya57@debian.org>

We believe that the bug you reported is fixed in the latest version of
qtbase-opensource-src, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 958479@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dmitry Shachnev <mitya57@debian.org> (supplier of updated qtbase-opensource-src package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 02 Aug 2020 11:49:03 +0300
Source: qtbase-opensource-src
Architecture: source
Version: 5.14.2+dfsg-5
Distribution: unstable
Urgency: medium
Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Changed-By: Dmitry Shachnev <mitya57@debian.org>
Closes: 879014 958479 963955
Changes:
 qtbase-opensource-src (5.14.2+dfsg-5) unstable; urgency=medium
 .
   * Backport upstream patch for moc to handle include directives in enums
     (closes: #963955).
   * Stop using -isystem flag in qmake (closes: #958479).
   * Clarify warning message about PIC/PIE, thanks Daniel Kahn Gillmor
     (closes: #879014).
   * Update symbols files for GCC 10.
   * Update libqt5gui5.lintian-overrides for tag renames in Lintian 2.79.
Checksums-Sha1:
 b52f4bd884d259701a3c686bde2b4d6ad0825264 5519 qtbase-opensource-src_5.14.2+dfsg-5.dsc
 7fe58a147f4221626d7cf41872d8b0bae2635e64 256968 qtbase-opensource-src_5.14.2+dfsg-5.debian.tar.xz
 5f0750f15f32d94a550b8337df9a41f9bbcd1539 17677 qtbase-opensource-src_5.14.2+dfsg-5_source.buildinfo
Checksums-Sha256:
 67689f58eabd5fdb3acf9f348a661f055e03d0f99a06174887e58564d2ab75b0 5519 qtbase-opensource-src_5.14.2+dfsg-5.dsc
 953bbb0406c71a3e990382af2ca229e0c833383b91bca8c57b43fd62020b3bd6 256968 qtbase-opensource-src_5.14.2+dfsg-5.debian.tar.xz
 95f69e0d93c0e11a76a485a693ea84a8ba4784e948e7b3591bf97bd446b57401 17677 qtbase-opensource-src_5.14.2+dfsg-5_source.buildinfo
Files:
 ceb33c498e0842b068f4652ccd38b1b6 5519 libs optional qtbase-opensource-src_5.14.2+dfsg-5.dsc
 a4a6d443cf16238f514618fbd0022b87 256968 libs optional qtbase-opensource-src_5.14.2+dfsg-5.debian.tar.xz
 3e237edf6f2458aeff971fefa6e95538 17677 libs optional qtbase-opensource-src_5.14.2+dfsg-5_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJHBAEBCgAxFiEE5688gqe4PSusUZcLZkYmW1hrg8sFAl8mf0UTHG1pdHlhNTdA
ZGViaWFuLm9yZwAKCRBmRiZbWGuDy9OWD/97gYmQaW+0XZ2YF5Kwn9GyC08Naoyz
rcjjAuL+X9//jDceGv6sGOyubHL2aQFE+DGk/WwQhHpUOMD6EZ8nEQxqdYYj7vwm
ilB3ANnuQCEEctt/ww26lVE2miw1vg7ApCMEkAgq9aWbafNdo2rTw7VzyVlRcQgb
P88+NYai6KnDxDsu9/I483olAl78yuhzI7v9hD3KMnMisvXuxajj9ca/8TJxsn0D
XNn+a3hgGArdDw6gDoxOtxJVYSk/U2rbtQZlDsH8ngWko4rZTZf4AxlFrpY29lW/
0SP/cXDS1YMVjR5XTQ8dW5G4FhayVdOun+vYDIp6NhGoWFK3s4WrVx4fCP9Tpe3D
/GNq0e+rvNm9ZVjEqKIufamVHsTQ1UDmIieTYeoslb5VUzqxJyjj4e/cpqN2gLYY
3bHsZY/9H4X+uWqaX6gewETbKUtptWCZNMd7PUT4zACH4OgoV4KTYQ4CkjuX9dxj
E1dudLvgZ5zS9/MsR/CNxAAT+fVBAasGMycluRFM90FvX8Fk3DsdtKMTW+IpEW+O
BC0SGgYn8qppCvSXHJoV4UKb2Fcgpn9MoF8dgkGzqlKz3YkZJLmaQz3CszKGnilf
ukTal+OI31Mm1THP58xDpotkgfm81j9BYqoKP2Boh0Ul5e2ZuedcO3nIKNXJYzIz
j/6jzoLvg8xh2Q==
=MAPN
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: