overlay coreos/config: Fix cross-compilation of docker and docker-cli

This commit is contained in:
Krzesimir Nowak 2025-02-06 12:08:33 +01:00
parent 6b8fcce30f
commit 709f118084
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,12 @@
# Fix cross-compilation by setting up the environment properly.
#
# This is what go-module_src_unpack does, but docker does not use it.
cros_pre_src_unpack_set_build_env() {
if use amd64 || use arm || use arm64 ||
( use ppc64 && [[ $(tc-endian) == "little" ]] ) || use s390 || use x86; then
GOFLAGS="-buildmode=pie ${GOFLAGS}"
fi
GOFLAGS="${GOFLAGS} -p=$(makeopts_jobs)"
go-env_set_compile_environment
}

View File

@ -0,0 +1,12 @@
# Fix cross-compilation by setting up the environment properly.
#
# This is what go-module_src_unpack does, but docker does not use it.
cros_pre_src_unpack_set_build_env() {
if use amd64 || use arm || use arm64 ||
( use ppc64 && [[ $(tc-endian) == "little" ]] ) || use s390 || use x86; then
GOFLAGS="-buildmode=pie ${GOFLAGS}"
fi
GOFLAGS="${GOFLAGS} -p=$(makeopts_jobs)"
go-env_set_compile_environment
}