We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version go1.4.2 darwin/amd64
$ cd $GOPATH/src/github.com/sbinet $ git clone git://github.com/sbinet/test-cgo $ cd test-cgo $ make /bin/rm -f pkg/my/*.so (cd pkg/my && cc -shared -o libmy.so lib.c) # github.com/sbinet/test-cgo/pcgo github.com/sbinet/test-cgo/pkg._Cvar_Global: unsupported relocation for dynamic symbol Global (type=1 stype=32) github.com/sbinet/test-cgo/pkg._Cvar_Global: unhandled relocation for Global (type 32 rtype 1) make: *** [install] Error 2
note that if, in test-cgo/pkg/my/lib.h I change:
test-cgo/pkg/my/lib.h
#define API_DATA(RTYPE) extern RTYPE //#define API_DATA(RTYPE) RTYPE
to:
//#define API_DATA(RTYPE) extern RTYPE #define API_DATA(RTYPE) RTYPE
everything compiles and runs:
$ make && (cd ./pkg/my && pcgo) /bin/rm -f pkg/my/*.so (cd pkg/my && cc -shared -o libmy.so lib.c) >>> Global: 42 Global: 42 <<<
Note that on master, I get instead:
master
$ go version devel +48469a2 Mon Feb 23 07:54:13 2015 +0000 darwin/amd64 $ make && (cd ./pkg/my && pcgo) >>> Global: 42 fatal error: unexpected signal during runtime execution [signal 0xb code=0x1 addr=0xb01dfacedebac1e pc=0x1dbf23] runtime stack: runtime.throw(0x126e70, 0x2a) /Users/binet/dev/go/root/go/src/runtime/panic.go:511 +0xa0 runtime.sigpanic() /Users/binet/dev/go/root/go/src/runtime/sigpanic_unix.go:12 +0x62 goroutine 1 [syscall, locked to thread]: runtime.cgocall_errno(0xac120, 0xc208037ed0, 0xc200000000) /Users/binet/dev/go/root/go/src/runtime/cgocall.go:130 +0x10c fp=0xc208037eb0 sp=0xc208037e88 github.com/sbinet/test-cgo/pkg._Cfunc_Get(0x25ff0000077a25ff, 0x0) /Users/binet/dev/go/root/path/src/github.com/sbinet/test-cgo/pkg/:24 +0x3c fp=0xc208037ed0 sp=0xc208037eb0 github.com/sbinet/test-cgo/pkg.Print() /Users/binet/dev/go/root/path/src/github.com/sbinet/test-cgo/pkg/pkg.go:14 +0x10c fp=0xc208037f58 sp=0xc208037ed0 main.main() /Users/binet/dev/go/root/path/src/github.com/sbinet/test-cgo/pcgo/main.go:11 +0x4e fp=0xc208037fa0 sp=0xc208037f58 runtime.main() /Users/binet/dev/go/root/go/src/runtime/proc.go:88 +0x1d2 fp=0xc208037fe0 sp=0xc208037fa0 runtime.goexit() /Users/binet/dev/go/root/go/src/runtime/asm_amd64.s:2466 +0x1 fp=0xc208037fe8 sp=0xc208037fe0 goroutine 17 [syscall, locked to thread]: runtime.goexit() /Users/binet/dev/go/root/go/src/runtime/asm_amd64.s:2466 +0x1 zsh: exit 2 (; cd pkg/my && pcgo; )
Such extern global symbols are heavily used in e.g. the CPython API.
extern
CPython
To recap: the pkg builds fine, it's when somebody uses that cgo-based package that all hell breaks loose.
pkg
The text was updated successfully, but these errors were encountered:
I suspect this is a duplicate of #8009.
Issue #9511 talks about dropping support for OS X 10.6 officially. If we do that we can close this bug and #8009 and maybe a few others.
Sorry, something went wrong.
yes, most probably the same underlying issue.
I just upgraded my old (2008) macbook-pro from 10.6 to 10.10 (yosemite) and everything works fine (master and 1.4.2)
Per #9511, we will not be making any further bug fixes specific to 10.6.
No branches or pull requests
go version go1.4.2 darwin/amd64
MacOSX-10.6.8
note that if, in
test-cgo/pkg/my/lib.h
I change:to:
everything compiles and runs:
Note that on
master
, I get instead:Such
extern
global symbols are heavily used in e.g. theCPython
API.To recap: the
pkg
builds fine, it's when somebody uses that cgo-based package that all hell breaks loose.The text was updated successfully, but these errors were encountered: