Build actool for the *build* architecture#2372
Conversation
actool is used during the build to generate stage1 images, etc. Without this patch, actool is mistakenly compiled for the *target* architecture.
| BGB_STAMP := $(ACTOOL_STAMP) | ||
| BGB_PKG_IN_REPO := Godeps/_workspace/src/github.com/appc/spec/actool | ||
| BGB_BINARY := $(ACTOOL) | ||
| BGB_ADDITIONAL_GO_ENV := GOARCH=$(GOARCH_FOR_BUILD) CC=$(CC_FOR_BUILD) |
There was a problem hiding this comment.
Is overriding CC env var required? I think that go should be able to pick up a valid C compiler based on GOARCH if it needs to build some C sources too…
There was a problem hiding this comment.
provided it doesn't use $CC - since that will be a compiler for the target...
(In other words, yes I believe it needs to be set explicitly - assuming actool uses cgo at all. Since it was obviously the correct thing to do, I forget whether I tried it without the CC override ...)
There was a problem hiding this comment.
An excerpt from src/cmd/cgo/doc.go:
When cross-compiling, you must specify a C cross-compiler for cgo to
use. You can do this by setting the CC_FOR_TARGET environment
variable when building the toolchain using make.bash, or by setting
the CC environment variable any time you run the go tool. The
CXX_FOR_TARGET and CXX environment variables work in a similar way for
C++ code.
Alright then.
|
LGTK |
actool is used during the build to generate stage1 images, etc. Without
this patch, actool is mistakenly compiled for the target architecture.