aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/env.go
diff options
context:
space:
mode:
authorTiancong Wang <tcwang@google.com>2020-02-12 13:41:01 -0800
committerTiancong Wang <tcwang@google.com>2020-02-13 18:13:48 +0000
commit22e3075e965be294d2b080752a113788c3cf136a (patch)
tree91618629b7ee190ce9e9622ba288a0bd5cfb18e7 /compiler_wrapper/env.go
parent43c9066b1889baaa0a6077399deb6a4d503551e6 (diff)
downloadtoolchain-utils-22e3075e965be294d2b080752a113788c3cf136a.tar.gz
compiler_wrapper: Use syscall.exec on platforms other than Chrome OS
In crbug.com/1000863, it's reported that golang exec don't play well on Chrome OS, portage sandbox to be exact. That's when we start to use libc's exec. However, the wrapper is also used on non-Chrome OS platforms, such as Android, and linking against libc has no benefit, and might be the root cause of a recent bug. This patch adds code to selectively use Golang's or libc's exec, depending on the platform. BUG=chromium:1000863 BUG=b:144783188 TEST=Build the wrapper locally with Chrome OS and Android configurations Change-Id: Ifd6fa8223205536450b65f728060d7c5556d7619 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2051669 Tested-by: Tiancong Wang <tcwang@google.com> Commit-Queue: Tiancong Wang <tcwang@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper/env.go')
-rw-r--r--compiler_wrapper/env.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler_wrapper/env.go b/compiler_wrapper/env.go
index 4d83b17a..56b3a913 100644
--- a/compiler_wrapper/env.go
+++ b/compiler_wrapper/env.go
@@ -71,7 +71,7 @@ func (env *processEnv) stderr() io.Writer {
}
func (env *processEnv) exec(cmd *command) error {
- return libcExec(env, cmd)
+ return execCmd(env, cmd)
}
func (env *processEnv) run(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error {