aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/go_exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'compiler_wrapper/go_exec.go')
-rw-r--r--compiler_wrapper/go_exec.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/compiler_wrapper/go_exec.go b/compiler_wrapper/go_exec.go
new file mode 100644
index 00000000..2f2e5ad9
--- /dev/null
+++ b/compiler_wrapper/go_exec.go
@@ -0,0 +1,23 @@
+// Copyright 2020 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// +build !libc_exec
+
+package main
+
+import (
+ "os/exec"
+ "syscall"
+)
+
+// Implement exec for users that don't need to dynamically link with glibc
+// See b/144783188 and libc_exec.go.
+
+func execCmd(env env, cmd *command) error {
+ execCmd := exec.Command(cmd.Path, cmd.Args...)
+ mergedEnv := mergeEnvValues(env.environ(), cmd.EnvUpdates)
+
+ ret := syscall.Exec(execCmd.Path, execCmd.Args, mergedEnv)
+ return newErrorwithSourceLocf("exec error: %v", ret)
+}