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

x/sys/unix: relocation target golang.org/x/sys/unix.Syscall6 not defined for ABIInternal (but is defined for ABI0) #30427

Closed
mahmud2011 opened this issue Feb 27, 2019 · 21 comments

Comments

@mahmud2011
Copy link

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

go version go1.12 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mahmudulhaque/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/mahmudulhaque/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3q/xcf0ldq11nn__8xv16hqhl6h0000gp/T/go-build887610377=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ vgo build

What did you expect to see?

Successful build.

What did you see instead?

golang.org/x/sys/unix.kevent: relocation target golang.org/x/sys/unix.Syscall6 not defined for ABIInternal (but is defined for ABI0)
golang.org/x/sys/unix.Close: relocation target golang.org/x/sys/unix.Syscall not defined for ABIInternal (but is defined for ABI0)
golang.org/x/sys/unix.Kqueue: relocation target golang.org/x/sys/unix.Syscall not defined for ABIInternal (but is defined for ABI0)
golang.org/x/sys/unix.Open: relocation target golang.org/x/sys/unix.Syscall not defined for ABIInternal (but is defined for ABI0)
golang.org/x/sys/unix.mmap: relocation target golang.org/x/sys/unix.Syscall6 not defined for ABIInternal (but is defined for ABI0)
golang.org/x/sys/unix.munmap: relocation target golang.org/x/sys/unix.Syscall not defined for ABIInternal (but is defined for ABI0)
@ivanovaleksey
Copy link

I have the same issue though I use just go not vgo.

@ianlancetaylor
Copy link
Contributor

You need to update to a newer version of golang.org/x/sys/unix.

@mahmud2011
Copy link
Author

mahmud2011 commented Feb 28, 2019

I have the same issue though I use just go not vgo.

From go doc vgo:

Vgo is a prototype of what the go command might look like with integrated support for package versioning.

Download and install with:

go get -u golang.org/x/vgo

Then run "vgo" instead of "go".

@mahmud2011
Copy link
Author

You need to update to a newer version of golang.org/x/sys/unix.

Already did.

go get -u golang.org/x/sys/unix

@ianlancetaylor
Copy link
Contributor

In the current golang.org/x/sys/unix sources, kevent on darwin/amd64 does not call Syscall6. I don't see how you could get the errors you report with the current sources. Can you double check?

@mahmud2011
Copy link
Author

Facing this issue after upgrading to Go 1.12.

screenshot 2019-03-02 at 21 30 00

@mahmud2011
Copy link
Author

Strange! I can build a project from scratch.

screenshot 2019-03-02 at 22 02 07

@ianlancetaylor
Copy link
Contributor

@mmhyamin What is the git revision of your golang.org/x/sys/unix sources?

@mahmud2011
Copy link
Author

mahmud2011 commented Mar 3, 2019

@mmhyamin What is the git revision of your golang.org/x/sys/unix sources?

c2f5717

@alekc
Copy link

alekc commented Mar 12, 2019

I am facing the same issue as well.

There is some info on 1.12 compatibility

The compiler toolchain now uses different conventions to call Go functions and assembly functions. This should be invisible to users, except for calls that simultaneously cross between Go and assembly and cross a package boundary. If linking results in an error like "relocation target not defined for ABIInternal (but is defined for ABI0)", please refer to the compatibility section of the ABI design document. 

And bazelbuild/rules_go#1893 but so far I can't any useful info on how to fix it.

vgo version
go version go1.12 linux/amd64 vgo:devel +b0a1c5df98

Edit:
my errors:

vgo build wwserver.go
# command-line-arguments
golang.org/x/sys/unix.ioctl: relocation target golang.org/x/sys/unix.Syscall not defined for ABIInternal (but is defined for ABI0)
golang.org/x/sys/unix.munmap: relocation target golang.org/x/sys/unix.Syscall not defined for ABIInternal (but is defined for ABI0)
golang.org/x/sys/unix.mmap: relocation target golang.org/x/sys/unix.Syscall6 not defined for ABIInternal (but is defined for ABI0)

@ianlancetaylor
Copy link
Contributor

@alekc It sounds like you are building with Bazel? Bazel may need to be updated to support the new ABI support.

I don't know what the status of vgo is.

@mikioh mikioh changed the title golang.org/x/sys/unix.kevent: relocation target golang.org/x/sys/unix.Syscall6 not defined for ABIInternal (but is defined for ABI0) x/sys/unix: relocation target golang.org/x/sys/unix.Syscall6 not defined for ABIInternal (but is defined for ABI0) Mar 13, 2019
@alekc
Copy link

alekc commented Mar 13, 2019 via email

@ianlancetaylor
Copy link
Contributor

Has vgo been kept up to date with Go 1.12? Why not use the normal go tool? I think that at this point everything in vgo has been moved to the the go tool.

@devanshah2
Copy link

I am also facing the same issue as reported here as well.

Go version: go version go1.12 darwin/amd64

vgo version: go version go1.12 darwin/amd64 vgo:devel +b0a1c5df98

Getting error:

# command-line-arguments
golang.org/x/sys/unix.libc_ioctl_trampoline·f: relocation target golang.org/x/sys/unix.libc_ioctl_trampoline not defined for ABIInternal (but is defined for ABI0)
golang.org/x/sys/unix.libc_mmap_trampoline·f: relocation target golang.org/x/sys/unix.libc_mmap_trampoline not defined for ABIInternal (but is defined for ABI0)
golang.org/x/sys/unix.libc_munmap_trampoline·f: relocation target golang.org/x/sys/unix.libc_munmap_trampoline not defined for ABIInternal (but is defined for ABI0)

@ianlancetaylor
Copy link
Contributor

@devanshah2 Why are you using vgo?

@alekc
Copy link

alekc commented Mar 20, 2019

Has vgo been kept up to date with Go 1.12? Why not use the normal go tool? I think that at this point everything in vgo has been moved to the the go tool.

I guess it's just a habit. I have not been working on go releases for a while, but recent changes in the company made me switch to building process. I will have a look into compilation by using go + modules.

@devanshah2
Copy link

@devanshah2 Why are you using vgo?

Using it for dependency management instead of dep.

@ianlancetaylor
Copy link
Contributor

@devanshah2 In the Go 1.12 release all the features of vgo are available in the normal Go tool, if you set the environment variable GO111MODULE=on.

@devanshah2
Copy link

@ianlancetaylor Cool. Thanks

I will re-try with a clean environment where it is only go installed and no more vgo.

@alekc
Copy link

alekc commented Mar 20, 2019

Tried to compile it with go 1.12 without using vgo

# go version
go version go1.12 linux/amd64

update sys/unix (just in case)

# export GO111MODULE=on
# go get -u golang.org/x/sys/unix
go: finding golang.org/x/sys/unix latest
go: finding golang.org/x/sys latest
go: downloading golang.org/x/sys v0.0.0-20190318195719-6c81ef8f67ca
go: extracting golang.org/x/sys v0.0.0-20190318195719-6c81ef8f67ca

After these steps, all went fine. Without running go get -u golang.org/x/sys/unix while GO111MODULE is on I was getting the error mentioned above.

Upon further investigation it turned out that I already had package "golang.org/x/sys" pinned in go.mod, which was probably causing the issue with go 1.12 when using modules.

@devanshah2
Copy link

I managed to get around my issue after running:

go clean -i -cache -x -r

Then did the go get .... and all worked again no more errors.

@golang golang locked and limited conversation to collaborators Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants