aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools/go/go-build_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/go/go-build_git.bb')
-rw-r--r--recipes-devtools/go/go-build_git.bb18
1 files changed, 16 insertions, 2 deletions
diff --git a/recipes-devtools/go/go-build_git.bb b/recipes-devtools/go/go-build_git.bb
index e057b6d7..3ac86084 100644
--- a/recipes-devtools/go/go-build_git.bb
+++ b/recipes-devtools/go/go-build_git.bb
@@ -8,6 +8,7 @@ SRCREV_runc = "e4363b038787addfa12e8b0acf5417d4fba01693"
SRC_URI = "\
git://github.com/lf-edge/runx;nobranch=1;name=runx \
git://github.com/opencontainers/runc.git;nobranch=1;destsuffix=runc;name=runc \
+ file://0001-build-use-instead-of-go.patch \
"
SRC_URI[md5sum] = "0d701ac1e2a67d47ce7127432df2c32b"
SRC_URI[sha256sum] = "5a26478906d5005f4f809402e981518d2b8844949199f60c4b6e1f986ca2a769"
@@ -34,9 +35,22 @@ do_compile() {
export GOARCH="${TARGET_GOARCH}"
cd ${S}/src/import/gobuild
mkdir -p go/src/github.com/opencontainers
- ln -s ${WORKDIR}/runc ${S}/src/import/gobuild/go/src/github.com/opencontainers/runc
+ ln -sf ${WORKDIR}/runc ${S}/src/import/gobuild/go/src/github.com/opencontainers/runc
export GOPATH="${S}/src/import/gobuild/go/src/github.com/opencontainers/runc"
- oe_runmake
+
+ # Build the target binaries
+ export GOARCH="${TARGET_GOARCH}"
+ # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries
+ export CGO_ENABLED="1"
+ export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+ export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+ export CFLAGS=""
+ export LDFLAGS=""
+ export CC="${CC}"
+ export LD="${LD}"
+ export GOBIN=""
+
+ oe_runmake GO=${GO}
}
do_install() {