mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 13:06:59 +02:00
make.defaults, go-env.eclass: export cgo flags, enable cgo by default
This change adds exporting CGO_* flags to go-env.eclass; the upstream pr https://github.com/gentoo/gentoo/pull/33539 has been updated accordingly. Also, CGO_ENABLED=1 has been added to coreos/../make.conf to enable gco by default. This fixes a build issue for arm64 with Docker's device-mapper storage driver: daemon/graphdriver/devmapper/deviceset.go:306:25: undefined: devicemapper.SetTransactionID ... daemon/graphdriver/devmapper/deviceset.go:867:28: undefined: devicemapper.ErrEnxio daemon/graphdriver/devmapper/deviceset.go:867:28: too many errors gco is enabled on AMD64 by default, and cgo was always enabled in the coreos docker ebuilds. This way we retain that setting for the Gentoo ebuilds.
This commit is contained in:
parent
c522b04f2a
commit
fa623fed84
@ -127,3 +127,6 @@ DONT_MOUNT_BOOT=1
|
||||
# inside the scripts repository that poke binary packages assume that
|
||||
# bzip2 is used, not zstd. Eventually we will want to move to zstd.
|
||||
BINPKG_COMPRESS=bzip2
|
||||
|
||||
# Enable cgo by default. Required for the docker device-mapper driver to compile.
|
||||
CGO_ENABLED=1
|
||||
|
@ -19,6 +19,7 @@ inherit toolchain-funcs
|
||||
# @FUNCTION: go-env_set_compile_environment
|
||||
# @DESCRIPTION:
|
||||
# Set up basic compile environment: CC, CXX, and GOARCH.
|
||||
# Also carry over CFLAGS, LDFLAGS and friends.
|
||||
# Required for cross-compiling with crossdev.
|
||||
# If not set, host defaults will be used and the resulting binaries are host arch.
|
||||
# (e.g. "emerge-aarch64-cross-linux-gnu foo" run on x86_64 will emerge "foo" for x86_64
|
||||
@ -38,6 +39,10 @@ go-env_set_compile_environment() {
|
||||
|
||||
tc-export CC CXX
|
||||
export GOARCH
|
||||
export CGO_CFLAGS="${CGO_CFLAGS:-$CFLAGS}"
|
||||
export CGO_CPPFLAGS="${CGO_CPPFLAGS:-$CPPFLAGS}"
|
||||
export CGO_CXXFLAGS="${CGO_CXXFLAGS:-$CXXFLAGS}"
|
||||
export CGO_LDFLAGS="${CGO_LDFLAGS:-$LDFLAGS}"
|
||||
}
|
||||
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user