diff options
author | Andras Becsi <andras.becsi@digia.com> | 2013-04-18 13:14:09 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-19 17:13:21 +0200 |
commit | 40edeaa8d852af7d9a1eb8cf39528a023a310c1d (patch) | |
tree | 6c733b90ec0d5d6c2ca3b8164de0432877d5be54 /Tools | |
parent | 6dbfbbccf4dc71756f59bb828a008cb96002e248 (diff) | |
download | qtwebkit-40edeaa8d852af7d9a1eb8cf39528a023a310c1d.tar.gz |
[Qt] Use GNU ar's thin archive format for intermediate static libs
https://bugs.webkit.org/show_bug.cgi?id=109052
http://trac.webkit.org/changeset/142088
Reviewed by Jocelyn Turcotte.
With debug builds we exceed the 4GiB limit of GNU ar when creating the WebCore
intermediate static library which results in build failure even with a x86_64
toolchain (http://sourceware.org/bugzilla/show_bug.cgi?id=14625).
When using a GNU toolchain we can use the thin archive format for these static
libraries which also has the benefit of not copying the object files, thus
drastically reducing disk usage and overall compile time.
Currently qmake does not support GNU ar's thin archive format so for
now we need to do the magic in the build system as a stopgap solution.
Adjust project files that used activeBuildConfig()
to use targetSubDir().
Change-Id: I68604d5fc6acc32d45a734271aa87bfa5a14647f
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/qmake/mkspecs/features/configure.prf | 1 | ||||
-rw-r--r-- | Tools/qmake/mkspecs/features/default_post.prf | 10 | ||||
-rw-r--r-- | Tools/qmake/mkspecs/features/functions.prf | 10 |
3 files changed, 17 insertions, 4 deletions
diff --git a/Tools/qmake/mkspecs/features/configure.prf b/Tools/qmake/mkspecs/features/configure.prf index 27adbaaff..ac4abeb93 100644 --- a/Tools/qmake/mkspecs/features/configure.prf +++ b/Tools/qmake/mkspecs/features/configure.prf @@ -216,6 +216,7 @@ defineTest(finalizeConfigure) { log(All-in-one files .............. $$configEnabled(use_all_in_one_files)$$EOL) log(GNUmake ....................... $$configEnabled(GNUmake)$$EOL) log(Static libs as shared ......... $$configEnabled(force_static_libs_as_shared)$$EOL) + log(Static libs as thin archives .. $$configEnabled(gnu_thin_archives)$$EOL) log(Production build .............. $$configEnabled(production_build)$$EOL) log($$EOL) diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf index 603d9782c..1ada3ef11 100644 --- a/Tools/qmake/mkspecs/features/default_post.prf +++ b/Tools/qmake/mkspecs/features/default_post.prf @@ -12,6 +12,7 @@ CONFIG += config_step # Enable dynamic instead of static libraries for development !production_build:!buildbot:!win*: CONFIG += force_static_libs_as_shared +!debug_and_release:*-g++*: CONFIG += gnu_thin_archives root_project_file: finalizeConfigure() @@ -159,7 +160,14 @@ contains(TEMPLATE, lib) { # system already takes care of this for the top level QtWebKit library. !qt_install_module:debug_and_release: TARGET = $$qtLibraryTarget($$TARGET) - isEmpty(DESTDIR): DESTDIR = $$activeBuildConfig() + gnu_thin_archives { + # Replace the hardcoded archiver command line + # options to use GNU ar's thin archive format. + AR_COMMAND = $$split(QMAKE_AR, " ") + QMAKE_AR = $$member(AR_COMMAND, 0) cruT + } + + isEmpty(DESTDIR): DESTDIR = $$targetSubDir() DEFINES += QT_ASCII_CAST_WARNINGS diff --git a/Tools/qmake/mkspecs/features/functions.prf b/Tools/qmake/mkspecs/features/functions.prf index f9d2defe2..88eae8508 100644 --- a/Tools/qmake/mkspecs/features/functions.prf +++ b/Tools/qmake/mkspecs/features/functions.prf @@ -24,8 +24,12 @@ defineReplace(toEvaluatablePath) { return($$replace(1, \\\\, \\\\\\\\)) } -defineReplace(activeBuildConfig) { - CONFIG(debug, debug|release): return(debug) +defineReplace(targetSubDir) { + # The paths to the elements of the thin archive are stored + # relative to the archive itself, thus we have to prevent + # qmake from moving the archive after creation. + gnu_thin_archives: return() + else: CONFIG(debug, debug|release): return(debug) else: return(release) } @@ -264,7 +268,7 @@ defineTest(linkAgainstLibrary) { target = $$resolveFinalLibraryName($$target) - path = $$replace(source_dir, $${ROOT_WEBKIT_DIR}, $${ROOT_BUILD_DIR})/$$activeBuildConfig() + path = $$replace(source_dir, $${ROOT_WEBKIT_DIR}, $${ROOT_BUILD_DIR})/$$targetSubDir() force_static_libs_as_shared { LIBS += -L$${ROOT_BUILD_DIR}/lib -l$$target |