This libgo patch by Xiangdong JI is for the GoLLVM build on arm64
GNU/Linux.  It incorporates a type definition of 'uint128' to
'runtime' and 'syscall' packages.  This fixes
https://golang.org/issue/33711.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 275814)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-09ca3c1ea8a52b5d3d6c4331c59d44e0b6bfab57
+d81ff42c367cce2110ccf5ddbadb6cc9bdf94e28
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/mkrsysinfo.sh
===================================================================
--- libgo/mkrsysinfo.sh (revision 275698)
+++ libgo/mkrsysinfo.sh (working copy)
@@ -209,3 +209,9 @@ grep '^type _kevent ' gen-sysinfo.go | \
     sed -e s'/_kevent/keventt/' \
       -e 's/ udata [^;}]*/ udata *byte/' \
     >> ${OUT}
+
+# Type 'uint128' is needed in a couple of type definitions on arm64,such
+# as _user_fpsimd_struct, _elf_fpregset_t, etc.
+if ! grep '^type uint128' ${OUT} > /dev/null 2>&1; then
+    echo "type uint128 [16]byte" >> ${OUT}
+fi
Index: libgo/mksysinfo.sh
===================================================================
--- libgo/mksysinfo.sh  (revision 275698)
+++ libgo/mksysinfo.sh  (working copy)
@@ -1393,4 +1393,10 @@ grep '^type _mactun_info_t ' gen-sysinfo
     sed -e 's/_in6_addr_t/[16]byte/g' \
     >> ${OUT}
 
+# Type 'uint128' is needed in a couple of type definitions on arm64,such
+# as _user_fpsimd_struct, _elf_fpregset_t, etc.
+if ! grep '^type uint128' ${OUT} > /dev/null 2>&1; then
+    echo "type uint128 [16]byte" >> ${OUT}
+fi
+
 exit $?
Index: libgo/sysinfo.c
===================================================================
--- libgo/sysinfo.c     (revision 275698)
+++ libgo/sysinfo.c     (working copy)
@@ -424,7 +424,11 @@ EREF(MNT_FORCE);
 
 #if defined(HAVE_SYS_PTRACE_H)
 // From <sys/ptrace.h>
+#if defined (__aarch64__)
+SREF(user_pt_regs);
+#else
 SREF(pt_regs);
+#endif
 EREF(PTRACE_PEEKTEXT);
 #endif
 

Reply via email to