Skip to contentSkip to conversation

goarch: Remove target specific dependencies

PATCH New Khem Raj 1 participant 2 messages Dec 13, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 goarch: Remove target specific dependencies

goarch is used in all classes of recipes ranging from native to target, therefore its best to contain the variables and not spill over into recipe classes where they can adversely affect shared state reuse e.g. go-native currently gets TUNE_FEATURES into dependency chain of referenced variables which means go-native gets rebuilt when we change from qemuarm to qemux86 machine types since TUNE_FEATURES is defined with DEFAULTTUNE which would change as machines are switched

These variables are specific to arm/mips/x86 so marking them with appropriate overrides for native recipes will be right thing here

Chose 'hardfloat' for mips which is default too, 7 for arm and sse2 for x86 somehow go-native bootstrap compiler (1.4) still needs them so feed commonly used values or defaults.

Fixes
ERROR: go-native different signature for task do_configure.sigdata between qemux86copy and qemuarm
...
List of dependencies for variable TUNE_FEATURES changed from '{'DEFAULTTUNE', 'TUNE_FEATURES_tune-core2-32'}' to '{'DEFAULTTUNE', 'TUNE_FEATURES_tune-armv7vethf-neon'}' changed items: {'TUNE_FEATURES_tune-core2-32', 'TUNE_FEATURES_tune-armv7vethf-neon'}

---
 meta/classes/goarch.bbclass | 6 ++++++
 1 file changed, 6 insertions(+)
meta/classes/goarch.bbclass +6 -0
index 166dea9dc6..1147b6d233 100644
@@ -6,12 +6,18 @@ HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}"
 HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), d)}"
 HOST_GO386 = "${@go_map_386(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
 HOST_GOMIPS = "${@go_map_mips(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+HOST_GOARM_class-native = "7"
+HOST_GO386_class-native = "sse2"
+HOST_GOMIPS_class-native = "hardfloat"
 HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
 TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}"
 TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}"
 TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), d)}"
 TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
 TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+TARGET_GOARM_class-native = "7"
+TARGET_GO386_class-native = "sse2"
+TARGET_GOMIPS_class-native = "hardfloat"
 TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
 GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}"
 
Signature · 1 line
2.24.1
author
#1 lore raw

PATCH 2/2 Revert "go: Reset unneeded GOARCH variables for native recipe"

This reverts commit 4825eede606b075d0d529b38d6162999f1dec506.

---
 meta/recipes-devtools/go/go-common.inc | 10 ----------
 1 file changed, 10 deletions(-)
meta/recipes-devtools/go/go-common.inc +0 -10
index aa2482d356..f18d928c70 100644
@@ -37,16 +37,6 @@ export GO386 ?= "${TARGET_GO386}"
 export GOMIPS ?= "${TARGET_GOMIPS}"
 export GOROOT_FINAL ?= "${libdir}/go"
 
-GOEXPORTVARS = "1"
-GOEXPORTVARS_class-native = "0"
-
-GOARM[export] = "${GOEXPORTVARS}"
-GO386[export] = "${GOEXPORTVARS}"
-GOMIPS[export] = "${GOEXPORTVARS}"
-HOST_GOARM[export] = "${GOEXPORTVARS}"
-HOST_GO386[export] = "${GOEXPORTVARS}"
-HOST_GOMIPS[export] = "${GOEXPORTVARS}"
-
 do_compile_prepend() {
 	BUILD_CC=${BUILD_CC}
 }
Signature · 1 line
2.24.1