]> code.ossystems Code Review - openembedded-core.git/commitdiff
go.bbclass: Add -buildmode=pie for non mips arch
authorRobert Yang <liezhi.yang@windriver.com>
Sat, 29 Sep 2018 09:44:46 +0000 (17:44 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 1 Oct 2018 12:04:44 +0000 (13:04 +0100)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/go.bbclass

index d33d83ea7f1a9da1e0fe8bec87b9c26d1746f51f..167d02e3fa3443b0e33ad03e062361747200b385 100644 (file)
@@ -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')
+}