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

qmake generate too long command line and over windows limitation.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.8.0
    • Build tools: qmake, WebKit
    • Qt 5.8.0, Qt 5.7.1, QtWebkit 5.8.0 Windows 7, MinGW-w64 5.0.1, GCC 6.3.0

    Description

      Long story short, about QTBUG-58357, when I move all QtWebkit 5.8.0 to Qt branch 5.7.1, QtWebkit build successfully.

      and when I compare qmake 5.8.0 and 5.7.1 I find the different is at $\qtbase\qmake\generators\win32\mingw_make.cpp

      void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
      {
          t << "first: all\n";
          t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName()))
            << ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n";
          t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS");
          if (project->first("TEMPLATE") == "aux") {
              t << "\n\n";
              return;
          }
      
          if(!project->isEmpty("QMAKE_PRE_LINK"))
              t << "\n\t" <<var("QMAKE_PRE_LINK");
          if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
              if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
                  t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ;
              } else {
                  t << "\n\t" << objectsLinkLine << " " ;
              }
          } else {
              t << "\n\t$(LINKER) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) " << objectsLinkLine << "  $(LIBS)";
          }
          if(!project->isEmpty("QMAKE_POST_LINK"))
              t << "\n\t" <<var("QMAKE_POST_LINK");
          t << endl;
      }
      

      when TEMPLATE contains aux, it will return immediately. but for QtWebkit WebCore module, they have TEMPLATE = derived
      $\qtwebkit\Source\WebCore\DerivedSources.pri

      which will explain as TEMPLATE = aux by
      $\qtwebkit\Tools\qmake\mkspecs\features\default_post.prf

      and modules in WebCore is configure as staticlib and lots lots of object files linked ( total command line length over 20k) so the issue happen.

      I even do not know this is a qtwebkit bug or qmake bug, but Qt 5.7.1 + QtWebkit 5.8.0 works.

      Attachments

        Issue Links

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

          Activity

            People

              annulen Konstantin Tokarev
              dext dexter
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes