From bf9ec668d562893d2aac4ae047b47bdb72082741 Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 5 Jan 2023 18:30:43 +0000 Subject: [PATCH] lang/go: work around xonly issue on arm64 and presumably riscv64 by passing -Wl,--no-execute-only. The underlying issue has not yet been identified, but there's quite a bit of breakage in all non-trivial Go programs that I tested. with help of jsing, "i think you should commit this" deraadt --- lang/go/Makefile | 2 +- lang/go/patches/patch-src_cmd_link_internal_ld_lib_go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lang/go/Makefile b/lang/go/Makefile index 4c2434d017f..4d84dc96a3d 100644 --- a/lang/go/Makefile +++ b/lang/go/Makefile @@ -9,7 +9,7 @@ VERSION = 1.19.4 DISTNAME = go${VERSION}.src PKGNAME = go-${VERSION} PKGSPEC = ${FULLPKGNAME:S/go-/go-=/} -REVISION = 0 +REVISION = 1 CATEGORIES = lang diff --git a/lang/go/patches/patch-src_cmd_link_internal_ld_lib_go b/lang/go/patches/patch-src_cmd_link_internal_ld_lib_go index 2bdecd23a71..6855637a04f 100644 --- a/lang/go/patches/patch-src_cmd_link_internal_ld_lib_go +++ b/lang/go/patches/patch-src_cmd_link_internal_ld_lib_go @@ -22,3 +22,11 @@ Index: src/cmd/link/internal/ld/lib.go GenSymsLate func(*Link, *loader.Loader) // TLSIEtoLE converts a TLS Initial Executable relocation to +@@ -1339,6 +1342,7 @@ func (ctxt *Link) hostlink() { + } + case objabi.Hopenbsd: + argv = append(argv, "-Wl,-nopie") ++ argv = append(argv, "-Wl,--no-execute-only") + argv = append(argv, "-pthread") + case objabi.Hwindows: + if windowsgui {