diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-30 16:31:18 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-30 16:31:18 +0000 |
commit | 700e8f48f51550e6a8b42892fc88153bd24de1c3 (patch) | |
tree | 022ea44bd09a1ede866e4034c71e01e4b272e14e /build | |
parent | 678b5b94a27537fbf6102a2464cb317facf8f7cc (diff) | |
download | chromium_src-700e8f48f51550e6a8b42892fc88153bd24de1c3.zip chromium_src-700e8f48f51550e6a8b42892fc88153bd24de1c3.tar.gz chromium_src-700e8f48f51550e6a8b42892fc88153bd24de1c3.tar.bz2 |
Use response files in the GN build for shared libs and executables
We already blow out the command-line length limit on one of the bots.
TBR=thakis@chromium.org
Review URL: https://codereview.chromium.org/304293003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273859 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/toolchain/gcc_toolchain.gni | 12 | ||||
-rw-r--r-- | build/toolchain/mac/BUILD.gn | 18 |
2 files changed, 21 insertions, 9 deletions
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index 91baa11..bc52883 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni @@ -72,18 +72,24 @@ template("gcc_toolchain") { deps = "gcc" } tool("alink") { - command = "rm -f \$out && $ar rcs \$out \$in" + command = "rm -f \$out && $ar rcs \$out @\$rspfile" description = "AR \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$in" } tool("solink") { - command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive $libs_section_prefix \$libs $libs_section_postfix && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" + command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname @\$rspfile && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive $libs_section_prefix \$libs $libs_section_postfix && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" description = "SOLINK \$lib" + rspfile = "\$out.rsp" + rspfile_content = "-Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs" #pool = "link_pool" restat = "1" } tool("link") { - command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group $libs_section_prefix \$libs $libs_section_postfix" + command = "$ld \$ldflags -o \$out -Wl,--start-group @\$rspfile \$solibs -Wl,--end-group $libs_section_prefix \$libs $libs_section_postfix" description = "LINK \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$in" #pool = "link_pool" } tool("stamp") { diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn index c9a58b4b..d70774d 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -80,18 +80,24 @@ template("mac_clang_toolchain") { deps = "gcc" } tool("alink") { - command = "rm -f \$out && ./gyp-mac-tool filter-libtool libtool \$libtool_flags -static -o \$out \$in \$postbuilds" - description = "LIBTOOL-STATIC \$out, POSTBUILDS" + command = "rm -f \$out && ./gyp-mac-tool filter-libtool libtool \$libtool_flags -static -o \$out @\$rspfile \$postbuilds" + description = "LIBTOOL-STATIC \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$in" } tool("solink") { - command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ] || otool -l \$lib | grep -q LC_REEXPORT_DYLIB ; then $ld -shared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" - description = "SOLINK \$lib, POSTBUILDS" + command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ] || otool -l \$lib | grep -q LC_REEXPORT_DYLIB ; then $ld -shared \$ldflags -o \$lib @\$rspfile \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" + description = "SOLINK \$lib" + rspfile = "\$out.rsp" + rspfile_content = "\$in" #pool = "link_pool" restat = "1" } tool("link") { - command = "$ld \$ldflags -o \$out \$in \$solibs \$libs \$postbuilds" - description = "LINK \$out, POSTBUILDS" + command = "$ld \$ldflags -o \$out @\$rspfile \$solibs \$libs \$postbuilds" + description = "LINK \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$in" #pool = "link_pool" } #tool("infoplist") { |