]> code.ossystems Code Review - openembedded-core.git/commitdiff
go: Enable CGO and pie buildmode on rv64
authorKhem Raj <raj.khem@gmail.com>
Wed, 24 Feb 2021 04:13:19 +0000 (20:13 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 26 Feb 2021 15:16:56 +0000 (15:16 +0000)
go1.16 has added CGO support for riscv64 arch

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/go.bbclass
meta/recipes-devtools/go/go-runtime_1.16.bb
meta/recipes-devtools/go/go_1.16.bb

index fa147892b0aaaa445c9e48e9fa326ea5c58c026e..77ec98dd51ce6d5f68bde57fa1e2eeca08ee0fa5 100644 (file)
@@ -54,7 +54,6 @@ GOTOOLDIR_class-native = "${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOTOOLDIR
 
 export CGO_ENABLED ?= "1"
-export CGO_ENABLED_riscv64 = "0"
 export CGO_CFLAGS ?= "${CFLAGS}"
 export CGO_CPPFLAGS ?= "${CPPFLAGS}"
 export CGO_CXXFLAGS ?= "${CXXFLAGS}"
@@ -147,10 +146,10 @@ FILES_${PN}-staticdev = "${libdir}/go/pkg"
 INSANE_SKIP_${PN} += "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
+# doesn't support -buildmode=pie, so skip the QA checking for mips/rv32 and its
 # variants.
 python() {
-    if 'mips' in d.getVar('TARGET_ARCH') or 'riscv' in d.getVar('TARGET_ARCH'):
+    if 'mips' in d.getVar('TARGET_ARCH') or 'riscv32' in d.getVar('TARGET_ARCH'):
         d.appendVar('INSANE_SKIP_%s' % d.getVar('PN'), " textrel")
     else:
         d.appendVar('GOBUILDFLAGS', ' -buildmode=pie')
index d6ddb31ed4d65072b587c1ca7978bb56b3414e39..63464a15014af089c21a12bacd8cf7df4be7ed0d 100644 (file)
@@ -1,4 +1,3 @@
-export CGO_ENABLED_riscv64 = ""
 require go-${PV}.inc
 require go-runtime.inc
 
index d4812c0f0a0fdfe73b3b3cda4f3b3f5d7dbc593f..4e9e0ebec83825e189eaa5abc10982db69a0442d 100644 (file)
@@ -4,15 +4,14 @@ require go-target.inc
 inherit linuxloader
 
 export GOBUILDMODE=""
-export CGO_ENABLED_riscv64 = ""
 export GO_LDSO = "${@get_linuxloader(d)}"
 export CC_FOR_TARGET = "gcc"
 export CXX_FOR_TARGET = "g++"
 
-# mips/rv64 doesn't support -buildmode=pie, so skip the QA checking for mips/riscv and its
+# mips/rv64 doesn't support -buildmode=pie, so skip the QA checking for mips/riscv32 and its
 # variants.
 python() {
-    if 'mips' in d.getVar('TARGET_ARCH',True) or 'riscv' in d.getVar('TARGET_ARCH',True):
+    if 'mips' in d.getVar('TARGET_ARCH',True) or 'riscv32' in d.getVar('TARGET_ARCH',True):
         d.appendVar('INSANE_SKIP_%s' % d.getVar('PN',True), " textrel")
 }