xbuild: pass the -execve flag and propagate the correct arg0

from: ae8e2da0ac
This commit is contained in:
Dmitry Belyaev 2021-10-10 23:49:23 +03:00
parent 87def99871
commit 56faef278e
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3
1 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ func crossBuildEnd() {
}
func runShell() error {
cmd := exec.Command("/usr/bin/qemu-arm-static", append([]string{"-0", "/bin/sh", "/bin/sh"}, os.Args[1:]...)...)
cmd := exec.Command("/usr/bin/qemu-arm-static", append([]string{"-execve", "-0", os.Args[0], "/bin/sh", "/bin/sh"}, os.Args[1:]...)...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
@ -46,7 +46,7 @@ func main() {
crossBuildStart()
case "cross-build-end":
crossBuildEnd()
case "/bin/sh":
default:
code := 0
crossBuildEnd()