[PATCH 2/5] oci-runtime-tools: adjust inherit and fix CGO settings


Chen Qi
 

go.bbclass already inherits goarch.bbclass.

The CGO_CFLAGS and CGO_LDFLAGS should use target flags as set in
oe-core's go.bbclass, not the SDK related ones.

Signed-off-by: Chen Qi <Qi.Chen@...>
---
.../oci-runtime-tools/oci-runtime-tools_git.bb | 5 -----
1 file changed, 5 deletions(-)

diff --git a/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb b/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
index 838d24b..b953ab4 100644
--- a/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
+++ b/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
@@ -13,12 +13,9 @@ GO_IMPORT = "import"

INSANE_SKIP:${PN} += "ldflags textrel"

-inherit goarch
inherit go

do_compile() {
- export GOARCH="${TARGET_GOARCH}"
- export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
export GOPATH="${S}/src/import:${S}/src/import/vendor"

# Pass the needed cflags/ldflags so that cgo
@@ -26,8 +23,6 @@ do_compile() {
export CGO_ENABLED="1"
export CFLAGS=""
export LDFLAGS=""
- export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
- export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export GO111MODULE=off

# fixes:
--
2.36.0


Bruce Ashfield
 

On Fri, Jun 10, 2022 at 5:45 AM Chen Qi <Qi.Chen@...> wrote:

go.bbclass already inherits goarch.bbclass.

The CGO_CFLAGS and CGO_LDFLAGS should use target flags as set in
oe-core's go.bbclass, not the SDK related ones.
While that may be true, I've had significant issues with the go
bbclass in the past, so I'm going to keep all of the explicit flag
setting.

Feel free to send adjustments to the flags, but I won't be dropping them.

Bruce


Signed-off-by: Chen Qi <Qi.Chen@...>
---
.../oci-runtime-tools/oci-runtime-tools_git.bb | 5 -----
1 file changed, 5 deletions(-)

diff --git a/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb b/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
index 838d24b..b953ab4 100644
--- a/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
+++ b/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
@@ -13,12 +13,9 @@ GO_IMPORT = "import"

INSANE_SKIP:${PN} += "ldflags textrel"

-inherit goarch
inherit go

do_compile() {
- export GOARCH="${TARGET_GOARCH}"
- export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
export GOPATH="${S}/src/import:${S}/src/import/vendor"

# Pass the needed cflags/ldflags so that cgo
@@ -26,8 +23,6 @@ do_compile() {
export CGO_ENABLED="1"
export CFLAGS=""
export LDFLAGS=""
- export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
- export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export GO111MODULE=off

# fixes:
--
2.36.0




--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II