mirror of
https://git.kernel.org/pub/scm/libs/libcap/libcap.git
synced 2026-01-26 15:39:08 +00:00
Do not cross compile mknames.go
`GOOS` and `GOARCH` can be set to cross compile the Go code. But `good-names.go` is generated at build time using `mknames.go`, which must be built for the build platform. `GOOS` and `GOARCH` can be unset to do this. In many circumstances, Go will use its own internal linker to build the binary, which means it won't need to use `$CC`. But in some scenarios, e.g. when building PIE binaries, it will use `$CC` as the linker, so this needs to be set to the build platform's compiler for `go run`. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
This commit is contained in:
parent
3b2513a1ba
commit
d628b3bfe4
@ -49,7 +49,7 @@ $(topdir)/libcap/cap_names.h:
|
||||
$(MAKE) -C $(topdir)/libcap cap_names.h
|
||||
|
||||
good-names.go: $(topdir)/libcap/cap_names.h vendor/$(IMPORTDIR)/cap mknames.go
|
||||
CC="$(CC)" $(GO) run -mod=vendor mknames.go --header=$< --textdir=$(topdir)/doc/values | gofmt > $@ || rm -f $@
|
||||
CC="$(BUILD_CC)" GOOS= GOARCH= $(GO) run -mod=vendor mknames.go --header=$< --textdir=$(topdir)/doc/values | gofmt > $@ || rm -f $@
|
||||
diff -u ../cap/names.go $@
|
||||
|
||||
PSXGOPACKAGE: vendor/$(IMPORTDIR)/psx ../psx/*.go $(DEPS)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user