From 43fe6734bc32f3e3246df72303fa08a38016dd28 Mon Sep 17 00:00:00 2001 From: Zoltán Böszörményi Date: Fri, 12 Feb 2021 09:19:47 -0500 Subject: libclc: Add recipe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a pre-requisite to enable OpenCL in Mesa. Signed-off-by: Zoltán Böszörményi --- recipes-devtools/clang/libclc_git.bb | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 recipes-devtools/clang/libclc_git.bb diff --git a/recipes-devtools/clang/libclc_git.bb b/recipes-devtools/clang/libclc_git.bb new file mode 100644 index 0000000..aeedcf8 --- /dev/null +++ b/recipes-devtools/clang/libclc_git.bb @@ -0,0 +1,38 @@ +DESCRIPTION = "LLVM based OpenCL runtime support library" +HOMEPAGE = "http://libclc.llvm.org/" +SECTION = "libs" + +require clang.inc +require common-source.inc + +TOOLCHAIN = "clang" + +LIC_FILES_CHKSUM = "file://libclc/LICENSE.TXT;md5=7cc795f6cbb2d801d84336b83c8017db" + +inherit cmake pkgconfig python3native qemu + +DEPENDS_append = " qemu-native clang" + +OECMAKE_SOURCEPATH = "${S}/libclc" + +EXTRA_OECMAKE += " \ + -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ + -DCMAKE_CXX_FLAGS=-std=c++17 \ + -DCMAKE_SHARED_LINKER_FLAGS=-std=c++17 \ + -DCMAKE_EXE_LINKER_FLAGS=-std=c++17 \ + -Dclc_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeCLCCompiler.cmake.in \ + -Dll_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeLLAsmCompiler.cmake.in \ + " + +do_configure_prepend () { + # Write out a qemu wrapper that will be used by cmake + # so that it can run target helper binaries through that. + 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 +} + +FILES_${PN} += "${datadir}/clc" -- cgit v1.2.3-54-g00ecf