mirror of
https://git.yoctoproject.org/poky
synced 2026-03-17 04:39:40 +01:00
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>
29 lines
635 B
BlitzBasic
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')
|
|
}
|