golang/go

cmd/link: linking a c-shared archive into a Go program fails on Darwin

Open

#29,061 opened on Dec 1, 2018

View on GitHub
 (9 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
NeedsInvestigationOS-Darwinhelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Please answer these questions before submitting your issue. Thanks!

What did you do?

I tried to rebuild the latest tip version with all.bash on my Mac.

What did you expect to see?

No error.

What did you see instead?

$ git rev-parse HEAD
b397248168fcb26400ac6afb88bf6080497a819e
##### ../misc/cgo/testcshared
--- FAIL: TestGo2C2Go (4.85s)
    cshared_test.go:616: run: [go build -buildmode=c-shared -o /var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/cshared-TestGo2C2Go380654146/libtestgo2c2go.dylib go2c2go/go]
    cshared_test.go:641: run: [go build -o /var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/cshared-TestGo2C2Go380654146/m1 go2c2go/m1]
    cshared_test.go:642: command failed: [/var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/cshared-TestGo2C2Go380654146/m1]
        signal: abort trap
        dyld: Library not loaded: libtestgo2c2go.dylib
          Referenced from: /var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/cshared-TestGo2C2Go380654146/m1
          Reason: image not found
        
FAIL
2018/12/02 08:32:51 Failed: exit status 1

Does this issue reproduce with the latest release (go1.11.2)?

N/A

System details

go version devel +b397248168 Sat Dec 1 17:31:02 2018 +0000 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/yoshiki/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/yoshiki/gocode:/Users/yoshiki/exercises/gpl:/Users/yoshiki/oak"
GOPROXY=""
GORACE=""
GOROOT="/Users/yoshiki/tools/go"
GOTMPDIR=""
GOTOOLDIR="/Users/yoshiki/tools/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version devel +b397248168 Sat Dec 1 17:31:02 2018 +0000 darwin/amd64
GOROOT/bin/go tool compile -V: compile version devel +b397248168 Sat Dec 1 17:31:02 2018 +0000
uname -v: Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.14.1
BuildVersion:	18B75
lldb --version: lldb-1000.0.38.2
  Swift-4.2

Contributor guide