Skip to contentSkip to conversation

meson.bbclass: add exe_wrapper helper

PATCH New Jose Quaresma 1 participant 1 message Mar 14, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 meson.bbclass: add exe_wrapper helper

Sometimes when we use the exe_wrapper we need a way to costumize or circumvent some limitations of the qemu usermode. The ideia of this help script is to handle such cases before the qemu usermode was launched.

---
 meta/classes/meson.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta/classes/meson.bbclass +5 -0
index 0bfe945811..8c732e6174 100644
@@ -114,6 +114,8 @@ cpp_link_args = ${@meson_array('BUILD_LDFLAGS', d)}
 EOF
 }
 
+MESON_QEMU_WRAPPER_HELPER ?= ""
+
 do_write_config:append:class-target() {
     # Write out a qemu wrapper that will be used as exe_wrapper so that meson
     # can run target helper binaries through that.
@@ -127,6 +129,9 @@ export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy
 # meson sets this wrongly (only to libs in build-dir), qemu_wrapper_cmdline() and GIR_EXTRA_LIBS_PATH take care of it properly
 unset LD_LIBRARY_PATH
 
+# import any customization provided in the helper
+test -f "${MESON_QEMU_WRAPPER_HELPER}" && . ${MESON_QEMU_WRAPPER_HELPER}
+
 $qemu_binary "\$@"
 EOF
     chmod +x ${WORKDIR}/meson-qemuwrapper
Signature · 1 line
2.35.1