diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-05-20 23:23:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-05-20 23:23:23 +0000 |
commit | 9a833678224740e2332c610461795a51621b5115 (patch) | |
tree | d87d5c75c466069b85751dbe394a0ba99570eb9a | |
parent | a4a385f1d581d0bfdb2776b7c95311cf80654441 (diff) | |
parent | 954bb27cd901a66351b625d3536e86ca10f5bbfc (diff) | |
download | soong-9a833678224740e2332c610461795a51621b5115.tar.gz |
Merge "Limit calls to strip.sh on darwin" into qt-dev
-rw-r--r-- | cc/builder.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cc/builder.go b/cc/builder.go index c42f56cc5..f9b309d2d 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -122,12 +122,25 @@ var ( _ = pctx.SourcePathVariable("stripPath", "build/soong/scripts/strip.sh") _ = pctx.SourcePathVariable("xzCmd", "prebuilts/build-tools/${config.HostPrebuiltTag}/bin/xz") + // b/132822437: objcopy uses a file descriptor per .o file when called on .a files, which runs the system out of + // file descriptors on darwin. Limit concurrent calls to 10 on darwin. + darwinStripPool = func() blueprint.Pool { + if runtime.GOOS == "darwin" { + return pctx.StaticPool("darwinStripPool", blueprint.PoolParams{ + Depth: 10, + }) + } else { + return nil + } + }() + strip = pctx.AndroidStaticRule("strip", blueprint.RuleParams{ Depfile: "${out}.d", Deps: blueprint.DepsGCC, Command: "CROSS_COMPILE=$crossCompile XZ=$xzCmd CLANG_BIN=${config.ClangBin} $stripPath ${args} -i ${in} -o ${out} -d ${out}.d", CommandDeps: []string{"$stripPath", "$xzCmd"}, + Pool: darwinStripPool, }, "args", "crossCompile") |