commit: cdcb324c855418952bd9a8f8baac0b56486c5200
Author: Matt Whitlock <gentoo <AT> mattwhitlock <DOT> name>
AuthorDate: Thu Aug 7 20:55:28 2025 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sat Jan 3 09:01:48 2026 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cdcb324c
meson.eclass: set "needs_exe_wrapper = false" if possible
When the only reason we are running Meson in cross mode is because we
are building for a non-default ABI of the native platform, we can tell
Meson that no wrapper is necessary when executing host-machine binaries
on the build machine.
Also, the native file name really shouldn't be
"meson.${CBUILD}.${ABI}.ini", as ${ABI} refers to an ABI of CHOST, not
of CBUILD, so just drop the ".${ABI}" from the file name since the
native file will not vary between ABI phases.
Closes: https://bugs.gentoo.org/960506
Signed-off-by: Matt Whitlock <gentoo <AT> mattwhitlock.name>
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
eclass/meson.eclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index aff238ef5d26..2445dde807c5 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -181,7 +181,7 @@ _meson_create_cross_file() {
objcpp_link_args = $(_meson_env_array "${OBJCXXFLAGS} ${LDFLAGS}")
[properties]
- needs_exe_wrapper = true
+ needs_exe_wrapper = $(tc-is-cross-compiler && echo true || echo false)
sys_root = '${SYSROOT}'
pkg_config_libdir =
'${PKG_CONFIG_LIBDIR:-${EPREFIX}/usr/$(get_libdir)/pkgconfig}'
@@ -205,7 +205,7 @@ _meson_create_native_file() {
local system cpu_family cpu
_meson_get_machine_info "${CBUILD}"
- local fn=${T}/meson.${CBUILD}.${ABI}.ini
+ local fn=${T}/meson.${CBUILD}.ini
cat > "${fn}" <<-EOF || die "failed to create native file"
[binaries]
@@ -382,7 +382,7 @@ setup_meson_src_configure() {
MESONARGS+=( -Dbuildtype="${EMESON_BUILDTYPE}" )
fi
- if tc-is-cross-compiler; then
+ if tc-is-cross-compiler || [[ "${ABI}" != "${DEFAULT_ABI}" ]]; then
MESONARGS+=( --cross-file "$(_meson_create_cross_file)" )
fi