From 01c82b945d209f3b7481b5be350c33002fb1b103 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 1 Jul 2014 11:46:50 +0200 Subject: Introduce qmake feature use_gold_linker This patch adds the feature use_gold_linker to use the gold linker that has been part of of GNU binutils since 2008. Gold links C++ libraries much faster and use less memory. The feature is autodetected when building Qt on Linux, but can be disabled in configure. On MingW builds it is default off but can be enabled for cross builds. Change-Id: Icdd6ba2e706b2c791bcf44b6e718c2b7a5eb2218 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- tools/configure/configureapp.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index f1010aea34..6c49b2dc79 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -250,6 +250,8 @@ Configure::Configure(int& argc, char** argv) dictionary[ "C++11" ] = "auto"; + dictionary[ "USE_GOLD_LINKER" ] = "no"; + dictionary[ "SHARED" ] = "yes"; dictionary[ "ZLIB" ] = "auto"; @@ -461,6 +463,10 @@ void Configure::parseCmdLine() dictionary[ "C++11" ] = "yes"; else if (configCmdLine.at(i) == "-no-c++11") dictionary[ "C++11" ] = "no"; + else if (configCmdLine.at(i) == "-use-gold-linker") + dictionary[ "USE_GOLD_LINKER" ] = "yes"; + else if (configCmdLine.at(i) == "-no-use-gold-linker") + dictionary[ "USE_GOLD_LINKER" ] = "no"; else if (configCmdLine.at(i) == "-shared") dictionary[ "SHARED" ] = "yes"; else if (configCmdLine.at(i) == "-static") @@ -1762,6 +1768,9 @@ bool Configure::displayHelp() desc("C++11", "yes", "-c++11", "Compile Qt with C++11 support enabled."); desc("C++11", "no", "-no-c++11", "Do not compile Qt with C++11 support enabled.\n"); + desc("USE_GOLD_LINKER", "yes", "-use-gold-linker", "Link using the GNU gold linker (gcc only)."); + desc("USE_GOLD_LINKER", "no", "-no-use-gold-linker", "Do not link using the GNU gold linker.\n"); + desc("SHARED", "yes", "-shared", "Create and use shared Qt libraries."); desc("SHARED", "no", "-static", "Create and use static Qt libraries.\n"); @@ -2609,6 +2618,9 @@ void Configure::generateOutputVars() if (dictionary[ "C++11" ] == "yes") qtConfig += "c++11"; + if (dictionary[ "USE_GOLD_LINKER" ] == "yes") + qmakeConfig += "use_gold_linker"; + if (dictionary[ "SHARED" ] == "no") qtConfig += "static"; else -- cgit v1.2.3