diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-02-17 17:57:16 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-02-21 12:37:19 +0100 |
commit | 1d3b190425e9e47fa8f263b99d89f407fb5dda8b (patch) | |
tree | 1620228a38b902901d915cc4ba9fc73726752883 /qmake/generators/unix/unixmake.h | |
parent | 5731b83445d890c5316c16cd3a16cd2f5bca2fbd (diff) |
qmake: Fix overlong command lines for static Qt builds on Windows
Linker response files for the MinGW and Unix makefile generators are
controlled by the variable QMAKE_LINK_OBJECT_MAX. This variable holds a
number. If the number of object files passed to the linker exceeds this
number, a linker response file containing object file paths is created.
This heuristic is extremely imprecise. It doesn't take into account the
length of object file names nor the length of $$OBJECTS_DIR.
Also, when using a static Qt, a big part of the linker command line are
libraries. A relatively small example can fail to link with "The
command line is too long" on Windows, even with the object files being
in a response file.
The MinGW makefile generator already reads the variable
QMAKE_RESPONSEFILE_THRESHOLD for compiler response files. Re-use this
variable for the linker response file of the Unix and MinGW makefile
generators.
If QMAKE_RESPONSEFILE_THRESHOLD is set, use it to determine whether to
create a response file. QMAKE_LINK_OBJECT_MAX is then ignored. The
response file contains objects and libraries.
If QMAKE_RESPONSEFILE_THRESHOLD is not set, use QMAKE_LINK_OBJECT_MAX to
determine whether to create a response file. The response file contains
only object files.
QMAKE_LINK_OBJECT_SCRIPT is used in both cases to specify a common base
name of all linker response files.
Pick-to: 6.2 6.3
Task-number: QTBUG-100559
Change-Id: I3c78354fa5ebb1a86438ec804679e0ee776c3f49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'qmake/generators/unix/unixmake.h')
-rw-r--r-- | qmake/generators/unix/unixmake.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h index 1f32e4341f..a149005e74 100644 --- a/qmake/generators/unix/unixmake.h +++ b/qmake/generators/unix/unixmake.h @@ -58,7 +58,7 @@ protected: void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags) override; void writeMakeParts(QTextStream &); bool writeMakefile(QTextStream &) override; - std::pair<bool, QString> writeObjectsPart(QTextStream &, bool do_incremental); + bool writeObjectsPart(QTextStream &, bool do_incremental); private: void init2(); ProStringList libdirToFlags(const ProKey &key); |