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/cgo/internal/testshared: gccgo tests fail on some linux/ppc64le gccgo compilers #60798
Comments
I suppose that cmd/go shouldn't crash, but why is the |
Change https://go.dev/cl/503496 mentions this issue: |
Previously if there was something invalid about the package list cmd/go would crash rather than reporting a useful error. For #60798 Change-Id: I502facf41442ab49217405b5b1874fff52a6d416 Reviewed-on: https://go-review.googlesource.com/c/go/+/503496 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
It seems to be getting lost when linking the shared library. It exists in the input archive
|
What linker are you using? |
In the above case |
Hrm, I suspect the issue is the Looking at the output of
Poking around the gccgo code, I wonder if the macro |
I do see, in gcc/config/rs6000/linux64.h: #undef TARGET_AIX
#define TARGET_AIX TARGET_64BIT That dates back to 2023 and looks like a problem here. There is similar code in freebsd64.h. Perhaps we can change the code in go-backend.cc to test OBJECT_FORMAT_COFF rather than TARGET_AIX. Want to give that a try? |
I posted a couple of patches to gcc to update the usage of |
TARGET_AIX is defined to a non-zero value on linux and maybe other powerpc64le targets. This leads to unexpected behavior such as dropping the .go_export section when linking a shared library on linux/powerpc64le. Instead, use TARGET_AIX_OS to toggle AIX specific behavior. Fixes golang/go#60798. gcc/go/ChangeLog: * go-backend.cc [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS. * go-lang.cc: Likewise.
TARGET_AIX is defined to a non-zero value on linux and maybe other powerpc64le targets. This leads to unexpected behavior such as dropping the .go_export section when linking a shared library on linux/powerpc64le. Instead, use TARGET_AIX_OS to toggle AIX specific behavior. Fixes golang/go#60798. gcc/go/ChangeLog: * go-backend.cc [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS. * go-lang.cc: Likewise.
Change https://go.dev/cl/504095 mentions this issue: |
Change https://go.dev/cl/503495 mentions this issue: |
Otherwise, gccgo tests may be quietly skipped. For #60798 Change-Id: Iaad6b53c95ad4d407b917d8f62978979b82a4e81 Reviewed-on: https://go-review.googlesource.com/c/go/+/503495 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Disable PPC64 gccgo tests until issue #60798 is fixed in gcc. Change-Id: I4d330e3d0ab6d4174ee6d8ff2cbedf53c8c4e3d9 Reviewed-on: https://go-review.googlesource.com/c/go/+/504095 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
TARGET_AIX is defined to a non-zero value on linux and maybe other powerpc64le targets. This leads to unexpected behavior such as dropping the .go_export section when linking a shared library on linux/powerpc64le. Instead, use TARGET_AIX_OS to toggle AIX specific behavior. Fixes golang/go#60798. 2023-06-22 Paul E. Murphy <murphyp@linux.ibm.com> gcc/go/ * go-backend.cc [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS. * go-lang.cc: Likewise.
TARGET_AIX is defined to a non-zero value on linux and maybe other powerpc64le targets. This leads to unexpected behavior such as dropping the .go_export section when linking a shared library on linux/powerpc64le. Instead, use TARGET_AIX_OS to toggle AIX specific behavior. Fixes golang/go#60798. 2023-06-22 Paul E. Murphy <murphyp@linux.ibm.com> gcc/go/ * go-backend.cc [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS. * go-lang.cc: Likewise. (cherry picked from commit b76cd1e)
TARGET_AIX is defined to a non-zero value on linux and maybe other powerpc64le targets. This leads to unexpected behavior such as dropping the .go_export section when linking a shared library on linux/powerpc64le. Instead, use TARGET_AIX_OS to toggle AIX specific behavior. Fixes golang/go#60798. 2023-06-22 Paul E. Murphy <murphyp@linux.ibm.com> gcc/go/ * go-backend.cc [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS. * go-lang.cc: Likewise. (cherry picked from commit b76cd1e)
TARGET_AIX is defined to a non-zero value on linux and maybe other powerpc64le targets. This leads to unexpected behavior such as dropping the .go_export section when linking a shared library on linux/powerpc64le. Instead, use TARGET_AIX_OS to toggle AIX specific behavior. Fixes golang/go#60798. 2023-06-22 Paul E. Murphy <murphyp@linux.ibm.com> gcc/go/ * go-backend.c [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS. * go-lang.c: Likewise. (cherry picked from commit b76cd1e)
TARGET_AIX is defined to a non-zero value on linux and maybe other powerpc64le targets. This leads to unexpected behavior such as dropping the .go_export section when linking a shared library on linux/powerpc64le. Instead, use TARGET_AIX_OS to toggle AIX specific behavior. Fixes golang/go#60798. 2023-06-22 Paul E. Murphy <murphyp@linux.ibm.com> gcc/go/ * go-backend.c [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS. * go-lang.c: Likewise. (cherry picked from commit b76cd1e)
TARGET_AIX is defined to a non-zero value on linux and maybe other powerpc64le targets. This leads to unexpected behavior such as dropping the .go_export section when linking a shared library on linux/powerpc64le. Instead, use TARGET_AIX_OS to toggle AIX specific behavior. Fixes golang/go#60798. 2023-06-22 Paul E. Murphy <murphyp@linux.ibm.com> gcc/go/ * go-backend.cc [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS. * go-lang.cc: Likewise.
What version of Go are you using (
go version
)?I have observed this using the fedora 36 system gcc and gccgo. It also happens using IBM's advance-toolchain 15 and newer.
What did you do?
cmd/go crashes because it assumes
.go_export
section is present within the shared library built by gccgo, but it is missing.The text was updated successfully, but these errors were encountered: