Summary: | multilib.eclass: READELF override: meson refers to unprefixed 'readelf': No such file or directory: 'readelf': 'readelf' | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Sergei Trofimovich (RETIRED) <slyfox> |
Component: | Eclasses | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | amd64, floppym, williamh |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://archives.gentoo.org/gentoo-dev/message/3304560f3b8d8f8259a2bfa83090c38f | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
net-libs:gssdp-1.2.2:20200525-111636.log
emerge --info |
Description
Sergei Trofimovich (RETIRED)
2020-05-25 11:21:03 UTC
Created attachment 641706 [details]
net-libs:gssdp-1.2.2:20200525-111636.log
Created attachment 641708 [details]
emerge --info
meson supports overriding the readelf binary. https://github.com/mesonbuild/meson/commit/4d3cce1532ccd6cbd5cdb6a3d12b076effedd6bd And we export READELF in meson.eclass. https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2d332b15f52b5aadcdc85a6d84d1bcbd99db44f The problem is that CHOST is set to i686-pc-linux-gnu when performing an x86 multilib build. The READELF variable would need to be set before meson_src_configure gets called. 'tc-getPROG READELF readelf >/dev/null' that statement looks like a no-op for me. It's probably a multilib.eclass issue then. (In reply to Sergei Trofimovich from comment #4) > 'tc-getPROG READELF readelf >/dev/null' that statement looks like a no-op > for me. Oh, TIL it actually reefports the variable. Let's assume it's a multilib.eclass problem. Below seems to be enough to make gssdp build and pass tests: $ git diff diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass index b79718bb193..ed54568aa2d 100644 --- a/eclass/multilib.eclass +++ b/eclass/multilib.eclass @@ -468,6 +468,7 @@ multilib_toolchain_setup() { NM OBJDUMP RANLIB + READELF STRIP PKG_CONFIG_LIBDIR PKG_CONFIG_PATH @@ -510,6 +511,7 @@ multilib_toolchain_setup() { export NM="$(tc-getNM)" # Avoid 'nm', use '${CHOST}-nm' export OBJDUMP="$(tc-getOBJDUMP)" # Avoid 'objdump', use '${CHOST}-objdump' export RANLIB="$(tc-getRANLIB)" # Avoid 'ranlib', use '${CHOST}-ranlib' + export READELF="$(tc-getREADELF)" # Avoid 'readelf', use '${CHOST}-readelf' export STRIP="$(tc-getSTRIP)" # Avoid 'strip', use '${CHOST}-strip' export CHOST=$(get_abi_CHOST $1) export PKG_CONFIG_LIBDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 1bc6cbbc108..b7a3c7a84af 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -85,6 +85,10 @@ tc-getNM() { tc-getPROG NM nm "$@"; } # @USAGE: [toolchain prefix] # @RETURN: name of the archiver indexer tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; } +# @FUNCTION: tc-getREADELF +# @USAGE: [toolchain prefix] +# @RETURN: name of the archiver indexer +tc-getREADELF() { tc-getPROG READELF readelf "$@"; } # @FUNCTION: tc-getOBJCOPY # @USAGE: [toolchain prefix] # @RETURN: name of the object copier @@ -158,6 +162,10 @@ tc-getBUILD_NM() { tc-getBUILD_PROG NM nm "$@"; } # @USAGE: [toolchain prefix] # @RETURN: name of the archiver indexer for building binaries to run on the build machine tc-getBUILD_RANLIB() { tc-getBUILD_PROG RANLIB ranlib "$@"; } +# @FUNCTION: tc-getBUILD_READELF +# @USAGE: [toolchain prefix] +# @RETURN: name of the archiver indexer for building binaries to run on the build machine +tc-getBUILD_READELF() { tc-getBUILD_PROG READELF readelf "$@"; } # @FUNCTION: tc-getBUILD_OBJCOPY # @USAGE: [toolchain prefix] # @RETURN: name of the object copier for building binaries to run on the build machine @@ -376,6 +384,7 @@ tc-env_build() { NM=$(tc-getBUILD_NM) \ PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG) \ RANLIB=$(tc-getBUILD_RANLIB) \ + READELF=$(tc-getBUILD_READELF) \ "$@" } Will send for review later today. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bd13f6d55a51f2a1f4da69a41df7973fa7503cc commit 7bd13f6d55a51f2a1f4da69a41df7973fa7503cc Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-05-25 12:59:54 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-05-25 20:47:07 +0000 multilib.eclass: populate READELF For both multilib and non-multilib profiles binutils provides tools with native CHOST prefix only. For example on amd64 there is only 'x86_64-pc-linux-gnu-readelf' and 'readelf'. meson build system uses 'readelf' or $READELF binaries and relies on meson.eclass to populate READELF. The change overrides READELF and friends to 'x86_64-pc-linux-gnu-readelf' for multilib setup similar to other environment variables. Tested on net-libs/gssdp package. Closes: https://bugs.gentoo.org/725304 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> eclass/multilib.eclass | 2 ++ 1 file changed, 2 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccdea417c4a259a03a745e3a977ac56827be5ae4 commit ccdea417c4a259a03a745e3a977ac56827be5ae4 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-05-25 12:58:50 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-05-25 20:47:07 +0000 toolchain-funcs.eclass: export tc-get*READELF helpers Bug: https://bugs.gentoo.org/725304 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> eclass/toolchain-funcs.eclass | 9 +++++++++ 1 file changed, 9 insertions(+) |