Skip to content

Commit

Permalink
lang/go: reinstate nobtcfi patch
Browse files Browse the repository at this point in the history
This was dropped in the update with the consequence that binaries using
external linking weren't correctly marked, causing breakage of some go
ports on BTI enabled machines.

Reported by Isaac Merleo, tested by sthen and rsadowski
ok jsing sthen
  • Loading branch information
botovq committed Feb 21, 2024
1 parent 2a5c71c commit 71f21f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lang/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ VERSION = 1.22.0
DISTNAME = go${VERSION}.src
PKGNAME = go-${VERSION}
PKGSPEC = ${FULLPKGNAME:S/go-/go-=/}
REVISION = 0

CATEGORIES = lang

Expand Down
11 changes: 11 additions & 0 deletions lang/go/patches/patch-src_cmd_link_internal_ld_lib_go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Index: src/cmd/link/internal/ld/lib.go
--- src/cmd/link/internal/ld/lib.go.orig
+++ src/cmd/link/internal/ld/lib.go
@@ -1441,6 +1441,7 @@ func (ctxt *Link) hostlink() {
}
case objabi.Hopenbsd:
argv = append(argv, "-Wl,-nopie")
+ argv = append(argv, "-Wl,-z,nobtcfi")
argv = append(argv, "-pthread")
if ctxt.Arch.InFamily(sys.ARM64) {
// Disable execute-only on openbsd/arm64 - the Go arm64 assembler

0 comments on commit 71f21f5

Please sign in to comment.