summaryrefslogtreecommitdiff
path: root/libgo/Makefile.in
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2020-10-07 15:47:45 +0200
committerIan Lance Taylor <iant@golang.org>2020-10-13 17:54:37 -0700
commit72b38338228b3e90879828c0bb059603f683d98b (patch)
tree153cc65f70946620a982b9c61a2971e164e599e2 /libgo/Makefile.in
parentbdd74cc20ca22dd4aa19938d0494fcdd37cc0418 (diff)
downloadgcc-72b38338228b3e90879828c0bb059603f683d98b.tar.gz
reflect: ensure uniqueness of type descriptors on AIX.
On AIX, duplication of type descriptors can occur if one is declared in the libgo and one in the Go program being compiled. The AIX linker isn't able to merge them together as Linux one does. One solution is to always load libgo first but that needs a huge mechanism in gcc core. Thus, this patch ensures that the duplication isn't visible for the end user. In reflect and internal/reflectlite, the comparison of rtypes is made on their name and not only on their addresses. In reflect, toType() function is using a canonicalization map to force rtypes having the same rtype.String() to return the same Type. This can't be made in internal/reflectlite as it needs sync package. But, for now, it doesn't matter as internal/reflectlite is not widely used. Fixes golang/go#39276 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/260158
Diffstat (limited to 'libgo/Makefile.in')
-rw-r--r--libgo/Makefile.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/Makefile.in b/libgo/Makefile.in
index 18b1a06be41..59a7083f614 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -1114,6 +1114,10 @@ runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
# Also use -fno-inline to get better results from the memory profiler.
runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
+# reflect tests must be done with -static-libgo. Otherwize,
+# there will be a duplication of the canonicalization map.
+@LIBGO_IS_AIX_TRUE@reflect_check_GOCFLAGS = -static-libgo -Wl,-bbigtoc
+
# Use -static for the syscall tests if possible, because otherwise when
# running as root the re-execs ignore LD_LIBRARY_PATH.
@HAVE_STATIC_LINK_TRUE@syscall_check_GOCFLAGS = -static