Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] meson.eclass: Set needs_exe_wrapper in cross file
Date: Wed, 04 Mar 2020 22:19:36
Message-Id: 20200304221854.221e9fcd@symphony.aura-online.co.uk
In Reply to: [gentoo-dev] [PATCH] meson.eclass: Set needs_exe_wrapper in cross file by Matt Turner
1 On Wed, 4 Mar 2020 11:55:30 -0800
2 Matt Turner <mattst88@g.o> wrote:
3
4 > needs_exe_wrapper tells meson whether the build machine is able to
5 > directly execute the binaries it produces or whether it needs an exe
6 > wrapper (like QEMU). For non-native ABI builds like building 32-bit
7 > libraries on an x86-64 system, we want this set to false to communicate
8 > to meson that the build machine can run the binaries directly.
9 >
10 > This allows dev-libs/wayland to execute the wayland-scanner binary it
11 > builds rather than relying on the system's.
12 >
13 > Signed-off-by: Matt Turner <mattst88@g.o>
14 > ---
15 > eclass/meson.eclass | 4 ++++
16 > 1 file changed, 4 insertions(+)
17 >
18 > diff --git a/eclass/meson.eclass b/eclass/meson.eclass
19 > index 0588590b31e..16e17dd4a38 100644
20 > --- a/eclass/meson.eclass
21 > +++ b/eclass/meson.eclass
22 > @@ -149,6 +149,9 @@ _meson_create_cross_file() {
23 > # This may require adjustment based on CFLAGS
24 > local cpu=${CHOST%%-*}
25 >
26 > + local needs_exe_wrapper=false
27 > + tc-is-cross-compiler && needs_exe_wrapper=true
28 > +
29 > cat > "${T}/meson.${CHOST}.${ABI}" <<-EOF
30 > [binaries]
31 > ar = $(_meson_env_array "$(tc-getAR)")
32 > @@ -173,6 +176,7 @@ _meson_create_cross_file() {
33 > objc_link_args = $(_meson_env_array "${OBJCFLAGS} ${LDFLAGS}")
34 > objcpp_args = $(_meson_env_array "${OBJCXXFLAGS} ${CPPFLAGS}")
35 > objcpp_link_args = $(_meson_env_array "${OBJCXXFLAGS} ${LDFLAGS}")
36 > + needs_exe_wrapper = ${needs_exe_wrapper}
37 >
38 > [host_machine]
39 > system = '${system}'
40
41 LGTM!
42
43 --
44 James Le Cuirot (chewi)
45 Gentoo Linux Developer