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

go1.14 cgo on windows doesn't link, undefined references to __errno in errno_itself #37553

Closed
glycerine opened this issue Feb 28, 2020 · 4 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@glycerine
Copy link

glycerine commented Feb 28, 2020

building https://github.com/glycerine/goq on windows under go1.13.8 works fine.

under go1.14 I get link failure.

~/go/src/github.com/glycerine/goq
$ go version
go version go1.13.8 windows/amd64

~/go/src/github.com/glycerine/goq
$ go install

~/go/src/github.com/glycerine/goq ## so compile and link worked fine under go1.13.8
$ go1.14 install
# github.com/glycerine/goq
C:\Users\Administrator\sdk\go1.14\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\cygwin64\tmp\go-link-118756859\000001.o: In function `errno_itself':
C:\Users\Administrator\go\src\github.com\glycerine\goq/inspecterrno.go:8: undefined reference to `__errno'
C:\cygwin64\tmp\go-link-118756859\000001.o: In function `addr_of_errno':
C:\Users\Administrator\go\src\github.com\glycerine\goq/inspecterrno.go:5: undefined reference to `__errno'
C:\cygwin64\tmp\go-link-118756859\000001.o: In function `errno_itself':
C:\Users\Administrator\go\src\github.com\glycerine\goq/inspecterrno.go:8: undefined reference to `__errno'
C:\cygwin64\tmp\go-link-118756859\000001.o: In function `addr_of_errno':
C:\Users\Administrator\go\src\github.com\glycerine\goq/inspecterrno.go:5: undefined reference to `__errno'
collect2.exe: error: ld returned 1 exit status

~/go/src/github.com/glycerine/goq

$ gcc --version
gcc.exe (tdm64-1) 5.1.0
Copyright (C) 2015 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.


 ~/go/src/github.com/glycerine/goq
$ which gcc
/cygdrive/c/TDMGCC64/bin/gcc  ## using https://tdm-gcc.tdragon.net/

edit: exactly the same failure under gcc v8.1
/cygdrive/c/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc from https://sourceforge.net/projects/mingw-w64/

@glycerine glycerine changed the title go1.14 cgo on windows doesn't link, undefined references to __errno go1.14 cgo on windows doesn't link, undefined references to errno_itself Feb 28, 2020
@glycerine glycerine changed the title go1.14 cgo on windows doesn't link, undefined references to errno_itself go1.14 cgo on windows doesn't link, undefined references to __errno in errno_itself Feb 28, 2020
@AlexRouSg
Copy link
Contributor

Unable to reproduce with go version go1.14 windows/amd64 and gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0

Try cleaning the build cache (go clean -cache) and/or not running in cygwin

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 28, 2020
@glycerine
Copy link
Author

I think go clean -cache fixed it. Why would that be?

@AlexRouSg
Copy link
Contributor

Could be a bug with the build cache, but to find that out would require a way to repo reliability and without changing GCC. As the cache is already known to not detect changes to external C/C++ headers and libs. (#24355)

@glycerine
Copy link
Author

okay, sounds like a known issue.

@golang golang locked and limited conversation to collaborators Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants