From f133b226cdf4f2736b412bb642b45d43cb84f51d Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Wed, 3 Jun 2020 13:06:01 +0300 Subject: [PATCH] qmake: Stop using -isystem flag This option changes the order of include paths, which can cause problems of various kinds. See https://bugs.debian.org/958479 for an example. The benefit of that option is minimal for what it was intended. Pick-to: 5.15 5.12 Change-Id: I80eeabd09764df290b60bc59aeb2f90d07723608 Reviewed-by: Thiago Macieira --- mkspecs/common/clang.conf | 1 - mkspecs/common/gcc-base.conf | 1 - mkspecs/linux-icc/qmake.conf | 1 - qmake/generators/unix/unixmake2.cpp | 10 ++-------- qmake/generators/win32/mingw_make.cpp | 7 +------ 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/mkspecs/common/clang.conf b/mkspecs/common/clang.conf index 2499c8b6d8..dad15a22a8 100644 --- a/mkspecs/common/clang.conf +++ b/mkspecs/common/clang.conf @@ -18,7 +18,6 @@ QMAKE_PCH_OUTPUT_EXT = .pch QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz -QMAKE_CFLAGS_ISYSTEM = -isystem QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} QMAKE_CFLAGS_USE_PRECOMPILE = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT} QMAKE_CFLAGS_LTCG = -flto=thin diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf index 3c2d5fdd53..99d77156fd 100644 --- a/mkspecs/common/gcc-base.conf +++ b/mkspecs/common/gcc-base.conf @@ -46,7 +46,6 @@ QMAKE_CFLAGS_DEBUG += -g QMAKE_CFLAGS_SHLIB += $$QMAKE_CFLAGS_PIC QMAKE_CFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_PIC QMAKE_CFLAGS_APP += $$QMAKE_CFLAGS_PIC -QMAKE_CFLAGS_ISYSTEM = -isystem QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index 75a601b1f1..09f897d093 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -9,7 +9,6 @@ include(../common/icc-base-unix.conf) # modifications to icc-base-unix.conf QMAKE_CFLAGS_YACC = -QMAKE_CFLAGS_ISYSTEM = -isystem QMAKE_CFLAGS_THREAD = -D_REENTRANT QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 92edd1e7b6..e907114ac0 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -198,18 +198,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n"; t << "INCPATH ="; { - QString isystem = var("QMAKE_CFLAGS_ISYSTEM"); const ProStringList &incs = project->values("INCLUDEPATH"); for(int i = 0; i < incs.size(); ++i) { const ProString &inc = incs.at(i); if (inc.isEmpty()) continue; - if (!isystem.isEmpty() && isSystemInclude(inc.toQString())) - t << ' ' << isystem << ' '; - else - t << " -I"; - t << escapeFilePath(inc); + t << " -I" << escapeFilePath(inc); } } if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS")) @@ -1393,8 +1388,7 @@ void UnixMakefileGenerator::init2() } if (include_deps && project->isActiveConfig("gcc_MD_depends")) { - // use -MMD if we know about -isystem too - ProString MD_flag(project->values("QMAKE_CFLAGS_ISYSTEM").isEmpty() ? "-MD" : "-MMD"); + ProString MD_flag("-MD"); project->values("QMAKE_CFLAGS") += MD_flag; project->values("QMAKE_CXXFLAGS") += MD_flag; } diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 432525ffba..2ffcff9a3c 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -200,17 +200,12 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t) { t << "INCPATH = "; - QString isystem = var("QMAKE_CFLAGS_ISYSTEM"); const ProStringList &incs = project->values("INCLUDEPATH"); for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) { QString inc = (*incit).toQString(); inc.replace(QRegularExpression("\\\\$"), ""); - if (!isystem.isEmpty() && isSystemInclude(inc)) - t << isystem << ' '; - else - t << "-I"; - t << escapeFilePath(inc) << ' '; + t << "-I" << escapeFilePath(inc) << ' '; } t << Qt::endl; }