Files
poky/meta/recipes-devtools/go/go_1.9.bb
Hongxu Jia 88ac8e5334 go 1.9/1.11: fix textrel qa warning for non mips arch
While building go itself, the go build system does not support
to set `-buildmode=pie' from environment.

Add GOBUILDMODE to support it which make PIE executables the default
build mode, as PIE executables are required as of Yocto

But mips doesn't support -buildmode=pie, so skip the QA checking for
mips and its variants

(From OE-Core rev: d11cb2ea0abfca4a5958ff4647f22a5b203113e5)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-14 11:14:39 +00:00

29 lines
635 B
BlitzBasic

require go-${PV}.inc
require go-target.inc
export GO_TARGET_INSTALL = "cmd"
export GO_FLAGS = "-a"
export CC_FOR_TARGET = "${CC}"
export CXX_FOR_TARGET = "${CXX}"
export GOBUILDMODE=""
do_compile() {
export GOBIN="${B}/bin"
export TMPDIR="$GOTMPDIR"
export CC=$BUILD_CC
cd src
./make.bash
cd ${B}
}
# Add pie to GOBUILDMODE to satisfy "textrel" QA checking, but mips
# doesn't support -buildmode=pie, so skip the QA checking for mips and its
# variants.
python() {
if 'mips' in d.getVar('TARGET_ARCH'):
d.appendVar('INSANE_SKIP_%s' % d.getVar('PN'), " textrel")
else:
d.setVar('GOBUILDMODE', 'pie')
}