From fb524ca5a228b58c3feb048956c5f0713f6cea45 Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Mon, 18 Mar 2019 14:48:55 -0400 Subject: netns: change build target to 'build' instead of 'static' Attempting to build for x86-64 will result in an error: cannot find package runtime/cgo (using -importcfg) ...go/pkg/tool/linux_amd64/link: cannot open file : open : no such file or directory As a workaround we switch the build target to 'build' which results in a slightly smaller executable but does mean that several dynamic libraries are required to run the generated executable. This shouldn't be a problem as the build system will ensure the libraries are present on images where the executable will be included. This change only means the executable can't be copied as a single entity to a different machine and run. We do also patch the Makefile to allow the 'static' target to build successfully and in the patch commit log we describe the issue in full (at least in as much detail as we currently have on the issue). But since the issue isn't fully understood we don't recommend the 'static' build to be used at this time, thus default to the 'build' target. Signed-off-by: Mark Asselstine Signed-off-by: Bruce Ashfield --- recipes-networking/netns/netns_git.bb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'recipes-networking/netns/netns_git.bb') diff --git a/recipes-networking/netns/netns_git.bb b/recipes-networking/netns/netns_git.bb index b6d35948..f5cdace0 100644 --- a/recipes-networking/netns/netns_git.bb +++ b/recipes-networking/netns/netns_git.bb @@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=48ef0979a2bcc3fae14ff30b8a7f5d SRC_URI = "git://github.com/genuinetools/netns;branch=master \ file://0001-Allow-selection-of-go-compiler.patch \ + file://Makefile-force-rebuilding-all-packages-to-avoid-cgo.patch \ " SRCREV = "0da6ab0997707024debe68c91e940c9168041bf8" PV = "0.4.0" @@ -42,7 +43,9 @@ do_compile() { export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" cd ${S}/src/import - oe_runmake static + # Static builds work but are not recommended. See Makefile*cgo patch. + #oe_runmake static + oe_runmake build } do_install() { -- cgit v1.2.3-54-g00ecf