From 4f5cc7a0a09df11a26973e65bed279fd32b8c2d3 Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Thu, 6 Jul 2023 14:45:33 +0800 Subject: intel-graphics-compiler: 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 --- .../igc/intel-graphics-compiler_1.0.13822.6.bb | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.13822.6.bb b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.13822.6.bb index a8039b9b..69bdac56 100644 --- a/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.13822.6.bb +++ b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.13822.6.bb @@ -31,15 +31,14 @@ export B S = "${WORKDIR}/git" -inherit cmake pkgconfig +inherit cmake pkgconfig qemu CXXFLAGS:append = " -Wno-error=nonnull" COMPATIBLE_HOST = '(x86_64).*-linux' COMPATIBLE_HOST:libc-musl = "null" -DEPENDS += " flex-native bison-native clang opencl-clang" -DEPENDS:append:class-target = " clang-cross-x86_64 intel-graphics-compiler-native" +DEPENDS += " flex-native bison-native clang clang-cross-x86_64 opencl-clang qemu-native" RDEPENDS:${PN} += "opencl-clang" @@ -54,19 +53,19 @@ EXTRA_OECMAKE = " \ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ -DLLVM_LINK_EXE=${STAGING_BINDIR_NATIVE}/llvm-link \ -DCLANG_EXE=${STAGING_BINDIR_NATIVE}/clang \ + -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ " -do_install:append:class-native () { - install -d ${D}${bindir} - install ${B}/IGC/Release/elf_packager ${D}${bindir}/ - if ${@bb.utils.contains('PACKAGECONFIG', 'vc', 'true', 'false', d)}; then - install ${B}/IGC/Release/CMCLTranslatorTool ${D}${bindir}/ - install ${B}/IGC/Release/vcb ${D}${bindir}/ - fi +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('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}" + cat > ${WORKDIR}/qemuwrapper << EOF +#!/bin/sh +$qemu_binary "\$@" +EOF + chmod +x ${WORKDIR}/qemuwrapper } -BBCLASSEXTEND = "native nativesdk" - UPSTREAM_CHECK_GITTAGREGEX = "^igc-(?P(?!19\..*)\d+(\.\d+)+)$" FILES:${PN} += " \ -- cgit v1.2.3-54-g00ecf