[Buildroot] [PATCH/master 7/7] package/gobject-introspection: Add QEMU_USERMODE_ARGS support

Arnout Vandecappelle arnout at mind.be
Sat Sep 11 19:47:28 UTC 2021



On 03/09/2021 18:20, Adam Duskett wrote:
> Now that the qemu package has the BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS string,
> the gobject-introspection g-ir-scanner-qemuwrapper script can pass that string
> to qemu.
> 
> Add the QEMU_USERMODE_ARGS to g-ir-scanner-qemuwrapper.in and unconditionally
> sed @QEMU_USERMODE_ARGS@ with BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS.
> 
> Fixes:
> http://autobuild.buildroot.org/results/2e9dbc0d36600c09fa9e59ab1b1903c9f40661e8
> 
> Signed-off-by: Adam Duskett <aduskett at gmail.com>
> ---
>  package/gobject-introspection/g-ir-scanner-qemuwrapper.in | 2 ++
>  package/gobject-introspection/gobject-introspection.mk    | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/package/gobject-introspection/g-ir-scanner-qemuwrapper.in b/package/gobject-introspection/g-ir-scanner-qemuwrapper.in
> index 5ece75d0a4..e434502e2b 100644
> --- a/package/gobject-introspection/g-ir-scanner-qemuwrapper.in
> +++ b/package/gobject-introspection/g-ir-scanner-qemuwrapper.in
> @@ -5,8 +5,10 @@
>  # Use a modules directory which does not exist so we don't load random things
>  # which may then get deleted (or their dependencies) and potentially segfault
>  GOI_LIBRARY_PATH="${GIR_EXTRA_LIBS_PATH:+${GIR_EXTRA_LIBS_PATH}:}.libs:$(dirname "$0")/../lib:$(dirname "$0")/../../lib"
> +QEMU_USERMODE_ARGS="@QEMU_USERMODE_ARGS@"
>  GIO_MODULE_DIR="$(dirname "$0")/../lib/gio/modules-dummy" \
>  @QEMU_USER@ -r @TOOLCHAIN_HEADERS_VERSION@ \
> +    ${QEMU_USERMODE_ARGS:+${QEMU_USERMODE_ARGS}} \

 I'm surprised this doesn't trigger SC2086... But actually, there's no need for
the additional variable, right? If you put @QEMU_USERMODE_ARGS@ here directly,
it should do the right thing:

- if empty, it just expands to

qemu-user-x86_64 -r 5.10.1 \
     \
    -L ...

- if set to "-cpu Nehalem,check=false" it expands to

qemu-user-x86_64 -r 5.10.1 \
    -cpu Nehalem,check=false \
    -L ...


 So I changed that and I'm doing a test build before pushing to be sure it works
as expected.

 Regards,
 Arnout

>      -L "$(dirname "$0")/../../" \
>      -E LD_LIBRARY_PATH="${GOI_LIBRARY_PATH}" \
>      "$@"
> diff --git a/package/gobject-introspection/gobject-introspection.mk b/package/gobject-introspection/gobject-introspection.mk
> index 81938b14df..23d6a8231e 100644
> --- a/package/gobject-introspection/gobject-introspection.mk
> +++ b/package/gobject-introspection/gobject-introspection.mk
> @@ -84,6 +84,8 @@ define GOBJECT_INTROSPECTION_INSTALL_PRE_WRAPPERS
>  		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
>  	$(SED) "s%@QEMU_USER@%$(QEMU_USER)%g" \
>  		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
> +	$(SED) "s%@QEMU_USERMODE_ARGS@%$(call qstrip,$(BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS))%g" \
> +		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
>  	$(SED) "s%@TOOLCHAIN_HEADERS_VERSION@%$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)%g" \
>  		$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
>  
> 


More information about the buildroot mailing list