summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-09-29 15:58:35 +0800
committerRobert Yang <liezhi.yang@windriver.com>2018-09-29 17:44:04 +0800
commit5262fed3fddeaa7b919a85237c2d76e9c8116260 (patch)
treec17c6f204b0ac0628226aa3eea0888990ba81424
parent4dad1568f8f84ec9de4bf7235822f77a8ee6a413 (diff)
downloadopenembedded-core-contrib-rbt/go.tar.gz
openembedded-core-contrib-rbt/go.tar.bz2
openembedded-core-contrib-rbt/go.zip
go.bbclass: Add -buildmode=pie for non mips archrbt/go
Fixed QA issue like: WARNING: runc-docker do_package_qa: QA Issue: ELF binary '/path/to/runc-docker/usr/bin/runc' has relocations in .text [textrel] Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rw-r--r--meta/classes/go.bbclass10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index d33d83ea7f..167d02e3fa 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -179,3 +179,13 @@ FILES_${PN}-staticdev = "${libdir}/go/pkg"
INSANE_SKIP_${PN} += "ldflags"
INSANE_SKIP_${PN}-ptest += "ldflags"
+
+# Add -buildmode=pie to GOBUILDFLAGS 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.appendVar('GOBUILDFLAGS', ' -buildmode=pie')
+}