[oe-commits] [openembedded-core] 02/08: go: disable PIE flags for cgo
git at git.openembedded.org
git at git.openembedded.org
Mon Sep 25 13:19:49 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 5d84042852380fc88b9be8df0e4eeac612c2a6da
Author: Matt Madison <matt at madison.systems>
AuthorDate: Fri Sep 22 17:58:21 2017 -0700
go: disable PIE flags for cgo
If the security_flags.inc file is included, gcc
will do PIE builds by default. These flags need
to be disabled for go packages that use cgo.
Signed-off-by: Matt Madison <matt at madison.systems>
Signed-off-by: Khem Raj <raj.khem at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/go.bbclass | 3 +++
meta/recipes-devtools/go/go-target.inc | 3 +++
2 files changed, 6 insertions(+)
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index e167c94..09b01a8 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -50,6 +50,9 @@ GOTOOLDIR = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go/pkg/tool/${BUILD_GOTUPLE}
GOTOOLDIR_class-native = "${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}"
export GOTOOLDIR
+SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_LDFLAGS = ""
+
export CGO_ENABLED ?= "1"
export CGO_CFLAGS ?= "${CFLAGS}"
export CGO_CPPFLAGS ?= "${CPPFLAGS}"
diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc
index b88d016..6065c3c 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -18,6 +18,9 @@ GO_LDFLAGS = ""
GO_LDFLAGS_class-nativesdk = "-linkmode external"
export GO_LDFLAGS
+SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_LDFLAGS = ""
+
do_configure[noexec] = "1"
do_compile() {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list