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/nm: TestInternalLinkerCgoExec fails #33028

Closed
pubblic opened this issue Jul 10, 2019 · 5 comments
Closed

cmd/nm: TestInternalLinkerCgoExec fails #33028

pubblic opened this issue Jul 10, 2019 · 5 comments

Comments

@pubblic
Copy link

pubblic commented Jul 10, 2019

Please answer these questions before submitting your issue. Thanks!

What did you do?

Home@HOME MINGW64 ~/src
$ CGO_ENABLED=1 go test cmd/nm
        --- FAIL: TestInternalLinkerCgoExec (6.44s)
    nm_test.go:111: building test executable failed: exit status 2 # command-line-arguments
        runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)
        runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)
        runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)
FAIL
FAIL    cmd/nm  12.447s

Home@HOME MINGW64 ~/src
$ go bug

Home@HOME MINGW64 ~/src
$ go test cmd/nm
--- FAIL: TestInternalLinkerCgoExec (8.49s)
    nm_test.go:111: building test executable failed: exit status 2 # command-line-arguments
        runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)
        runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)
        runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)
FAIL
FAIL    cmd/nm  13.440s

What did you expect to see?

test pass

What did you see instead?

test fail

System details

go version go1.12.7 windows/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="C:\Users\Home\lib\go\cache"
GOEXE=".exe"
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="windows"
GOOS="windows"
GOPATH="C:\Users\Home\lib\go"
GOPROXY=""
GORACE=""
GOROOT="C:\Go"
GOTMPDIR=""
GOTOOLDIR="C:\Go\pkg\tool\windows_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version go1.12.7 windows/amd64
GOROOT/bin/go tool compile -V: compile version go1.12.7
@ianlancetaylor
Copy link
Contributor

CC @aclements

@alexbrainman
Copy link
Member

@pubblic thank you for reporting the issue.

What does command

gcc --version

prints on your computer?

I am pretty sure this is dup of #23649.

runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)

I do not know what ABI0 is. I doubt, ABI0 is relevant here - linker just could not resolve __acrt_iob_func symbol. We do not know how to fix #23649, but at least we could improve the error message by not mentioning ABI0.

Alex

@pubblic
Copy link
Author

pubblic commented Jul 13, 2019

my gcc version is

$ gcc --version
gcc.exe (Rev3, Built by MSYS2 project) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@alexbrainman
Copy link
Member

my gcc version is

$ gcc --version
gcc.exe (Rev3, Built by MSYS2 project) 9.1.0

Thank you for confirming.

You are using fairly recent version of gcc. Some Go linker functionality is broken with latest gcc (as you discovered and as described in #23649).

But, perhaps, you are not using this functionality. Do you have any other problems but broken cmd/nm.TestInternalLinkerCgoExec test? If not, I suggest you ignore cmd/nm: TestInternalLinkerCgoExec failure.

Alex

@pubblic
Copy link
Author

pubblic commented Jul 13, 2019

$ go clean -testcache && go test cmd/nm -v
=== RUN   TestInternalLinkerCgoExec
=== PAUSE TestInternalLinkerCgoExec
=== RUN   TestExternalLinkerCgoExec
=== PAUSE TestExternalLinkerCgoExec
=== RUN   TestCgoLib
=== PAUSE TestCgoLib
=== RUN   TestNonGoExecs
=== PAUSE TestNonGoExecs
=== RUN   TestGoExec
=== PAUSE TestGoExec
=== RUN   TestGoLib
=== PAUSE TestGoLib
=== CONT  TestInternalLinkerCgoExec
=== CONT  TestGoExec
=== CONT  TestGoLib
=== CONT  TestCgoLib
--- PASS: TestGoLib (1.20s)
=== CONT  TestExternalLinkerCgoExec
--- PASS: TestCgoLib (2.72s)
=== CONT  TestNonGoExecs
--- FAIL: TestInternalLinkerCgoExec (3.29s)
    nm_test.go:111: building test executable failed: exit status 2 # command-line-arguments
        runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)
        runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)
        runtime/cgo(.text): relocation target __acrt_iob_func not defined for ABI0 (but is defined for ABI0)
--- PASS: TestNonGoExecs (0.59s)
--- PASS: TestGoExec (4.24s)
--- PASS: TestExternalLinkerCgoExec (3.84s)
FAIL
FAIL    cmd/nm  7.475s

Only TestInernalLinkerCgoExec test fails, other tests do not.

@pubblic pubblic closed this as completed Jul 13, 2019
@golang golang locked and limited conversation to collaborators Jul 12, 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

4 participants