Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

Build actool for the *build* architecture #2372

Merged
merged 1 commit into from
Apr 14, 2016
Merged

Conversation

anguslees
Copy link
Contributor

actool is used during the build to generate stage1 images, etc. Without
this patch, actool is mistakenly compiled for the target architecture.

actool is used during the build to generate stage1 images, etc.  Without
this patch, actool is mistakenly compiled for the *target* architecture.
@@ -4,6 +4,7 @@ $(call setup-stamp-file,ACTOOL_STAMP)
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ...)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@iaguis iaguis added this to the v1.4.0 milestone Apr 14, 2016
@iaguis iaguis merged commit c54924d into rkt:master Apr 14, 2016
@iaguis
Copy link
Member

iaguis commented Apr 14, 2016

LGTK

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants