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
runtime/cgo: added missing includes for errno.h to the windows gcc stubs. #28747
Conversation
…ubs. This adds the includes for errno.h to the windows stubs for runtime/cgo so that "errno" is properly declared. Due to "errno" not being properly declared, the compiler is forced to assume it's an external which leaves it up to the linker. This is an issue in some implementations as errno might be a macro which results in an unresolved symbol error during linking. runtime/cgo/gcc_libinit_windows.c: added include runtime/cgo/gcc_windows_386.c: added include runtime/cgo/gcc_windows_amd64.c: added include
This PR (HEAD: 90da06e) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/149118 to see it. Tip: You can toggle comments from me using the |
Message from Brad Fitzpatrick: Patch Set 1: What are "some implementations"? Please don’t reply on this GitHub thread. Visit golang.org/cl/149118. |
Message from Ali Rizvi-Santiago: Patch Set 1:
msys2 (uname -a MSYS_NT-6.3 skinny 2.10.0(0.325/5/3) 2018-02-09 15:25 x86_64 Msys) is just one example which can declare errno in sys/errno.h as: #ifndef _REENT_ONLY But one thing which is weird is that "errno.h" is included in all the other stubs except for the 3 in this patch (for some reason). Wasn't sure why it was skipped for these because it's essentially not declaring errno. Please don’t reply on this GitHub thread. Visit golang.org/cl/149118. |
Message from Ali Rizvi-Santiago: Patch Set 1:
Another C standard library that declares errno as a macro seems to be openwatcom (although it's not like it's supported by golang): Really, though, it's just not correct to use errno before declaring it as it's relying entirely on a compiler assumption. Although pretty much all compilers will just throw a warning and assume you're specifying an external, it's really up to the standard library for how to handle errno. Please don’t reply on this GitHub thread. Visit golang.org/cl/149118. |
Message from Ian Lance Taylor: Patch Set 1: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/149118. |
Message from Gobot Gobot: Patch Set 1: TryBots beginning. Status page: https://farmer.golang.org/try?commit=6e6e5202 Please don’t reply on this GitHub thread. Visit golang.org/cl/149118. |
Message from Gobot Gobot: Patch Set 1: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/149118. |
…ubs. This adds the includes for errno.h to the windows stubs for runtime/cgo so that "errno" is properly declared. Due to "errno" not being properly declared, the compiler is forced to assume it's an external which leaves it up to the linker. This is an issue in some implementations as errno might be a macro which results in an unresolved symbol error during linking. runtime/cgo/gcc_libinit_windows.c: added include runtime/cgo/gcc_windows_386.c: added include runtime/cgo/gcc_windows_amd64.c: added include Change-Id: I77167d02f7409462979135efc55cf50bbc6bd363 GitHub-Last-Rev: 90da06e GitHub-Pull-Request: #28747 Reviewed-on: https://go-review.googlesource.com/c/149118 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Message from Ian Lance Taylor: Patch Set 1: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/149118. |
This PR is being closed because golang.org/cl/149118 has been merged. |
This adds the includes for errno.h to the windows stubs
for runtime/cgo so that "errno" is properly declared.
Due to "errno" not being properly declared, the compiler is
forced to assume it's an external which leaves it up to the
linker. This is an issue in some implementations as errno
might be a macro which results in an unresolved symbol error
during linking.
runtime/cgo/gcc_libinit_windows.c: added include
runtime/cgo/gcc_windows_386.c: added include
runtime/cgo/gcc_windows_amd64.c: added include