diff options
author | Thilo Fromm <thilo.alexander@gmail.com> | 2023-11-08 08:34:35 +0100 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2023-11-20 23:25:22 +0000 |
commit | 878d04daaf34765e6224e58139a9c45921d7a0c3 (patch) | |
tree | d57d3dc8277d17faca76d92be74825005b1780fc /eclass/go-module.eclass | |
parent | app-crypt/certbot-nginx: stabilize 2.7.2 for amd64, arm64, x86 (diff) | |
download | gentoo-878d04daaf34765e6224e58139a9c45921d7a0c3.tar.gz gentoo-878d04daaf34765e6224e58139a9c45921d7a0c3.tar.bz2 gentoo-878d04daaf34765e6224e58139a9c45921d7a0c3.zip |
eclass/go-env.eclass: add helper to set compile env
This change adds a helper function to explicitly set CC, CXX, and
GOARCH, and carrying over CFLAGS, LDFLAGS and friends to CGO
equivalents, to provide a minimal sane compile environment for Go.
It enables Go builds to play nice with crossdev's wrappers for
emerge/ebuild etc. Previously, Go ebuilds emitted binaries for the host
architecture.
For example, when running on an x86_64 host:
emerge-aarch64-cross-linux-gnu foo
will now correctly emerge Go package "foo" for aarch64 instead of
x86_64.
The eclass provides a single helper function
go-env_set_compile_environment()
intended to be called by other Go eclasses in an early build stage.
Ebuilds may also explicitly call this function.
Signed-off-by: Thilo Fromm <thilo.alexander@gmail.com>
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'eclass/go-module.eclass')
0 files changed, 0 insertions, 0 deletions