Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61457

5.8 and 5.9 qmake builds for Android don't handle precompiled headers as well as 5.7 did; problem with dummy.cpp

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.8, 5.9
    • QPA
    • None
    • Debian 8.8 (Jessie) on amd64.  Qt 5.7, 5.8, 5.9 installed by MaintainanceTool.
    • Android

    Description

      I'm just resurrecting the Android build of a Qt app last built with Qt 5.7.  It still builds just fine with 5.7, however with 5.9 (and 5.8, but I'll illustrate with 5.9) there seems to be a problem relating to the .pro file's use of precompiled headers and a file Qt/5.9/android_armv7/mkspecs/features/data/dummy.cpp

      In the 5.9 project, it fails to build with (after successfully compiling my cpp files) the error

      /home/local/download/android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove --sysroot=/home/local/download/android/android-ndk-r10e/platforms/android-16/arch-arm/ -DCCI_VERSION=8.2.10 -include precompiled.h -std=c++11 -O2 -Os -mthumb -std=gnu++11 -Wall -W -dM -E -o build/moc/moc_predefs.h ../../../Qt/5.9/android_armv7/mkspecs/features/data/dummy.cpp
      In file included from ./precompiled.h:9:0,
       from <command-line>:0:
      ./../gtx/common.h:9:22: fatal error: functional: No such file or directory
       #include <functional>
                            ^
      compilation terminated.
      Makefile:922: recipe for target 'build/moc/moc_predefs.h' failed
      make[1]: *** [build/moc/moc_predefs.h] Error 1
      make[1]: Leaving directory '/home/local/project/gtx/cci'
      Makefile:48: recipe for target 'sub-cci-make_first' failed
      make: *** [sub-cci-make_first] Error 2

      Now this is interesting because the compile of dummy.cpp seems to be using a

      -include precompiled.h

      but doesn't have all the vast array of -I include paths needed for that to work; for example all the other .cpp files are built with things like:

       /home/local/download/android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -c -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove --sysroot=/home/local/download/android/android-ndk-r10e/platforms/android-16/arch-arm/ -DCCI_VERSION=8.2.10 -include precompiled.h -std=c++11 -O2 -Os -mthumb -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DANDROIDQUIRKS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I. -I../../../Qt/5.9/android_armv7/include -I../../../Qt/5.9/android_armv7/include/QtQuick -I../../../Qt/5.9/android_armv7/include/QtMultimedia -I../../../Qt/5.9/android_armv7/include/QtGui -I../../../Qt/5.9/android_armv7/include/QtQml -I../../../Qt/5.9/android_armv7/include/QtNetwork -I../../../Qt/5.9/android_armv7/include/QtConcurrent -I../../../Qt/5.9/android_armv7/include/QtCore -Ibuild/moc -I../../../download/android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -I../../../download/android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -I../../../download/android/android-ndk-r10e/platforms/android-16/arch-arm/usr/include -I../../../Qt/5.9/android_armv7/mkspecs/android-g++ -o build/obj/utils.o ../cci-common/utils.cpp
      

      When I build with 5.7, everything works fine but there doesn't seem to be a compile of that ../../../Qt/5.9/android_armv7/mkspecs/features/data/dummy.cpp file at any point so presumably dummy.cpp is something new that's been introduced in 5.8 & 5.9.

      Ironically the dummy.cpp file seems to be completely empty apart from a comment:

      // Used when we need to compile with no source code
      // (controls are in the command-line)

      Presumably better behaviour when compiling that file should be to either use the same array of '-I' paths, or not use the '-include'.  Or maybe there's something weird going on and it shouldn't be even trying to compile it at all, or compiling something else instead.

      Searching for workrounds for this now (will add a comment if I find any).  I am reluctant to disable precompiled headers in the .pro file as it'll mean messing with a lot of .cpp files.

      (Searching for other reports of this leads to the old QTBUG-51700, but that seems to be for versions pre-5.7; I think 5.7 is actually the first and only version I've used on Android).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rampe Rami Potinkara
            timday Tim Day
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes