diff mbox series

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

Message ID 20210903162027.1935040-8-aduskett@gmail.com
State Accepted
Headers show
Series Qemu and gobject-introspection fixes | expand

Commit Message

Adam Duskett Sept. 3, 2021, 4:20 p.m. UTC
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@gmail.com>
---
 package/gobject-introspection/g-ir-scanner-qemuwrapper.in | 2 ++
 package/gobject-introspection/gobject-introspection.mk    | 2 ++
 2 files changed, 4 insertions(+)

Comments

Arnout Vandecappelle Sept. 11, 2021, 7:47 p.m. UTC | #1
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@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
>  
>
diff mbox series

Patch

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}} \
     -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