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 <anuj.mittal@intel.com>
This commit is contained in:
Anuj Mittal 2023-07-06 14:45:56 +08:00
parent 4f5cc7a0a0
commit 8af199950b

View File

@ -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<pver>\d+(\.\d+)+)"