Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 762454 - meson.eclass: needs to understand different libdirs for different ROOTs
Summary: meson.eclass: needs to understand different libdirs for different ROOTs
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords: PATCH
Depends on: 794181
Blocks: 767880
  Show dependency tree
 
Reported: 2020-12-29 19:01 UTC by David Michael
Modified: 2021-06-04 16:40 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
test.patch (test.patch,1.48 KB, patch)
2020-12-29 19:02 UTC, David Michael
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2020-12-29 19:01:16 UTC
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.
Comment 1 David Michael 2020-12-29 19:02:59 UTC
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.
Comment 2 Mike Gilbert gentoo-dev 2020-12-29 19:26:56 UTC
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.