aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross2019-05-17 17:36:46 -0500
committerColin Cross2019-05-17 17:51:00 -0500
commitee3ea31a244d65ecac2e5816132db311dcfe24df (patch)
tree3ca6201d4205364466826b3796ccd085a9668a81
parent77c22bf008c81440243d9b73508dfb5b7e555ed8 (diff)
downloadplatform-build-soong-ee3ea31a244d65ecac2e5816132db311dcfe24df.tar.gz
platform-build-soong-ee3ea31a244d65ecac2e5816132db311dcfe24df.tar.xz
platform-build-soong-ee3ea31a244d65ecac2e5816132db311dcfe24df.zip
Limit calls to strip.sh on darwin
strip.sh can use a file descriptor per .o file when run on .a files, which can hit the system file descriptor limit on darwin. This causes failures when manay variants of libgcc_stripped are built simultaneously. Put all strip rules on darwin into a pool that limits them to 10 concurrent processes, which will limit the file descriptor usage to ~7500. Fixes: 132822437 Test: no mention of darwinStripPool in out/soong/build.ninja on linux Test: m libgcc_stripped on darwin Change-Id: I3d4fbbd8d44d2e9059a79df113ab95336ec2c658
-rw-r--r--cc/builder.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/cc/builder.go b/cc/builder.go
index c99e4618..8d09a99e 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -123,12 +123,25 @@ var (
123 _ = pctx.SourcePathVariable("stripPath", "build/soong/scripts/strip.sh") 123 _ = pctx.SourcePathVariable("stripPath", "build/soong/scripts/strip.sh")
124 _ = pctx.SourcePathVariable("xzCmd", "prebuilts/build-tools/${config.HostPrebuiltTag}/bin/xz") 124 _ = pctx.SourcePathVariable("xzCmd", "prebuilts/build-tools/${config.HostPrebuiltTag}/bin/xz")
125 125
126 // b/132822437: objcopy uses a file descriptor per .o file when called on .a files, which runs the system out of
127 // file descriptors on darwin. Limit concurrent calls to 10 on darwin.
128 darwinStripPool = func() blueprint.Pool {
129 if runtime.GOOS == "darwin" {
130 return pctx.StaticPool("darwinStripPool", blueprint.PoolParams{
131 Depth: 10,
132 })
133 } else {
134 return nil
135 }
136 }()
137
126 strip = pctx.AndroidStaticRule("strip", 138 strip = pctx.AndroidStaticRule("strip",
127 blueprint.RuleParams{ 139 blueprint.RuleParams{
128 Depfile: "${out}.d", 140 Depfile: "${out}.d",
129 Deps: blueprint.DepsGCC, 141 Deps: blueprint.DepsGCC,
130 Command: "CROSS_COMPILE=$crossCompile XZ=$xzCmd CLANG_BIN=${config.ClangBin} $stripPath ${args} -i ${in} -o ${out} -d ${out}.d", 142 Command: "CROSS_COMPILE=$crossCompile XZ=$xzCmd CLANG_BIN=${config.ClangBin} $stripPath ${args} -i ${in} -o ${out} -d ${out}.d",
131 CommandDeps: []string{"$stripPath", "$xzCmd"}, 143 CommandDeps: []string{"$stripPath", "$xzCmd"},
144 Pool: darwinStripPool,
132 }, 145 },
133 "args", "crossCompile") 146 "args", "crossCompile")
134 147