Skip to content

cgocall unavailable without CGO_ENABLED=0 #2

@iamacarpet

Description

@iamacarpet

Hello @notti

Just finishing up my documentation and I noticed in yours it says:

WARNING nocgo supports both cgo and missing cgo as environment. So if you want to ensure cgo not being used don't forget CGO_ENABLED=0 as environment variable to go build.

However, building without CGO_ENABLED=0 always throws me this error:

fatal error: cgocall unavailable

goroutine 1 [running, locked to thread]:
runtime.throw(0x4f53b4, 0x13)
        /usr/local/go/src/runtime/panic.go:617 +0x72 fp=0xc000090d50 sp=0xc000090d20 pc=0x429d02
runtime.cgocall(0x4a8ed0, 0xc000090d98, 0xc000090db8)
        /usr/local/go/src/runtime/cgocall.go:96 +0xe4 fp=0xc000090d88 sp=0xc000090d50 pc=0x403d34
github.com/notti/nocgo.callWrapper(0xc000086010, 0x10, 0x10, 0xc000000002, 0xf, 0x10, 0x7fbff35f9d98, 0x0, 0xaa, 0xc000090f38, ...)
        ~/go-projects/src/github.com/notti/nocgo/call_amd64.s:69 +0x49 fp=0xc000090db8 sp=0xc000090d88 pc=0x4a8ea9
github.com/notti/nocgo.Open(0x4f47d3, 0xf, 0x40b768, 0x70, 0x4e6f60)
        ~/go-projects/src/github.com/notti/nocgo/dlopen.go:61 +0x84 fp=0xc000090e10 sp=0xc000090db8 pc=0x4a7f54
github.com/iamacarpet/go-sqlite3-dynamic.registerLibrary()
        ~/go-projects/src/github.com/iamacarpet/go-sqlite3-dynamic/dynamic_register_linux.go:65 +0x4b fp=0xc000090f48 sp=0xc000090e10 pc=0x4ac4cb
github.com/iamacarpet/go-sqlite3-dynamic.init.0()
        ~/go-projects/src/github.com/iamacarpet/go-sqlite3-dynamic/sqlite3.go:23 +0x22 fp=0xc000090f78 sp=0xc000090f48 pc=0x4ad9e2
github.com/iamacarpet/go-sqlite3-dynamic.init()
        <autogenerated>:1 +0x93 fp=0xc000090f88 sp=0xc000090f78 pc=0x4b3a33
main.init()
        <autogenerated>:1 +0x54 fp=0xc000090f98 sp=0xc000090f88 pc=0x4b4654
runtime.main()
        /usr/local/go/src/runtime/proc.go:188 +0x1c8 fp=0xc000090fe0 sp=0xc000090f98 pc=0x42b628
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc000090fe8 sp=0xc000090fe0 pc=0x454c71

Is this expected behavior?

Regards,
iamacarpet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions