mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-19 12:50:22 +02:00

Drop obsolete patches and forward-port the remaining required patch. We also need to fix up permissions after the build so that we can clean the build directory without errors if needed. Signed-off-by: Paul Barker <paul@betafive.co.uk> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
59 lines
2.0 KiB
Diff
59 lines
2.0 KiB
Diff
From fa402247e9b24470648a366cfda1c9134660146a Mon Sep 17 00:00:00 2001
|
|
From: Mark Asselstine <mark.asselstine@windriver.com>
|
|
Date: Mon, 18 Mar 2019 14:04:16 -0400
|
|
Subject: [PATCH] Makefile: force rebuilding all packages to avoid cgo
|
|
|
|
We are running into an issue when attempting to build 'static',
|
|
similar to what is described by
|
|
|
|
https://plus.google.com/117192131596509381660/posts/eNnNePihYnK
|
|
and
|
|
https://github.com/golang/go/issues/9369
|
|
|
|
In our case we can see that it manifests as a build error
|
|
|
|
cannot find package runtime/cgo (using -importcfg)
|
|
...go/pkg/tool/linux_amd64/link: cannot open file : open : no such file or directory
|
|
|
|
Although the descriptions of issue indicate that newer versions of GO,
|
|
such as the version we are using, should not have this issue it is
|
|
clear from the error that cgo is being referenced when it should be
|
|
out of the picture.
|
|
|
|
Interesting enough this issue only manifests when we are building on
|
|
x86-64 and building for x86-64 which might indicate that GO might be
|
|
finding -native packages and not -cross packages.
|
|
|
|
This change works around the issue and will allow for the building of
|
|
the 'static' make target, but at this time and until the issue is
|
|
completely understood, it is recommended that the 'build' target is
|
|
used.
|
|
|
|
Upstream-Status: Inappropriate [only an issue with our builds]
|
|
|
|
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
|
|
|
|
Forward-ported to v0.5.3.
|
|
|
|
Signed-off-by: Paul Barker <paul@betafive.co.uk>
|
|
---
|
|
basic.mk | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/basic.mk b/basic.mk
|
|
index 187dff3..fb080b7 100644
|
|
--- a/src/import/basic.mk
|
|
+++ b/src/import/basic.mk
|
|
@@ -50,7 +50,7 @@ $(NAME): $(wildcard *.go) $(wildcard */*.go) VERSION.txt
|
|
.PHONY: static
|
|
static: prebuild ## Builds a static executable.
|
|
@echo "+ $@"
|
|
- CGO_ENABLED=$(CGO_ENABLED) $(GO) build \
|
|
+ CGO_ENABLED=$(CGO_ENABLED) $(GO) build -a -pkgdir dontusecurrentpkgs \
|
|
-tags "$(BUILDTAGS) static_build" \
|
|
${GO_LDFLAGS_STATIC} -o $(NAME) .
|
|
|
|
--
|
|
2.17.1
|
|
|