[PATCH] meson.eclass: Set needs_exe_wrapper in cross file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] meson.eclass: Set needs_exe_wrapper in cross file

Matt Turner-5
needs_exe_wrapper tells meson whether the build machine is able to
directly execute the binaries it produces or whether it needs an exe
wrapper (like QEMU). For non-native ABI builds like building 32-bit
libraries on an x86-64 system, we want this set to false to communicate
to meson that the build machine can run the binaries directly.

This allows dev-libs/wayland to execute the wayland-scanner binary it
builds rather than relying on the system's.

Signed-off-by: Matt Turner <[hidden email]>
---
 eclass/meson.eclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 0588590b31e..16e17dd4a38 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -149,6 +149,9 @@ _meson_create_cross_file() {
  # This may require adjustment based on CFLAGS
  local cpu=${CHOST%%-*}
 
+ local needs_exe_wrapper=false
+ tc-is-cross-compiler && needs_exe_wrapper=true
+
  cat > "${T}/meson.${CHOST}.${ABI}" <<-EOF
  [binaries]
  ar = $(_meson_env_array "$(tc-getAR)")
@@ -173,6 +176,7 @@ _meson_create_cross_file() {
  objc_link_args = $(_meson_env_array "${OBJCFLAGS} ${LDFLAGS}")
  objcpp_args = $(_meson_env_array "${OBJCXXFLAGS} ${CPPFLAGS}")
  objcpp_link_args = $(_meson_env_array "${OBJCXXFLAGS} ${LDFLAGS}")
+ needs_exe_wrapper = ${needs_exe_wrapper}
 
  [host_machine]
  system = '${system}'
--
2.24.1


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] meson.eclass: Set needs_exe_wrapper in cross file

James Le Cuirot
On Wed,  4 Mar 2020 11:55:30 -0800
Matt Turner <[hidden email]> wrote:

> needs_exe_wrapper tells meson whether the build machine is able to
> directly execute the binaries it produces or whether it needs an exe
> wrapper (like QEMU). For non-native ABI builds like building 32-bit
> libraries on an x86-64 system, we want this set to false to communicate
> to meson that the build machine can run the binaries directly.
>
> This allows dev-libs/wayland to execute the wayland-scanner binary it
> builds rather than relying on the system's.
>
> Signed-off-by: Matt Turner <[hidden email]>
> ---
>  eclass/meson.eclass | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/eclass/meson.eclass b/eclass/meson.eclass
> index 0588590b31e..16e17dd4a38 100644
> --- a/eclass/meson.eclass
> +++ b/eclass/meson.eclass
> @@ -149,6 +149,9 @@ _meson_create_cross_file() {
>   # This may require adjustment based on CFLAGS
>   local cpu=${CHOST%%-*}
>  
> + local needs_exe_wrapper=false
> + tc-is-cross-compiler && needs_exe_wrapper=true
> +
>   cat > "${T}/meson.${CHOST}.${ABI}" <<-EOF
>   [binaries]
>   ar = $(_meson_env_array "$(tc-getAR)")
> @@ -173,6 +176,7 @@ _meson_create_cross_file() {
>   objc_link_args = $(_meson_env_array "${OBJCFLAGS} ${LDFLAGS}")
>   objcpp_args = $(_meson_env_array "${OBJCXXFLAGS} ${CPPFLAGS}")
>   objcpp_link_args = $(_meson_env_array "${OBJCXXFLAGS} ${LDFLAGS}")
> + needs_exe_wrapper = ${needs_exe_wrapper}
>  
>   [host_machine]
>   system = '${system}'
LGTM!

--
James Le Cuirot (chewi)
Gentoo Linux Developer

attachment0 (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] meson.eclass: Set needs_exe_wrapper in cross file

Mike Gilbert-2
In reply to this post by Matt Turner-5
On Wed, Mar 4, 2020 at 2:55 PM Matt Turner <[hidden email]> wrote:

>
> needs_exe_wrapper tells meson whether the build machine is able to
> directly execute the binaries it produces or whether it needs an exe
> wrapper (like QEMU). For non-native ABI builds like building 32-bit
> libraries on an x86-64 system, we want this set to false to communicate
> to meson that the build machine can run the binaries directly.
>
> This allows dev-libs/wayland to execute the wayland-scanner binary it
> builds rather than relying on the system's.
>
> Signed-off-by: Matt Turner <[hidden email]>

Reviewed-by: Mike Gilbert <[hidden email]>

Looks good to me.