Signed-off-by: Alexander Kanavin <a...@linutronix.de> --- meta/recipes-devtools/go/go-1.19.inc | 1 + .../go/go/stack-protector.patch | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-devtools/go/go/stack-protector.patch
diff --git a/meta/recipes-devtools/go/go-1.19.inc b/meta/recipes-devtools/go/go-1.19.inc index 3bccfcbecf..f733a807b4 100644 --- a/meta/recipes-devtools/go/go-1.19.inc +++ b/meta/recipes-devtools/go/go-1.19.inc @@ -14,5 +14,6 @@ SRC_URI += "\ file://0001-exec.go-do-not-write-linker-flags-into-buildids.patch \ file://0001-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \ file://filter-build-paths.patch \ + file://stack-protector.patch \ " SRC_URI[main.sha256sum] = "9419cc70dc5a2523f29a77053cafff658ed21ef3561d9b6b020280ebceab28b9" diff --git a/meta/recipes-devtools/go/go/stack-protector.patch b/meta/recipes-devtools/go/go/stack-protector.patch new file mode 100644 index 0000000000..cc92a444a7 --- /dev/null +++ b/meta/recipes-devtools/go/go/stack-protector.patch @@ -0,0 +1,32 @@ +From c537b87782293fe222f2ef5eb1ae818092118e97 Mon Sep 17 00:00:00 2001 +From: Ian Lance Taylor <i...@golang.org> +Date: Sun, 07 Aug 2022 19:21:15 -0700 +Subject: [PATCH] runtime/cgo: add -fno-stack-protector to CFLAGS + +Some compilers default to having -fstack-protector on, which breaks +when using internal linking because the linker doesn't know how to +find the support functions. + +Fixes #52919 +Fixes #54313 + +Change-Id: I6f51d5e906503f61fc768ad8e30c163bad135087 +Upstream-Status: Submitted [https://github.com/golang/go/issues/54313] +Signed-off-by: Alexander Kanavin <alex.kana...@gmail.com> +--- + +diff --git a/src/runtime/cgo/cgo.go b/src/runtime/cgo/cgo.go +index 298aa63..4b7046e 100644 +--- a/src/runtime/cgo/cgo.go ++++ b/src/runtime/cgo/cgo.go +@@ -23,7 +23,9 @@ + #cgo solaris LDFLAGS: -lxnet + #cgo solaris LDFLAGS: -lsocket + +-#cgo CFLAGS: -Wall -Werror ++// We use -fno-stack-protector because internal linking won't find ++// the support functions. See issues #52919 and #54313. ++#cgo CFLAGS: -Wall -Werror -fno-stack-protector + + #cgo solaris CPPFLAGS: -D_POSIX_PTHREAD_SEMANTICS + -- 2.30.2
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#169018): https://lists.openembedded.org/g/openembedded-core/message/169018 Mute This Topic: https://lists.openembedded.org/mt/92886969/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-