Skip to contentSkip to conversation

go: allow recipes to override the build mode for golang

PATCH New brendank310 1 participant 1 message Oct 28, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 go: allow recipes to override the build mode for golang

From: Brendan Kerrigan <[email protected]>

---
 meta/classes/go.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/go.bbclass +2 -1
index 167d02e3fa..6cf93c14aa 100644
@@ -28,6 +28,7 @@ export GOPATH_OMIT_IN_ACTIONID ?= "1"
 export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
 export GOPTESTFLAGS ?= ""
 GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
+GOBUILDMODE ?= "pie"
 
 export GO = "${HOST_PREFIX}go"
 GOTOOLDIR = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
@@ -187,5 +188,5 @@ python() {
     if 'mips' in d.getVar('TARGET_ARCH'):
         d.appendVar('INSANE_SKIP_%s' % d.getVar('PN'), " textrel")
     else:
-        d.appendVar('GOBUILDFLAGS', ' -buildmode=pie')
+        d.appendVar('GOBUILDFLAGS', ' -buildmode=%s' % d.getVar('GOBUILDMODE'))
 }
Signature · 1 line
2.17.1