Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Khem Raj" <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH v2 2/3] go: Enable CGO and pie buildmode on rv64
Date: Tue, 23 Feb 2021 20:13:19 -0800	[thread overview]
Message-ID: <20210224041320.3968776-2-raj.khem@gmail.com> (raw)
In-Reply-To: <20210224041320.3968776-1-raj.khem@gmail.com>

go1.16 has added CGO support for riscv64 arch

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/go.bbclass                     | 5 ++---
 meta/recipes-devtools/go/go-runtime_1.16.bb | 1 -
 meta/recipes-devtools/go/go_1.16.bb         | 5 ++---
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index fa147892b0..77ec98dd51 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -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')
diff --git a/meta/recipes-devtools/go/go-runtime_1.16.bb b/meta/recipes-devtools/go/go-runtime_1.16.bb
index d6ddb31ed4..63464a1501 100644
--- a/meta/recipes-devtools/go/go-runtime_1.16.bb
+++ b/meta/recipes-devtools/go/go-runtime_1.16.bb
@@ -1,4 +1,3 @@
-export CGO_ENABLED_riscv64 = ""
 require go-${PV}.inc
 require go-runtime.inc
 
diff --git a/meta/recipes-devtools/go/go_1.16.bb b/meta/recipes-devtools/go/go_1.16.bb
index d4812c0f0a..4e9e0ebec8 100644
--- a/meta/recipes-devtools/go/go_1.16.bb
+++ b/meta/recipes-devtools/go/go_1.16.bb
@@ -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")
 }
 
-- 
2.30.1


  reply	other threads:[~2021-02-24  4:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24  4:13 [PATCH v2 1/3] go: Upgrade compiler to 1.16 major release Khem Raj
2021-02-24  4:13 ` Khem Raj [this message]
2021-02-24  4:13 ` [PATCH v2 3/3] go-helloworld: Turn into a go module enabled build Khem Raj
2021-03-02  9:49   ` [OE-core] " Naveen Saini
2021-03-02 12:46     ` Richard Purdie
2021-03-22  3:22     ` Changqing Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210224041320.3968776-2-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox