Both the cross file and native file write $(get_libdir) into the PKG_CONFIG_LIBDIR path, while that function only returns the libdir of ROOT. The native file requires the libdir of BROOT. This breaks cross-compilation when they differ, e.g. from amd64 with lib64 to arm with lib. Reproducible: Always Steps to Reproduce: 1. cross emerge -v gnome-settings-daemon # any package calling native pkgconfig Actual Results: ... Pkg-config binary for MachineChoice.BUILD is cached. Determining dependency 'glib-2.0' with pkg-config executable '/usr/bin/x86_64-pc-linux-gnu-pkg-config' PKG_CONFIG_PATH: /usr/share/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig ... Build-time dependency glib-2.0 found: NO (tried pkgconfig and cmake) plugins/power/meson.build:22:0: ERROR: Dependency "glib-2.0" not found, tried pkgconfig and cmake Expected Results: It should say "PKG_CONFIG_LIBDIR: /usr/lib64/pkgconfig" and build correctly. I can work around this by setting BUILD_PKG_CONFIG_LIBDIR to override the eclass defaults, but I think get_libdir should be made root-aware like has_version and best_version.
Created attachment 680212 [details, diff] test.patch I tested this to fix it, but I don't know how this should be implemented in phase-helpers.sh properly. I assume it would need to wait for a new EAPI since get_libdir is in the PMS version 7 with no arguments.
Logging an IRC conversation on this. > <floppym> Maybe we could call `multilib_env ${CBUILD}` and then `ABI=${DEFAULT_ABI} get_libdir`. > <floppym> multilib_env initializes MULTILIB_ABIS and DEFAULT_ABI base on a gcc tuple. > <dm0> Does that handle definitions in the user's make.conf? > <dm0> Or is the user not allowed to set LIBDIR_*? > <floppym> $(ABI=amd64 get_libdir) should look at ${LIBDIR_amd64} from the enviroment. > <floppym> (which would include make.conf. > <dm0> But does it include the BROOT make.conf? > <floppym> No. > <dm0> That was my concern. > <dm0> I thought it would need to get the LIBDIR exactly as seen in BROOT's make.conf to match the actual BROOT libdir path being used. > <floppym> It would still be better than the current situation I think. It is probably uncommon to set LIBDIR_* in make.conf. > <dm0> And LIBDIR_amd64 is apparently not defined in the cross-root. > <floppym> But yeah, we would need an EAPI extension to get settings from BROOT. > <dm0> E.g. it sets LIBDIR_arm but not ABIs from other arches. > <floppym> multilib_env assigns LIBDIR_* itself. > <floppym> One might call that a bug since it ignores any profile settings. > <dm0> Yes, I was trying to remember what was changed between 17.0 and 17.1. > <dm0> Something about libdirs. > <floppym> SYMLINK_LIB was changed from yes to no. > <floppym> And LIBDIR_x86 changed from lib32 to lib. > <dm0> Okay, so that would still be an issue without having the real BROOT environment, but the multilib_env sounds like a better fix prior to the release of a new EAPI.