Skip to contentSkip to conversation

go.bbclass: Add -buildmode=pie for non mips arch

PATCH New Robert Yang 1 participant 2 messages Sep 29, 2018

lore
Share & tools
lore
#0 lore raw

cover go.bbclass: Add -buildmode=pie for non mips arch

The following changes since commit 4dad1568f8f84ec9de4bf7235822f77a8ee6a413:

glibc-package.inc: correct intention for deleting /usr/lib as needed (2018-09-27 23:39:28 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/go
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/go

Robert Yang (1):
go.bbclass: Add -buildmode=pie for non mips arch

 meta/classes/go.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 go.bbclass: Add -buildmode=pie for non mips arch

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]

---
 meta/classes/go.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/classes/go.bbclass +10 -0
index d33d83e..167d02e 100644
@@ -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')
+}
Signature · 1 line
2.7.4