]> code.ossystems Code Review - openembedded-core.git/commitdiff
go: disable PIE flags for cgo
authorMatt Madison <matt@madison.systems>
Sat, 23 Sep 2017 00:58:21 +0000 (17:58 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 25 Sep 2017 13:17:42 +0000 (14:17 +0100)
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@madison.systems>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/go.bbclass
meta/recipes-devtools/go/go-target.inc

index e167c949ecedfda2ab750350b349691d8cf971d3..09b01a84c37d93e5bec1a94a2653b8fe45f79673 100644 (file)
@@ -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}"
index b88d0166e5bbfce9b539c1bd88c03cf753ff41c0..6065c3c80d650296c44e97aa2f4c584410afd99d 100644 (file)
@@ -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() {