Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: with CC=zig: SIGSERV when cross-compiling to darwin/amd64 #46644

Closed
motiejus opened this issue Jun 8, 2021 · 1 comment
Closed

cmd/link: with CC=zig: SIGSERV when cross-compiling to darwin/amd64 #46644

motiejus opened this issue Jun 8, 2021 · 1 comment

Comments

@motiejus
Copy link

@motiejus motiejus commented Jun 8, 2021

What version of Go are you using (go version)?

$ go version
go version go1.16.5 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/motiejus/.cache/go-build"
GOENV="/home/motiejus/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/motiejus/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/motiejus/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.5"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2770219422=/tmp/go-build -gno-record-gcc-switches"

What did you do?

zccmacos

#!/bin/bash
set -x
exec zig cc -target x86_64-macos-gnu "$@"

hello.go

package main

// #include <stdio.h>
// void helloworld() { printf("hello, world\n"); }
import "C"

func main() {
        C.helloworld()
}

Build:

$ GOOS=darwin GOARCH=amd64 CC=zccmacos CGO_ENABLED=1 go build -v -x -a  -ldflags "-linkmode external -extldflags -static" hello.go

What did you expect to see?

Successfully compiled.

What did you see instead?

SIGSERV:

$ GOOS=darwin GOARCH=amd64 CC=zccmacos CGO_ENABLED=1 go build   -ldflags "-linkmode external -extldflags -static" hello.go
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x001.o -c _cgo_export.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x002.o -c cgo.cgo2.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x003.o -c gcc_context.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x004.o -c gcc_darwin_amd64.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x005.o -c gcc_libinit.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x006.o -c gcc_setenv.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x007.o -c gcc_traceback.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x008.o -c gcc_util.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x009.o -c gcc_amd64.S
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_cgo_main.o -c _cgo_main.c
# command-line-arguments
+ exec zig cc -target x86_64-macos-gnu -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b001/ -g -O2 -o $WORK/b001/_x001.o -c _cgo_export.c
# command-line-arguments
+ exec zig cc -target x86_64-macos-gnu -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b001/ -g -O2 -o $WORK/b001/_x002.o -c hello.cgo2.c
# command-line-arguments
+ exec zig cc -target x86_64-macos-gnu -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1330997072/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b001/ -g -O2 -o $WORK/b001/_cgo_main.o -c _cgo_main.c
# command-line-arguments
/usr/local/go/pkg/tool/linux_amd64/link: running zccmacos failed: signal: segmentation fault
+ exec zig cc -target x86_64-macos-gnu -arch x86_64 -m64 -Wl,-headerpad,1144 -Wl,-no_pie -Wl,-pagezero_size,4000000 -o $WORK/b001/exe/a.out -Wl,--compress-debug-sections=zlib-gnu /tmp/go-link-565195839/go.o /tmp/go-link-565195839/000000.o /tmp/go-link-565195839/000001.o /tmp/go-link-565195839/000002.o /tmp/go-link-565195839/000003.o /tmp/go-link-565195839/000004.o /tmp/go-link-565195839/000005.o /tmp/go-link-565195839/000006.o /tmp/go-link-565195839/000007.o /tmp/go-link-565195839/000008.o /tmp/go-link-565195839/000009.o /tmp/go-link-565195839/000010.o -g -O2 -g -O2 -lpthread -no-pie -static
warning: unsupported linker arg: -headerpad
warning: unsupported linker arg: 1144
warning: unsupported linker arg: -no_pie
warning: unsupported linker arg: -pagezero_size
warning: unsupported linker arg: 4000000
warning: unsupported linker arg: --compress-debug-sections=zlib-gnu
Debug log (`-x -a -v`)
$ GOOS=darwin GOARCH=amd64 CC=zccmacos CGO_ENABLED=1 go build -v -x -a  -ldflags "-linkmode external -extldflags -static" hello.go
WORK=/tmp/go-build3374658565
internal/race
mkdir -p $WORK/b015/
cat >$WORK/b015/importcfg << 'EOF' # internal
# import config
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b015/_pkg_.a -trimpath "$WORK/b015=>" -p internal/race -std -complete -buildid YOohAdQF86zJ9UK0X9PA/YOohAdQF86zJ9UK0X9PA -goversion go1.16.5 -D "" -importcfg $WORK/b015/importcfg -pack -c=4 /usr/local/go/src/internal/race/doc.go /usr/local/go/src/internal/race/norace.go
runtime/internal/sys
mkdir -p $WORK/b013/
cat >$WORK/b013/importcfg << 'EOF' # internal
# import config
EOF
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b013/_pkg_.a -trimpath "$WORK/b013=>" -p runtime/internal/sys -std -+ -complete -buildid bvYpwWxyEY4z8rGOgZ3L/bvYpwWxyEY4z8rGOgZ3L -goversion go1.16.5 -D "" -importcfg $WORK/b013/importcfg -pack -c=4 /usr/local/go/src/runtime/internal/sys/arch.go /usr/local/go/src/runtime/internal/sys/arch_amd64.go /usr/local/go/src/runtime/internal/sys/intrinsics.go /usr/local/go/src/runtime/internal/sys/intrinsics_common.go /usr/local/go/src/runtime/internal/sys/stubs.go /usr/local/go/src/runtime/internal/sys/sys.go /usr/local/go/src/runtime/internal/sys/zgoarch_amd64.go /usr/local/go/src/runtime/internal/sys/zgoos_darwin.go /usr/local/go/src/runtime/internal/sys/zversion.go
sync/atomic
mkdir -p $WORK/b017/
cat >$WORK/b017/go_asm.h << 'EOF' # internal
EOF
cd /usr/local/go/src/sync/atomic
/usr/local/go/pkg/tool/linux_amd64/asm -p sync/atomic -trimpath "$WORK/b017=>" -I $WORK/b017/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -gensymabis -o $WORK/b017/symabis ./asm.s
internal/unsafeheader
mkdir -p $WORK/b007/
cat >$WORK/b007/importcfg << 'EOF' # internal
# import config
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b007/_pkg_.a -trimpath "$WORK/b007=>" -p internal/unsafeheader -std -complete -buildid gWRvI7yboFi7KZ7DGD4K/gWRvI7yboFi7KZ7DGD4K -goversion go1.16.5 -D "" -importcfg $WORK/b007/importcfg -pack -c=4 /usr/local/go/src/internal/unsafeheader/unsafeheader.go
runtime/internal/atomic
mkdir -p $WORK/b011/
cat >$WORK/b011/go_asm.h << 'EOF' # internal
EOF
cd /usr/local/go/src/runtime/internal/atomic
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime/internal/atomic -trimpath "$WORK/b011=>" -I $WORK/b011/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -gensymabis -o $WORK/b011/symabis ./asm_amd64.s
internal/cpu
mkdir -p $WORK/b010/
cat >$WORK/b010/go_asm.h << 'EOF' # internal
EOF
cd /usr/local/go/src/internal/cpu
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/cpu -trimpath "$WORK/b010=>" -I $WORK/b010/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -gensymabis -o $WORK/b010/symabis ./cpu.s ./cpu_x86.s
cat >$WORK/b017/importcfg << 'EOF' # internal
# import config
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b017/_pkg_.a -trimpath "$WORK/b017=>" -p sync/atomic -std -buildid c1nzc-eDYN54komLT0dX/c1nzc-eDYN54komLT0dX -goversion go1.16.5 -symabis $WORK/b017/symabis -D "" -importcfg $WORK/b017/importcfg -pack -asmhdr $WORK/b017/go_asm.h -c=4 /usr/local/go/src/sync/atomic/doc.go /usr/local/go/src/sync/atomic/value.go
runtime/cgo
mkdir -p $WORK/b003/
cd /usr/local/go/src/runtime/cgo
TERM='dumb' CGO_LDFLAGS='"-g" "-O2" "-lpthread"' /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/b003/ -importpath runtime/cgo -import_runtime_cgo=false -import_syscall=false -- -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror ./cgo.go
cat >$WORK/b010/importcfg << 'EOF' # internal
# import config
EOF
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b015/_pkg_.a # internal
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b010/_pkg_.a -trimpath "$WORK/b010=>" -p internal/cpu -std -+ -buildid 7U5wYDoYJygj-KXUJbje/7U5wYDoYJygj-KXUJbje -goversion go1.16.5 -symabis $WORK/b010/symabis -D "" -importcfg $WORK/b010/importcfg -pack -asmhdr $WORK/b010/go_asm.h -c=4 /usr/local/go/src/internal/cpu/cpu.go /usr/local/go/src/internal/cpu/cpu_amd64.go /usr/local/go/src/internal/cpu/cpu_x86.go
cp $WORK/b015/_pkg_.a /home/motiejus/.cache/go-build/5e/5e93414adc40bce927ea50963aad62aad5a7ca280d200ed0e4ab37c3294aad7a-d # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b007/_pkg_.a # internal
cp $WORK/b007/_pkg_.a /home/motiejus/.cache/go-build/25/258fa5a46e5751767c7d98ad5648dfe6ecdea0cf3e15c0908e9ccdceec99d3a1-d # internal
cat >$WORK/b011/importcfg << 'EOF' # internal
# import config
EOF
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b011/_pkg_.a -trimpath "$WORK/b011=>" -p runtime/internal/atomic -std -+ -buildid A81FcWB1zZ-QFA321I32/A81FcWB1zZ-QFA321I32 -goversion go1.16.5 -symabis $WORK/b011/symabis -D "" -importcfg $WORK/b011/importcfg -pack -asmhdr $WORK/b011/go_asm.h -c=4 /usr/local/go/src/runtime/internal/atomic/atomic_amd64.go /usr/local/go/src/runtime/internal/atomic/stubs.go /usr/local/go/src/runtime/internal/atomic/unaligned.go
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b013/_pkg_.a # internal
cp $WORK/b013/_pkg_.a /home/motiejus/.cache/go-build/c7/c7fa3969de5086e933927bc0a0487e20314259dc4ef0467a305fd758fc86cf75-d # internal
cd /usr/local/go/src/sync/atomic
/usr/local/go/pkg/tool/linux_amd64/asm -p sync/atomic -trimpath "$WORK/b017=>" -I $WORK/b017/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b017/asm.o ./asm.s
runtime/internal/math
mkdir -p $WORK/b012/
cat >$WORK/b012/importcfg << 'EOF' # internal
# import config
packagefile runtime/internal/sys=$WORK/b013/_pkg_.a
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b012/_pkg_.a -trimpath "$WORK/b012=>" -p runtime/internal/math -std -+ -complete -buildid oYNeRxyzXj1ecJhyXNRx/oYNeRxyzXj1ecJhyXNRx -goversion go1.16.5 -D "" -importcfg $WORK/b012/importcfg -pack -c=4 /usr/local/go/src/runtime/internal/math/math.go
cd /usr/local/go/src/sync/atomic
/usr/local/go/pkg/tool/linux_amd64/pack r $WORK/b017/_pkg_.a $WORK/b017/asm.o # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b017/_pkg_.a # internal
cp $WORK/b017/_pkg_.a /home/motiejus/.cache/go-build/09/090951914a24369c396c4e0889279440b89027df65b018f78b17edfc81b87150-d # internal
cd /usr/local/go/src/runtime/internal/atomic
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime/internal/atomic -trimpath "$WORK/b011=>" -I $WORK/b011/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b011/asm_amd64.o ./asm_amd64.s
cd $WORK
zccmacos -fno-caret-diagnostics -c -x c - -o /dev/null || true
cd /usr/local/go/src/runtime/internal/atomic
/usr/local/go/pkg/tool/linux_amd64/pack r $WORK/b011/_pkg_.a $WORK/b011/asm_amd64.o # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b011/_pkg_.a # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b012/_pkg_.a # internal
cp $WORK/b011/_pkg_.a /home/motiejus/.cache/go-build/5a/5a4c3a5f1def3a3bba2be7353da08cf8cc46b1b9a8e12e5ce291b5d300c2c5ee-d # internal
cp $WORK/b012/_pkg_.a /home/motiejus/.cache/go-build/79/79eb426ca639dcd45f3ea7555e29941b3bfcf27a8caf2344581960737d023e22-d # internal
cd /usr/local/go/src/internal/cpu
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/cpu -trimpath "$WORK/b010=>" -I $WORK/b010/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b010/cpu.o ./cpu.s
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/cpu -trimpath "$WORK/b010=>" -I $WORK/b010/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b010/cpu_x86.o ./cpu_x86.s
cd $WORK
zccmacos -Qunused-arguments -c -x c - -o /dev/null || true
cd /usr/local/go/src/internal/cpu
/usr/local/go/pkg/tool/linux_amd64/pack r $WORK/b010/_pkg_.a $WORK/b010/cpu.o $WORK/b010/cpu_x86.o # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b010/_pkg_.a # internal
cp $WORK/b010/_pkg_.a /home/motiejus/.cache/go-build/4a/4ac24917cdad9129a20e833d159e28e94a56f5211ca74a7de8c0505fa8f775a6-d # internal
cd $WORK
zccmacos -fdebug-prefix-map=a=b -c -x c - -o /dev/null || true
internal/bytealg
zccmacos -gno-record-gcc-switches -c -x c - -o /dev/null || true
mkdir -p $WORK/b009/
cd $WORK/b003
TERM='dumb' zccmacos -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -Wno-nullability-completeness -Wall -Werror -o ./_x001.o -c _cgo_export.c
cat >$WORK/b009/go_asm.h << 'EOF' # internal
EOF
cd /usr/local/go/src/internal/bytealg
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/bytealg -trimpath "$WORK/b009=>" -I $WORK/b009/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -gensymabis -o $WORK/b009/symabis ./compare_amd64.s ./count_amd64.s ./equal_amd64.s ./index_amd64.s ./indexbyte_amd64.s
cat >$WORK/b009/importcfg << 'EOF' # internal
# import config
packagefile internal/cpu=$WORK/b010/_pkg_.a
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b009/_pkg_.a -trimpath "$WORK/b009=>" -p internal/bytealg -std -+ -buildid JvAx94cEQkTjmpqc3cqx/JvAx94cEQkTjmpqc3cqx -goversion go1.16.5 -symabis $WORK/b009/symabis -D "" -importcfg $WORK/b009/importcfg -pack -asmhdr $WORK/b009/go_asm.h -c=4 /usr/local/go/src/internal/bytealg/bytealg.go /usr/local/go/src/internal/bytealg/compare_native.go /usr/local/go/src/internal/bytealg/count_native.go /usr/local/go/src/internal/bytealg/equal_generic.go /usr/local/go/src/internal/bytealg/equal_native.go /usr/local/go/src/internal/bytealg/index_amd64.go /usr/local/go/src/internal/bytealg/index_native.go /usr/local/go/src/internal/bytealg/indexbyte_native.go
cd /usr/local/go/src/internal/bytealg
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/bytealg -trimpath "$WORK/b009=>" -I $WORK/b009/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b009/compare_amd64.o ./compare_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/bytealg -trimpath "$WORK/b009=>" -I $WORK/b009/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b009/count_amd64.o ./count_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/bytealg -trimpath "$WORK/b009=>" -I $WORK/b009/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b009/equal_amd64.o ./equal_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/bytealg -trimpath "$WORK/b009=>" -I $WORK/b009/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b009/index_amd64.o ./index_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/bytealg -trimpath "$WORK/b009=>" -I $WORK/b009/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b009/indexbyte_amd64.o ./indexbyte_amd64.s
/usr/local/go/pkg/tool/linux_amd64/pack r $WORK/b009/_pkg_.a $WORK/b009/compare_amd64.o $WORK/b009/count_amd64.o $WORK/b009/equal_amd64.o $WORK/b009/index_amd64.o $WORK/b009/indexbyte_amd64.o # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b009/_pkg_.a # internal
cp $WORK/b009/_pkg_.a /home/motiejus/.cache/go-build/77/770ea5cd569a6687000aa753476a9ae1ae960b3f7e00ed24d269940ea755237f-d # internal
cd $WORK/b003
TERM='dumb' zccmacos -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -Wno-nullability-completeness -Wall -Werror -o ./_x002.o -c cgo.cgo2.c
runtime
mkdir -p $WORK/b008/
cat >$WORK/b008/go_asm.h << 'EOF' # internal
EOF
cd /usr/local/go/src/runtime
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -gensymabis -o $WORK/b008/symabis ./asm.s ./asm_amd64.s ./duff_amd64.s ./memclr_amd64.s ./memmove_amd64.s ./preempt_amd64.s ./rt0_darwin_amd64.s ./sys_darwin_amd64.s
cat >$WORK/b008/importcfg << 'EOF' # internal
# import config
packagefile internal/bytealg=$WORK/b009/_pkg_.a
packagefile internal/cpu=$WORK/b010/_pkg_.a
packagefile runtime/internal/atomic=$WORK/b011/_pkg_.a
packagefile runtime/internal/math=$WORK/b012/_pkg_.a
packagefile runtime/internal/sys=$WORK/b013/_pkg_.a
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b008/_pkg_.a -trimpath "$WORK/b008=>" -p runtime -std -+ -buildid UNb5ecUsxShGIugWGbRG/UNb5ecUsxShGIugWGbRG -goversion go1.16.5 -symabis $WORK/b008/symabis -D "" -importcfg $WORK/b008/importcfg -pack -asmhdr $WORK/b008/go_asm.h -c=4 /usr/local/go/src/runtime/alg.go /usr/local/go/src/runtime/atomic_pointer.go /usr/local/go/src/runtime/cgo.go /usr/local/go/src/runtime/cgocall.go /usr/local/go/src/runtime/cgocallback.go /usr/local/go/src/runtime/cgocheck.go /usr/local/go/src/runtime/chan.go /usr/local/go/src/runtime/checkptr.go /usr/local/go/src/runtime/compiler.go /usr/local/go/src/runtime/complex.go /usr/local/go/src/runtime/cpuflags.go /usr/local/go/src/runtime/cpuflags_amd64.go /usr/local/go/src/runtime/cpuprof.go /usr/local/go/src/runtime/cputicks.go /usr/local/go/src/runtime/debug.go /usr/local/go/src/runtime/debugcall.go /usr/local/go/src/runtime/debuglog.go /usr/local/go/src/runtime/debuglog_off.go /usr/local/go/src/runtime/defs_darwin_amd64.go /usr/local/go/src/runtime/env_posix.go /usr/local/go/src/runtime/error.go /usr/local/go/src/runtime/extern.go /usr/local/go/src/runtime/fastlog2.go /usr/local/go/src/runtime/fastlog2table.go /usr/local/go/src/runtime/float.go /usr/local/go/src/runtime/hash64.go /usr/local/go/src/runtime/heapdump.go /usr/local/go/src/runtime/histogram.go /usr/local/go/src/runtime/iface.go /usr/local/go/src/runtime/lfstack.go /usr/local/go/src/runtime/lfstack_64bit.go /usr/local/go/src/runtime/lock_sema.go /usr/local/go/src/runtime/lockrank.go /usr/local/go/src/runtime/lockrank_off.go /usr/local/go/src/runtime/malloc.go /usr/local/go/src/runtime/map.go /usr/local/go/src/runtime/map_fast32.go /usr/local/go/src/runtime/map_fast64.go /usr/local/go/src/runtime/map_faststr.go /usr/local/go/src/runtime/mbarrier.go /usr/local/go/src/runtime/mbitmap.go /usr/local/go/src/runtime/mcache.go /usr/local/go/src/runtime/mcentral.go /usr/local/go/src/runtime/mcheckmark.go /usr/local/go/src/runtime/mem_darwin.go /usr/local/go/src/runtime/metrics.go /usr/local/go/src/runtime/mfinal.go /usr/local/go/src/runtime/mfixalloc.go /usr/local/go/src/runtime/mgc.go /usr/local/go/src/runtime/mgcmark.go /usr/local/go/src/runtime/mgcscavenge.go /usr/local/go/src/runtime/mgcstack.go /usr/local/go/src/runtime/mgcsweep.go /usr/local/go/src/runtime/mgcwork.go /usr/local/go/src/runtime/mheap.go /usr/local/go/src/runtime/mpagealloc.go /usr/local/go/src/runtime/mpagealloc_64bit.go /usr/local/go/src/runtime/mpagecache.go /usr/local/go/src/runtime/mpallocbits.go /usr/local/go/src/runtime/mprof.go /usr/local/go/src/runtime/mranges.go /usr/local/go/src/runtime/msan0.go /usr/local/go/src/runtime/msize.go /usr/local/go/src/runtime/mspanset.go /usr/local/go/src/runtime/mstats.go /usr/local/go/src/runtime/mwbbuf.go /usr/local/go/src/runtime/nbpipe_pipe.go /usr/local/go/src/runtime/netpoll.go /usr/local/go/src/runtime/netpoll_kqueue.go /usr/local/go/src/runtime/os_darwin.go /usr/local/go/src/runtime/os_nonopenbsd.go /usr/local/go/src/runtime/panic.go /usr/local/go/src/runtime/plugin.go /usr/local/go/src/runtime/preempt.go /usr/local/go/src/runtime/preempt_nonwindows.go /usr/local/go/src/runtime/print.go /usr/local/go/src/runtime/proc.go /usr/local/go/src/runtime/profbuf.go /usr/local/go/src/runtime/proflabel.go /usr/local/go/src/runtime/race0.go /usr/local/go/src/runtime/rdebug.go /usr/local/go/src/runtime/relax_stub.go /usr/local/go/src/runtime/runtime.go /usr/local/go/src/runtime/runtime1.go /usr/local/go/src/runtime/runtime2.go /usr/local/go/src/runtime/rwmutex.go /usr/local/go/src/runtime/select.go /usr/local/go/src/runtime/sema.go /usr/local/go/src/runtime/signal_amd64.go /usr/local/go/src/runtime/signal_darwin.go /usr/local/go/src/runtime/signal_darwin_amd64.go /usr/local/go/src/runtime/signal_unix.go /usr/local/go/src/runtime/sigqueue.go /usr/local/go/src/runtime/sizeclasses.go /usr/local/go/src/runtime/slice.go /usr/local/go/src/runtime/softfloat64.go /usr/local/go/src/runtime/stack.go /usr/local/go/src/runtime/string.go /usr/local/go/src/runtime/stubs.go /usr/local/go/src/runtime/stubs_amd64.go /usr/local/go/src/runtime/stubs_nonlinux.go /usr/local/go/src/runtime/symtab.go /usr/local/go/src/runtime/sys_darwin.go /usr/local/go/src/runtime/sys_libc.go /usr/local/go/src/runtime/sys_nonppc64x.go /usr/local/go/src/runtime/sys_x86.go /usr/local/go/src/runtime/time.go /usr/local/go/src/runtime/time_nofake.go /usr/local/go/src/runtime/timestub.go /usr/local/go/src/runtime/trace.go /usr/local/go/src/runtime/traceback.go /usr/local/go/src/runtime/type.go /usr/local/go/src/runtime/typekind.go /usr/local/go/src/runtime/utf8.go /usr/local/go/src/runtime/vdso_in_none.go /usr/local/go/src/runtime/write_err.go
cd /usr/local/go/src/runtime/cgo
TERM='dumb' zccmacos -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x003.o -c gcc_context.c
TERM='dumb' zccmacos -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x004.o -c gcc_darwin_amd64.c
TERM='dumb' zccmacos -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x005.o -c gcc_libinit.c
TERM='dumb' zccmacos -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x006.o -c gcc_setenv.c
TERM='dumb' zccmacos -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x007.o -c gcc_traceback.c
TERM='dumb' zccmacos -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x008.o -c gcc_util.c
TERM='dumb' zccmacos -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x009.o -c gcc_amd64.S
cd $WORK/b003
TERM='dumb' zccmacos -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -Wno-nullability-completeness -Wall -Werror -o ./_cgo_main.o -c _cgo_main.c
cd /home/motiejus/x
TERM='dumb' zccmacos -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -o $WORK/b003/_cgo_.o $WORK/b003/_cgo_main.o $WORK/b003/_x001.o $WORK/b003/_x002.o $WORK/b003/_x003.o $WORK/b003/_x004.o $WORK/b003/_x005.o $WORK/b003/_x006.o $WORK/b003/_x007.o $WORK/b003/_x008.o $WORK/b003/_x009.o -g -O2 -lpthread
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -o $WORK/b003/_cgo_.o $WORK/b003/_cgo_main.o $WORK/b003/_x001.o $WORK/b003/_x002.o $WORK/b003/_x003.o $WORK/b003/_x004.o $WORK/b003/_x005.o $WORK/b003/_x006.o $WORK/b003/_x007.o $WORK/b003/_x008.o $WORK/b003/_x009.o -g -O2 -lpthread
TERM='dumb' /usr/local/go/pkg/tool/linux_amd64/cgo -dynpackage cgo -dynimport $WORK/b003/_cgo_.o -dynout $WORK/b003/_cgo_import.go -dynlinker
cat >$WORK/b003/go_asm.h << 'EOF' # internal
EOF
cd /usr/local/go/src/runtime/cgo
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime/cgo -trimpath "$WORK/b003=>" -I $WORK/b003/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -gensymabis -o $WORK/b003/symabis ./asm_amd64.s
cat >$WORK/b003/importcfg << 'EOF' # internal
# import config
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b003/_pkg_.a -trimpath "$WORK/b003=>" -p runtime/cgo -std -buildid SpMlwPc3GLgt791d5AM4/SpMlwPc3GLgt791d5AM4 -goversion go1.16.5 -symabis $WORK/b003/symabis -D "" -importcfg $WORK/b003/importcfg -pack -asmhdr $WORK/b003/go_asm.h -c=4 /usr/local/go/src/runtime/cgo/callbacks.go /usr/local/go/src/runtime/cgo/callbacks_traceback.go /usr/local/go/src/runtime/cgo/iscgo.go /usr/local/go/src/runtime/cgo/setenv.go $WORK/b003/_cgo_gotypes.go $WORK/b003/cgo.cgo1.go $WORK/b003/_cgo_import.go
cd /usr/local/go/src/runtime/cgo
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime/cgo -trimpath "$WORK/b003=>" -I $WORK/b003/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b003/asm_amd64.o ./asm_amd64.s
/usr/local/go/pkg/tool/linux_amd64/pack r $WORK/b003/_pkg_.a $WORK/b003/asm_amd64.o $WORK/b003/_x001.o $WORK/b003/_x002.o $WORK/b003/_x003.o $WORK/b003/_x004.o $WORK/b003/_x005.o $WORK/b003/_x006.o $WORK/b003/_x007.o $WORK/b003/_x008.o $WORK/b003/_x009.o # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b003/_pkg_.a # internal
cp $WORK/b003/_pkg_.a /home/motiejus/.cache/go-build/d5/d5871fdc2c0bbd15e9fb75dce481e4aa167f34f89e3f5a26ee8af92b631708fc-d # internal
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x001.o -c _cgo_export.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x002.o -c cgo.cgo2.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x003.o -c gcc_context.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x004.o -c gcc_darwin_amd64.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x005.o -c gcc_libinit.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x006.o -c gcc_setenv.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x007.o -c gcc_traceback.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x008.o -c gcc_util.c
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_x009.o -c gcc_amd64.S
# runtime/cgo
+ exec zig cc -target x86_64-macos-gnu -I /usr/local/go/src/runtime/cgo -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b003=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b003/ -g -O2 -Wno-nullability-completeness -Wall -Werror -o $WORK/b003/_cgo_main.o -c _cgo_main.c
cd /usr/local/go/src/runtime
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b008/asm.o ./asm.s
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b008/asm_amd64.o ./asm_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b008/duff_amd64.o ./duff_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b008/memclr_amd64.o ./memclr_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b008/memmove_amd64.o ./memmove_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b008/preempt_amd64.o ./preempt_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b008/rt0_darwin_amd64.o ./rt0_darwin_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p runtime -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b008/sys_darwin_amd64.o ./sys_darwin_amd64.s
/usr/local/go/pkg/tool/linux_amd64/pack r $WORK/b008/_pkg_.a $WORK/b008/asm.o $WORK/b008/asm_amd64.o $WORK/b008/duff_amd64.o $WORK/b008/memclr_amd64.o $WORK/b008/memmove_amd64.o $WORK/b008/preempt_amd64.o $WORK/b008/rt0_darwin_amd64.o $WORK/b008/sys_darwin_amd64.o # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b008/_pkg_.a # internal
cp $WORK/b008/_pkg_.a /home/motiejus/.cache/go-build/50/505026d58453de7ecd352c103aa056241d881c58ea74eb21a5ae0e15ff07cb04-d # internal
internal/reflectlite
mkdir -p $WORK/b006/
sync
mkdir -p $WORK/b016/
cat >$WORK/b006/go_asm.h << 'EOF' # internal
EOF
cd /usr/local/go/src/internal/reflectlite
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/reflectlite -trimpath "$WORK/b006=>" -I $WORK/b006/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -gensymabis -o $WORK/b006/symabis ./asm.s
cat >$WORK/b016/importcfg << 'EOF' # internal
# import config
packagefile internal/race=$WORK/b015/_pkg_.a
packagefile runtime=$WORK/b008/_pkg_.a
packagefile sync/atomic=$WORK/b017/_pkg_.a
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b016/_pkg_.a -trimpath "$WORK/b016=>" -p sync -std -buildid wvAC9WlSSpm45XLcnaTc/wvAC9WlSSpm45XLcnaTc -goversion go1.16.5 -D "" -importcfg $WORK/b016/importcfg -pack -c=4 /usr/local/go/src/sync/cond.go /usr/local/go/src/sync/map.go /usr/local/go/src/sync/mutex.go /usr/local/go/src/sync/once.go /usr/local/go/src/sync/pool.go /usr/local/go/src/sync/poolqueue.go /usr/local/go/src/sync/runtime.go /usr/local/go/src/sync/runtime2.go /usr/local/go/src/sync/rwmutex.go /usr/local/go/src/sync/waitgroup.go
cat >$WORK/b006/importcfg << 'EOF' # internal
# import config
packagefile internal/unsafeheader=$WORK/b007/_pkg_.a
packagefile runtime=$WORK/b008/_pkg_.a
EOF
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b006/_pkg_.a -trimpath "$WORK/b006=>" -p internal/reflectlite -std -buildid wgNZfJSYgGl_6H4RCIJY/wgNZfJSYgGl_6H4RCIJY -goversion go1.16.5 -symabis $WORK/b006/symabis -D "" -importcfg $WORK/b006/importcfg -pack -asmhdr $WORK/b006/go_asm.h -c=4 /usr/local/go/src/internal/reflectlite/swapper.go /usr/local/go/src/internal/reflectlite/type.go /usr/local/go/src/internal/reflectlite/value.go
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b016/_pkg_.a # internal
cp $WORK/b016/_pkg_.a /home/motiejus/.cache/go-build/f6/f6484e48fcc5255b11738561e6aa8312eb5dbe3550056d286e349350c51209f7-d # internal
cd /usr/local/go/src/internal/reflectlite
/usr/local/go/pkg/tool/linux_amd64/asm -p internal/reflectlite -trimpath "$WORK/b006=>" -I $WORK/b006/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -o $WORK/b006/asm.o ./asm.s
/usr/local/go/pkg/tool/linux_amd64/pack r $WORK/b006/_pkg_.a $WORK/b006/asm.o # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b006/_pkg_.a # internal
cp $WORK/b006/_pkg_.a /home/motiejus/.cache/go-build/c3/c32e9dedb9fae72b716ea19164afe42c916a43ff39ade83636aa9c5d0608ae48-d # internal
errors
mkdir -p $WORK/b005/
cat >$WORK/b005/importcfg << 'EOF' # internal
# import config
packagefile internal/reflectlite=$WORK/b006/_pkg_.a
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b005/_pkg_.a -trimpath "$WORK/b005=>" -p errors -std -complete -buildid ktgqUdlQ4yuyIuItfIWm/ktgqUdlQ4yuyIuItfIWm -goversion go1.16.5 -D "" -importcfg $WORK/b005/importcfg -pack -c=4 /usr/local/go/src/errors/errors.go /usr/local/go/src/errors/wrap.go
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b005/_pkg_.a # internal
cp $WORK/b005/_pkg_.a /home/motiejus/.cache/go-build/35/35b1546f6785d352d6cd81370e9603cbce7ca7c70de425a44fa6a4c9ad99cf02-d # internal
internal/oserror
mkdir -p $WORK/b014/
cat >$WORK/b014/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b005/_pkg_.a
EOF
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b014/_pkg_.a -trimpath "$WORK/b014=>" -p internal/oserror -std -complete -buildid aQWJxO9XwfTwZyiJ1ZId/aQWJxO9XwfTwZyiJ1ZId -goversion go1.16.5 -D "" -importcfg $WORK/b014/importcfg -pack -c=4 /usr/local/go/src/internal/oserror/errors.go
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b014/_pkg_.a # internal
cp $WORK/b014/_pkg_.a /home/motiejus/.cache/go-build/c2/c2463bf262de558f20298bad00a4787dae579e0aadb6a23c1f066f15e22bcd6f-d # internal
syscall
mkdir -p $WORK/b004/
cat >$WORK/b004/go_asm.h << 'EOF' # internal
EOF
cd /usr/local/go/src/syscall
/usr/local/go/pkg/tool/linux_amd64/asm -p syscall -trimpath "$WORK/b004=>" -I $WORK/b004/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -gensymabis -o $WORK/b004/symabis ./asm_darwin_amd64.s ./zsyscall_darwin_amd64.s
cat >$WORK/b004/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b005/_pkg_.a
packagefile internal/bytealg=$WORK/b009/_pkg_.a
packagefile internal/oserror=$WORK/b014/_pkg_.a
packagefile internal/race=$WORK/b015/_pkg_.a
packagefile internal/unsafeheader=$WORK/b007/_pkg_.a
packagefile runtime=$WORK/b008/_pkg_.a
packagefile sync=$WORK/b016/_pkg_.a
EOF
cd /home/motiejus/x
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b004/_pkg_.a -trimpath "$WORK/b004=>" -p syscall -std -buildid WN1atWauif8txViVnE6o/WN1atWauif8txViVnE6o -goversion go1.16.5 -symabis $WORK/b004/symabis -D "" -importcfg $WORK/b004/importcfg -pack -asmhdr $WORK/b004/go_asm.h -c=4 /usr/local/go/src/syscall/bpf_darwin.go /usr/local/go/src/syscall/dirent.go /usr/local/go/src/syscall/endian_little.go /usr/local/go/src/syscall/env_unix.go /usr/local/go/src/syscall/exec_libc2.go /usr/local/go/src/syscall/exec_unix.go /usr/local/go/src/syscall/flock_darwin.go /usr/local/go/src/syscall/forkpipe.go /usr/local/go/src/syscall/msan0.go /usr/local/go/src/syscall/net.go /usr/local/go/src/syscall/ptrace_darwin.go /usr/local/go/src/syscall/route_bsd.go /usr/local/go/src/syscall/route_darwin.go /usr/local/go/src/syscall/sockcmsg_unix.go /usr/local/go/src/syscall/sockcmsg_unix_other.go /usr/local/go/src/syscall/str.go /usr/local/go/src/syscall/syscall.go /usr/local/go/src/syscall/syscall_bsd.go /usr/local/go/src/syscall/syscall_darwin.go /usr/local/go/src/syscall/syscall_darwin_amd64.go /usr/local/go/src/syscall/syscall_unix.go /usr/local/go/src/syscall/time_nofake.go /usr/local/go/src/syscall/timestruct.go /usr/local/go/src/syscall/zerrors_darwin_amd64.go /usr/local/go/src/syscall/zsyscall_darwin_amd64.go /usr/local/go/src/syscall/zsysnum_darwin_amd64.go /usr/local/go/src/syscall/ztypes_darwin_amd64.go
cd /usr/local/go/src/syscall
/usr/local/go/pkg/tool/linux_amd64/asm -p syscall -trimpath "$WORK/b004=>" -I $WORK/b004/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b004/asm_darwin_amd64.o ./asm_darwin_amd64.s
/usr/local/go/pkg/tool/linux_amd64/asm -p syscall -trimpath "$WORK/b004=>" -I $WORK/b004/ -I /usr/local/go/pkg/include -D GOOS_darwin -D GOARCH_amd64 -compiling-runtime -o $WORK/b004/zsyscall_darwin_amd64.o ./zsyscall_darwin_amd64.s
/usr/local/go/pkg/tool/linux_amd64/pack r $WORK/b004/_pkg_.a $WORK/b004/asm_darwin_amd64.o $WORK/b004/zsyscall_darwin_amd64.o # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b004/_pkg_.a # internal
cp $WORK/b004/_pkg_.a /home/motiejus/.cache/go-build/8e/8e37a50a21d57847b014f77624add9c91af1f52cb2a0b91a4c891aedf0f78879-d # internal
command-line-arguments
mkdir -p $WORK/b001/
cd /home/motiejus/x
TERM='dumb' CGO_LDFLAGS='"-g" "-O2"' /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/b001/ -importpath command-line-arguments -- -I $WORK/b001/ -g -O2 ./hello.go
cd $WORK/b001
TERM='dumb' zccmacos -I /home/motiejus/x -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x001.o -c _cgo_export.c
TERM='dumb' zccmacos -I /home/motiejus/x -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_x002.o -c hello.cgo2.c
TERM='dumb' zccmacos -I /home/motiejus/x -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I ./ -g -O2 -o ./_cgo_main.o -c _cgo_main.c
cd /home/motiejus/x
TERM='dumb' zccmacos -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -o $WORK/b001/_cgo_.o $WORK/b001/_cgo_main.o $WORK/b001/_x001.o $WORK/b001/_x002.o -g -O2
# command-line-arguments
+ exec zig cc -target x86_64-macos-gnu -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -o $WORK/b001/_cgo_.o $WORK/b001/_cgo_main.o $WORK/b001/_x001.o $WORK/b001/_x002.o -g -O2
TERM='dumb' /usr/local/go/pkg/tool/linux_amd64/cgo -dynpackage main -dynimport $WORK/b001/_cgo_.o -dynout $WORK/b001/_cgo_import.go
cat >$WORK/b001/_gomod_.go << 'EOF' # internal
package main
import _ "unsafe"
//go:linkname __debug_modinfo__ runtime.modinfo
var __debug_modinfo__ = "0w\xaf\f\x92t\b\x02A\xe1\xc1\a\xe6\xd6\x18\xe6path\tcommand-line-arguments\nmod\tcommand-line-arguments\t(devel)\t\n\xf92C1\x86\x18 r\x00\x82B\x10A\x16\xd8\xf2"
EOF
cat >$WORK/b001/importcfg << 'EOF' # internal
# import config
packagefile runtime/cgo=$WORK/b003/_pkg_.a
packagefile syscall=$WORK/b004/_pkg_.a
packagefile runtime=$WORK/b008/_pkg_.a
EOF
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/b001/_pkg_.a -trimpath "$WORK/b001=>" -p main -buildid A6EoBS2ynwVhHXzy1K-8/A6EoBS2ynwVhHXzy1K-8 -goversion go1.16.5 -D _/home/motiejus/x -importcfg $WORK/b001/importcfg -pack -c=4 $WORK/b001/_cgo_gotypes.go $WORK/b001/hello.cgo1.go $WORK/b001/_cgo_import.go $WORK/b001/_gomod_.go
/usr/local/go/pkg/tool/linux_amd64/pack r $WORK/b001/_pkg_.a $WORK/b001/_x001.o $WORK/b001/_x002.o # internal
/usr/local/go/pkg/tool/linux_amd64/buildid -w $WORK/b001/_pkg_.a # internal
cp $WORK/b001/_pkg_.a /home/motiejus/.cache/go-build/b4/b48aa36fb7cec690b048bd293d501e173b61de0296dc524d0b2ab1ef36de67ab-d # internal
# command-line-arguments
+ exec zig cc -target x86_64-macos-gnu -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b001/ -g -O2 -o $WORK/b001/_x001.o -c _cgo_export.c
# command-line-arguments
+ exec zig cc -target x86_64-macos-gnu -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b001/ -g -O2 -o $WORK/b001/_x002.o -c hello.cgo2.c
# command-line-arguments
+ exec zig cc -target x86_64-macos-gnu -I . -fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3374658565/b001=/tmp/go-build -gno-record-gcc-switches -fno-common -I $WORK/b001/ -g -O2 -o $WORK/b001/_cgo_main.o -c _cgo_main.c
cat >$WORK/b001/importcfg.link << 'EOF' # internal
packagefile command-line-arguments=$WORK/b001/_pkg_.a
packagefile runtime/cgo=$WORK/b003/_pkg_.a
packagefile syscall=$WORK/b004/_pkg_.a
packagefile runtime=$WORK/b008/_pkg_.a
packagefile errors=$WORK/b005/_pkg_.a
packagefile internal/bytealg=$WORK/b009/_pkg_.a
packagefile internal/oserror=$WORK/b014/_pkg_.a
packagefile internal/race=$WORK/b015/_pkg_.a
packagefile internal/unsafeheader=$WORK/b007/_pkg_.a
packagefile sync=$WORK/b016/_pkg_.a
packagefile internal/cpu=$WORK/b010/_pkg_.a
packagefile runtime/internal/atomic=$WORK/b011/_pkg_.a
packagefile runtime/internal/math=$WORK/b012/_pkg_.a
packagefile runtime/internal/sys=$WORK/b013/_pkg_.a
packagefile internal/reflectlite=$WORK/b006/_pkg_.a
packagefile sync/atomic=$WORK/b017/_pkg_.a
EOF
mkdir -p $WORK/b001/exe/
cd .
/usr/local/go/pkg/tool/linux_amd64/link -o $WORK/b001/exe/a.out -importcfg $WORK/b001/importcfg.link -buildmode=exe -buildid=DKP6akmyncodWGYq0ZPl/A6EoBS2ynwVhHXzy1K-8/0jMO2HpdWEyhYjbd9bHI/DKP6akmyncodWGYq0ZPl -linkmode external -extldflags -static -extld=zccmacos $WORK/b001/_pkg_.a
# command-line-arguments
/usr/local/go/pkg/tool/linux_amd64/link: running zccmacos failed: signal: segmentation fault
+ exec zig cc -target x86_64-macos-gnu -arch x86_64 -m64 -Wl,-headerpad,1144 -Wl,-no_pie -Wl,-pagezero_size,4000000 -o $WORK/b001/exe/a.out -Wl,--compress-debug-sections=zlib-gnu /tmp/go-link-864535332/go.o /tmp/go-link-864535332/000000.o /tmp/go-link-864535332/000001.o /tmp/go-link-864535332/000002.o /tmp/go-link-864535332/000003.o /tmp/go-link-864535332/000004.o /tmp/go-link-864535332/000005.o /tmp/go-link-864535332/000006.o /tmp/go-link-864535332/000007.o /tmp/go-link-864535332/000008.o /tmp/go-link-864535332/000009.o /tmp/go-link-864535332/000010.o -g -O2 -g -O2 -lpthread -no-pie -static
warning: unsupported linker arg: -headerpad
warning: unsupported linker arg: 1144
warning: unsupported linker arg: -no_pie
warning: unsupported linker arg: -pagezero_size
warning: unsupported linker arg: 4000000
warning: unsupported linker arg: --compress-debug-sections=zlib-gnu

Possibly related to #43078

@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented Jun 8, 2021

The linker assumes a clang-compatible C toolchain for targeting darwin. You'll need a clang-compatible C toolchain.

/usr/local/go/pkg/tool/linux_amd64/link: running zccmacos failed: signal: segmentation fault

It seems it is zccmacos seg faults, which suggests it is a bug somewhere in the C toolchain itself.

Closing, as it doesn't seem like a Go bug, and as a dup of #44695 for general zig support. Thanks.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants