From ced2f28eb782e273f62d34cd4c1aa08408869826 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Tue, 12 Mar 2024 10:35:48 +0100 Subject: [PATCH] go-env.eclass: Export PKG_CONFIG Go files may have cgo specifiers that use pkg-config to search for libraries to link. An example of this is: // #cgo pkg-config: gpgme One case where this occurs is when building one of the go deps of app-containers/podman-4.9.2. If the ebuild doesn't export the correct PKG_CONFIG, this results in build failures during cross-compilation. Go will find the host (CBUILD) pkg-config instead of the CHOST version which performs the lookup in the correct sysroot. Fix cross-compilation by exporting PKG_CONFIG in go-env_set_compile_environment. Signed-off-by: Jeremi Piotrowski Closes: https://github.com/gentoo/gentoo/pull/35721 Signed-off-by: Sam James --- eclass/go-env.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass index 1f950db069302..08cb6380e48ac 100644 --- a/eclass/go-env.eclass +++ b/eclass/go-env.eclass @@ -27,7 +27,7 @@ inherit toolchain-funcs # (e.g. "emerge-aarch64-cross-linux-gnu foo" run on x86_64 will emerge "foo" for x86_64 # instead of aarch64) go-env_set_compile_environment() { - tc-export CC CXX + tc-export CC CXX PKG_CONFIG export GOARCH="$(go-env_goarch)" use arm && export GOARM=$(go-env_goarm)