From ab2d47a87fe8a0989c766a0082f4598d9bf6143d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 19 Sep 2019 00:03:25 +0000 Subject: libgo: support gollvm build on arm64 linux This CL serves as part of an initial change for enabling gollvm building on arm64 linux, the rest of the change will be covered by another one to the gollvm repo. Incorporate type definition of 'uint128' to 'runtime' and 'syscall' packges, the change is not specific to arm64 linux but made available for all platforms. Verified by building and unit-testing gollvm on linux x86-64 and arm64. Verified by building and checking gccgo on linux x86-64 and arm64. Fixes golang/go#33711 Change-Id: I4720c7d810cfd4ef720962fb4104c5641b2459c0 From-SVN: r275919 --- libgo/mkrsysinfo.sh | 6 ++++++ libgo/mksysinfo.sh | 6 ++++++ libgo/sysinfo.c | 4 ++++ 3 files changed, 16 insertions(+) (limited to 'libgo') diff --git a/libgo/mkrsysinfo.sh b/libgo/mkrsysinfo.sh index 0a5e29e..c28f0e5 100755 --- a/libgo/mkrsysinfo.sh +++ b/libgo/mkrsysinfo.sh @@ -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 diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh index d616bd8..488b223 100755 --- a/libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh @@ -1393,4 +1393,10 @@ grep '^type _mactun_info_t ' gen-sysinfo.go | \ 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 $? diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c index 4ab798c..0692fd4 100644 --- a/libgo/sysinfo.c +++ b/libgo/sysinfo.c @@ -424,7 +424,11 @@ EREF(MNT_FORCE); #if defined(HAVE_SYS_PTRACE_H) // From +#if defined (__aarch64__) +SREF(user_pt_regs); +#else SREF(pt_regs); +#endif EREF(PTRACE_PEEKTEXT); #endif -- cgit v1.1 From b7c41230322051912d979e132c52100158745b73 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 2 Oct 2019 20:11:35 +0000 Subject: runtime: mark go-context.S as no-executable-stack and split-stack supported The .note.GNU-stack section tells the linker that this object does not require an executable stack. The .note.GNU-split-stack section tells the linker that functions in this object can be called directly by split-stack functions, without require a large stack. The .note.GNU-no-split-stack section tells the linker that functions in this object do not have a split-stack prologue. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/198440 From-SVN: r276488 --- libgo/runtime/go-context.S | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libgo') diff --git a/libgo/runtime/go-context.S b/libgo/runtime/go-context.S index 8beeebf..170bced 100644 --- a/libgo/runtime/go-context.S +++ b/libgo/runtime/go-context.S @@ -66,4 +66,8 @@ __go_makecontext: ret + .section .note.GNU-stack,"",@progbits + .section .note.GNU-split-stack,"",@progbits + .section .note.GNU-no-split-stack,"",@progbits + #endif -- cgit v1.1