summaryrefslogtreecommitdiffstats
path: root/external/meta-virtualization/recipes-networking/netns/files
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-virtualization/recipes-networking/netns/files')
-rw-r--r--external/meta-virtualization/recipes-networking/netns/files/0001-Allow-selection-of-go-compiler.patch107
-rw-r--r--external/meta-virtualization/recipes-networking/netns/files/0001-Use-correct-go-cross-compiler.patch77
-rw-r--r--external/meta-virtualization/recipes-networking/netns/files/Makefile-force-rebuilding-all-packages-to-avoid-cgo.patch64
3 files changed, 64 insertions, 184 deletions
diff --git a/external/meta-virtualization/recipes-networking/netns/files/0001-Allow-selection-of-go-compiler.patch b/external/meta-virtualization/recipes-networking/netns/files/0001-Allow-selection-of-go-compiler.patch
deleted file mode 100644
index 84fb9a43..00000000
--- a/external/meta-virtualization/recipes-networking/netns/files/0001-Allow-selection-of-go-compiler.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 6576f228339b7931e05a8e861f085f483817806b Mon Sep 17 00:00:00 2001
-From: Paul Barker <pbarker@toganlabs.com>
-Date: Tue, 8 May 2018 11:01:14 +0000
-Subject: [PATCH] Allow selection of go compiler
-
-By running `make GO=/path/to/go` we can now select the appropriate go compiler
-to use. This also makes it possible to cross compile netns more easily.
-
-Signed-off-by: Paul Barker <pbarker@toganlabs.com>
-Upstream-status: Pending
----
- Makefile | 25 ++++++++++++++-----------
- 1 file changed, 14 insertions(+), 11 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 3a22f3e..476cb9b 100644
---- a/src/import/Makefile
-+++ b/src/import/Makefile
-@@ -23,6 +23,9 @@ CTIMEVAR=-X $(PKG)/version.GITCOMMIT=$(GITCOMMIT) -X $(PKG)/version.VERSION=$(VE
- GO_LDFLAGS=-ldflags "-w $(CTIMEVAR)"
- GO_LDFLAGS_STATIC=-ldflags "-w $(CTIMEVAR) -extldflags -static"
-
-+# Set our default go compiler
-+GO := go
-+
- # List the GOOS and GOARCH to build
- GOOSARCHES = linux/arm linux/arm64 linux/amd64 linux/386
-
-@@ -33,12 +36,12 @@ build: $(NAME) ## Builds a dynamic executable or package
-
- $(NAME): *.go VERSION.txt
- @echo "+ $@"
-- go build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
-+ $(GO) build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
-
- .PHONY: static
- static: ## Builds a static executable
- @echo "+ $@"
-- CGO_ENABLED=0 go build \
-+ CGO_ENABLED=0 $(GO) build \
- -tags "$(BUILDTAGS) static_build" \
- ${GO_LDFLAGS_STATIC} -o $(NAME) .
-
-@@ -55,23 +58,23 @@ lint: ## Verifies `golint` passes
- .PHONY: test
- test: ## Runs the go tests
- @echo "+ $@"
-- @go test -v -tags "$(BUILDTAGS) cgo" $(shell go list ./... | grep -v vendor)
-+ @$(GO) test -v -tags "$(BUILDTAGS) cgo" $(shell $(GO) list ./... | grep -v vendor)
-
- .PHONY: vet
- vet: ## Verifies `go vet` passes
- @echo "+ $@"
-- @go vet $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
-+ @$(GO) vet $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
-
- .PHONY: staticcheck
- staticcheck: ## Verifies `staticcheck` passes
- @echo "+ $@"
-- @staticcheck $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
-+ @staticcheck $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
-
- .PHONY: cover
- cover: ## Runs go test with coverage
- @echo "" > coverage.txt
-- @for d in $(shell go list ./... | grep -v vendor); do \
-- go test -race -coverprofile=profile.out -covermode=atomic "$$d"; \
-+ @for d in $(shell $(GO) list ./... | grep -v vendor); do \
-+ $(GO) test -race -coverprofile=profile.out -covermode=atomic "$$d"; \
- if [ -f profile.out ]; then \
- cat profile.out >> coverage.txt; \
- rm profile.out; \
-@@ -81,11 +84,11 @@ cover: ## Runs go test with coverage
- .PHONY: install
- install: ## Installs the executable or package
- @echo "+ $@"
-- go install -a -tags "$(BUILDTAGS)" ${GO_LDFLAGS} .
-+ $(GO) install -a -tags "$(BUILDTAGS)" ${GO_LDFLAGS} .
-
- define buildpretty
- mkdir -p $(BUILDDIR)/$(1)/$(2);
--GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
-+GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
- -o $(BUILDDIR)/$(1)/$(2)/$(NAME) \
- -a -tags "$(BUILDTAGS) static_build netgo" \
- -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
-@@ -99,7 +102,7 @@ cross: *.go VERSION.txt ## Builds the cross-compiled binaries, creating a clean
- $(foreach GOOSARCH,$(GOOSARCHES), $(call buildpretty,$(subst /,,$(dir $(GOOSARCH))),$(notdir $(GOOSARCH))))
-
- define buildrelease
--GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
-+GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
- -o $(BUILDDIR)/$(NAME)-$(1)-$(2) \
- -a -tags "$(BUILDTAGS) static_build netgo" \
- -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
-@@ -115,7 +118,7 @@ release: *.go VERSION.txt ## Builds the cross-compiled binaries, naming them in
- .PHONY: bump-version
- BUMP := patch
- bump-version: ## Bump the version in the version file. Set BUMP to [ patch | major | minor ]
-- @go get -u github.com/jessfraz/junk/sembump # update sembump tool
-+ @$(GO) get -u github.com/jessfraz/junk/sembump # update sembump tool
- $(eval NEW_VERSION = $(shell sembump --kind $(BUMP) $(VERSION)))
- @echo "Bumping VERSION.txt from $(VERSION) to $(NEW_VERSION)"
- echo $(NEW_VERSION) > VERSION.txt
---
-2.7.4
-
diff --git a/external/meta-virtualization/recipes-networking/netns/files/0001-Use-correct-go-cross-compiler.patch b/external/meta-virtualization/recipes-networking/netns/files/0001-Use-correct-go-cross-compiler.patch
deleted file mode 100644
index ed66e11b..00000000
--- a/external/meta-virtualization/recipes-networking/netns/files/0001-Use-correct-go-cross-compiler.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From d5c319bb61155d94bef2571a095d82983d786b94 Mon Sep 17 00:00:00 2001
-From: Paul Barker <pbarker@toganlabs.com>
-Date: Fri, 13 Oct 2017 17:58:11 +0000
-Subject: [PATCH] Use correct go cross-compiler
-
-Signed-off-by: Paul Barker <pbarker@toganlabs.com>
-Upstream-status: Pending
----
- Makefile | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index cb9a46d..633f884 100644
---- a/src/import/Makefile
-+++ b/src/import/Makefile
-@@ -33,12 +33,12 @@ build: $(NAME) ## Builds a dynamic executable or package
-
- $(NAME): *.go VERSION
- @echo "+ $@"
-- go build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
-+ $(GO) build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
-
- .PHONY: static
- static: ## Builds a static executable
- @echo "+ $@"
-- CGO_ENABLED=0 go build \
-+ CGO_ENABLED=0 $(GO) build \
- -tags "$(BUILDTAGS) static_build" \
- ${GO_LDFLAGS_STATIC} -o $(NAME) .
-
-@@ -55,21 +55,21 @@ lint: ## Verifies `golint` passes
- .PHONY: test
- test: ## Runs the go tests
- @echo "+ $@"
-- @go test -v -tags "$(BUILDTAGS) cgo" $(shell go list ./... | grep -v vendor)
-+ @$(GO) test -v -tags "$(BUILDTAGS) cgo" $(shell $(GO) list ./... | grep -v vendor)
-
- .PHONY: vet
- vet: ## Verifies `go vet` passes
- @echo "+ $@"
-- @go vet $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
-+ @$(GO) vet $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
-
- .PHONY: install
- install: ## Installs the executable or package
- @echo "+ $@"
-- @go install .
-+ @$(GO) install .
-
- define buildpretty
- mkdir -p $(BUILDDIR)/$(1)/$(2);
--GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
-+GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
- -o $(BUILDDIR)/$(1)/$(2)/$(NAME) \
- -a -tags "$(BUILDTAGS) static_build netgo" \
- -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
-@@ -83,7 +83,7 @@ cross: *.go VERSION ## Builds the cross-compiled binaries, creating a clean dire
- $(foreach GOOSARCH,$(GOOSARCHES), $(call buildpretty,$(subst /,,$(dir $(GOOSARCH))),$(notdir $(GOOSARCH))))
-
- define buildrelease
--GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
-+GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
- -o $(BUILDDIR)/$(NAME)-$(1)-$(2) \
- -a -tags "$(BUILDTAGS) static_build netgo" \
- -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
-@@ -99,7 +99,7 @@ release: *.go VERSION ## Builds the cross-compiled binaries, naming them in such
- .PHONY: bump-version
- BUMP := patch
- bump-version: ## Bump the version in the version file. Set KIND to [ patch | major | minor ]
-- @go get -u github.com/jessfraz/junk/sembump # update sembump tool
-+ @$(GO) get -u github.com/jessfraz/junk/sembump # update sembump tool
- $(eval NEW_VERSION = $(shell sembump --kind $(BUMP) $(VERSION)))
- @echo "Bumping VERSION from $(VERSION) to $(NEW_VERSION)"
- echo $(NEW_VERSION) > VERSION
---
-2.7.4
-
diff --git a/external/meta-virtualization/recipes-networking/netns/files/Makefile-force-rebuilding-all-packages-to-avoid-cgo.patch b/external/meta-virtualization/recipes-networking/netns/files/Makefile-force-rebuilding-all-packages-to-avoid-cgo.patch
new file mode 100644
index 00000000..e4967d2e
--- /dev/null
+++ b/external/meta-virtualization/recipes-networking/netns/files/Makefile-force-rebuilding-all-packages-to-avoid-cgo.patch
@@ -0,0 +1,64 @@
+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 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/basic.mk b/basic.mk
+index 187dff3..76a8d93 100644
+--- a/src/import/basic.mk
++++ b/src/import/basic.mk
+@@ -45,12 +45,12 @@ build: prebuild $(NAME) ## Builds a dynamic executable or package.
+
+ $(NAME): $(wildcard *.go) $(wildcard */*.go) VERSION.txt
+ @echo "+ $@"
+- $(GO) build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
++ $(GO) build -a -pkgdir dontusecurrentpkgs -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
+
+ .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.23.0
+