From 8af199950b05c28530f1058de6b05262cbf42ca2 Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Thu, 6 Jul 2023 14:45:56 +0800 Subject: intel-compute-runtime: use qemu to run native binaries Now that intel-skylake-64 can use qemu-user as well, don't build native version of the recipe simply for use by the target version. Build a qemuwrapper that can be passed to CMAKE_CROSSCOMPILING_EMULATOR. Signed-off-by: Anuj Mittal --- .../intel-compute-runtime_23.17.26241.22.bb | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'dynamic-layers') diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_23.17.26241.22.bb b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_23.17.26241.22.bb index fe5f886c..8aef6e9a 100644 --- a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_23.17.26241.22.bb +++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_23.17.26241.22.bb @@ -11,22 +11,19 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=eca6ec6997e18db166db7109cdbe611c \ SRC_URI = "git://github.com/intel/compute-runtime.git;protocol=https;branch=releases/23.17 \ file://disable-werror.patch \ file://add-missing-cstdint-header-to-fix-compile-with-gcc13.patch \ - " - -SRC_URI:append:class-target = "file://allow-to-find-cpp-generation-tool.patch \ - file://external-ocloc.patch \ - " + file://allow-to-find-cpp-generation-tool.patch \ + file://external-ocloc.patch \ + " SRCREV = "0bb5b3408e6cb61b477e7cad296fd278b11e73be" S = "${WORKDIR}/git" -DEPENDS += " intel-graphics-compiler gmmlib" -DEPENDS:append:class-target = " intel-compute-runtime-native libva" +DEPENDS += " intel-graphics-compiler gmmlib libva qemu-native" RDEPENDS:${PN} += " intel-graphics-compiler gmmlib" -inherit cmake pkgconfig +inherit cmake pkgconfig qemu COMPATIBLE_HOST = '(x86_64).*-linux' COMPATIBLE_HOST:libc-musl = "null" @@ -42,14 +39,20 @@ EXTRA_OECMAKE = " \ EXTRA_OECMAKE:append:class-target = " \ -Docloc_cmd_prefix=ocloc \ - " + -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ + " PACKAGECONFIG ??= "" PACKAGECONFIG[levelzero] = "-DBUILD_WITH_L0=ON, -DBUILD_WITH_L0=OFF, level-zero" -do_install:append:class-native() { - install -d ${D}${bindir} - install ${B}/bin/cpp_generate_tool ${D}${bindir}/ +do_configure:prepend:class-target () { + # Write out a qemu wrapper that will be used by cmake. + qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${B}/bin'),d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}" + cat > ${WORKDIR}/qemuwrapper << EOF +#!/bin/sh +$qemu_binary "\$@" +EOF + chmod +x ${WORKDIR}/qemuwrapper } FILES:${PN} += " \ @@ -59,6 +62,4 @@ FILES:${PN} += " \ FILES:${PN}-dev = "${includedir}" -BBCLASSEXTEND = "native nativesdk" - UPSTREAM_CHECK_GITTAGREGEX = "(?P\d+(\.\d+)+)" -- cgit v1.2.3-54-g00ecf