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

object_script file location not considered in mingw builds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.7.0
    • Build tools: qmake
    • None
    • WinXP, QT 4.7 RC1, win32-g++

      The object_script file location for mingw is defined by the QMAKE_LINK_OBJECT_SCRIPT name and the variable DEST_TARGET.

      The object script file name is generated correctly.

      The generated ar command does not consider this path and assumes the file in the current working directory.

      void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
      {
          if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
              objectsLinkLine = "$(OBJECTS)";
          } else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
      	QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
      	if (!var("BUILD_NAME").isEmpty()) {
      	    ar_script_file += "." + var("BUILD_NAME");
      	}
      	createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
              // QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix.
              // Strip off any options since the ar commands will be read from file.
              QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
              if (ar_cmd.isEmpty())
                  ar_cmd = "ar";
      >>> Path not considered here for script file location
              objectsLinkLine = ar_cmd + " -M < " + ar_script_file;
      >>>
      

      This is a duplicate to BUG QTBUG-6453 which is never answered or commented and there i hope i will get a answer soon.
      Workarounds (do not generated script, use command line for objects) do not work any more cause the command line gets too long

          } else {
              QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
      	if (!var("BUILD_NAME").isEmpty()) {
      	    ld_script_file += "." + var("BUILD_NAME");
      	}
      	createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
              objectsLinkLine = ld_script_file;
          }
          Win32MakefileGenerator::writeObjectsPart(t);
      }
      

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

            buddenha Oswald Buddenhagen
            j.kreuzberger Joerg Kreuzberger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes