summaryrefslogtreecommitdiff
path: root/go/Makefile
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2021-02-04 21:13:27 -0800
committerAndrew G. Morgan <morgan@kernel.org>2021-02-04 21:31:39 -0800
commit068edb72653750c717aa6ea447b750157559325e (patch)
tree1af6c70d90223358e4d0f0dfb53bc46df5a2a370 /go/Makefile
parentea1f4bf0d824dac4f43e181c811f9b741f776477 (diff)
downloadlibcap2-068edb72653750c717aa6ea447b750157559325e.tar.gz
Make more uniform GO build options.
Avoid building any of the GO stuff: make GOLANG=no ... Build with a specific build of GO: make GO=~/sdk/go1.16rc1/bin/go ... Also, now https://github.com/golang/go/issues/43149 is resolved in the go1.16rc1 build (it does not work in the go1.16beta1 but we don't support that one any more), remove the forced CGO use for the go/psx-signals build. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'go/Makefile')
-rw-r--r--go/Makefile16
1 files changed, 9 insertions, 7 deletions
diff --git a/go/Makefile b/go/Makefile
index b8745f1..757844a 100644
--- a/go/Makefile
+++ b/go/Makefile
@@ -76,12 +76,11 @@ ifeq ($(CGO_REQUIRED),0)
GO111MODULE=off CGO_ENABLED="1" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH=$(GOPATH) $(GO) build -o $@-cgo $<
endif
-# Bug reported issues:
-# https://bugzilla.kernel.org/show_bug.cgi?id=210533 (cgo - fixed)
-# https://github.com/golang/go/issues/43149 (nocgo - not fixed yet)
-# When the latter is fixed we can replace CGO_ENABLED=1 with ="$(CGO_REQUIRED)"
-psx-signals: psx-signals.go $(PSXGOPACKAGE)
- GO111MODULE=off CGO_ENABLED=1 CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPATH=$(GOPATH) $(GO) build $<
+psx-signals: psx-signals.go $(PSXGOPACKAGE)
+ GO111MODULE=off CGO_ENABLED="$(CGO_REQUIRED)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPATH=$(GOPATH) $(GO) build $<
+ifeq ($(CGO_REQUIRED),0)
+ GO111MODULE=off CGO_ENABLED="1" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPATH=$(GOPATH) $(GO) build -o $@-cgo $<
+endif
b210613: b210613.go $(CAPGOPACKAGE)
GO111MODULE=off CGO_ENABLED="$(CGO_REQUIRED)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPATH=$(GOPATH) $(GO) build $<
@@ -91,6 +90,9 @@ test: all
GO111MODULE=off CGO_ENABLED="$(CGO_REQUIRED)" CGO_LDFLAGS_ALLOW="$(CGO_LDFLAGS_ALLOW)" GOPATH="$(GOPATH)" $(GO) test $(IMPORTDIR)/cap
LD_LIBRARY_PATH=../libcap ./compare-cap
./psx-signals
+ifeq ($(CGO_REQUIRED),0)
+ ./psx-signals-cgo
+endif
./setid --caps=false
./gowns -- -c "echo gowns runs"
@@ -122,5 +124,5 @@ clean:
rm -f web setid gowns
rm -f compare-cap try-launching try-launching-cgo
rm -f $(topdir)/cap/*~ $(topdir)/psx/*~
- rm -f psx-signals b210613
+ rm -f b210613 psx-signals psx-signals-cgo
rm -fr pkg src