Build a subset of LLVM libraries using the bare metal arm gcc toolchain. These libraries are used by TI's OpenCL runtime over TI-RTOS host.
Signed-off-by: Ajay Jayaraj <[email protected]> --- .../recipes-ti/includes/arago-paths.inc | 2 + .../recipes-ti/llvm-rtos/llvm-rtos.inc | 16 +++++++ .../recipes-ti/llvm-rtos/llvm-rtos_git.bb | 56 ++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 meta-arago-extras/recipes-ti/llvm-rtos/llvm-rtos.inc create mode 100644 meta-arago-extras/recipes-ti/llvm-rtos/llvm-rtos_git.bb diff --git a/meta-arago-extras/recipes-ti/includes/arago-paths.inc b/meta-arago-extras/recipes-ti/includes/arago-paths.inc index 6867406..393f14b 100644 --- a/meta-arago-extras/recipes-ti/includes/arago-paths.inc +++ b/meta-arago-extras/recipes-ti/includes/arago-paths.inc @@ -2,6 +2,8 @@ require recipes-ti/includes/ti-paths.inc export LIBARCH_INSTALL_DIR_RECIPE = "${installdir}/ti-libarch-tree" export LINALG_INSTALL_DIR_RECIPE = "${installdir}/ti-linalg-tree" +export LLVM_RTOS_INSTALL_DIR_RECIPE = "${installdir}/llvm-rtos-tree" export LIBARCH_INSTALL_DIR = "${STAGING_DIR_TARGET}${LIBARCH_INSTALL_DIR_RECIPE}" export LINALG_INSTALL_DIR = "${STAGING_DIR_TARGET}${LINALG_INSTALL_DIR_RECIPE}" +export LLVM_RTOS_INSTALL_DIR = "${STAGING_DIR_NATIVE}${LLVM_RTOS_INSTALL_DIR_RECIPE}" diff --git a/meta-arago-extras/recipes-ti/llvm-rtos/llvm-rtos.inc b/meta-arago-extras/recipes-ti/llvm-rtos/llvm-rtos.inc new file mode 100644 index 0000000..faf9b64 --- /dev/null +++ b/meta-arago-extras/recipes-ti/llvm-rtos/llvm-rtos.inc @@ -0,0 +1,16 @@ +PV = "3.6.0" +INC_PR = "r0" + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" + +LLVM_GIT_NAME = "llvm" +LLVM_GIT_URI = "git://git.ti.com/opencl/llvm.git" +LLVM_GIT_PROTOCOL = "git" +LLVM_GIT_BRANCH = "release_36_ti" +LLVM_GIT_DESTSUFFIX = "git" +LLVM_GIT_SRCREV = "8ff2a35c586a3d3f624712e0943777613a017bc5" + +SRC_URI = "${LLVM_GIT_URI};protocol=${LLVM_GIT_PROTOCOL};branch=${LLVM_GIT_BRANCH};destsuffix=${LLVM_GIT_DESTSUFFIX};name=${LLVM_GIT_NAME}" + +SRCREV_${LLVM_GIT_NAME} = "${LLVM_GIT_SRCREV}" + diff --git a/meta-arago-extras/recipes-ti/llvm-rtos/llvm-rtos_git.bb b/meta-arago-extras/recipes-ti/llvm-rtos/llvm-rtos_git.bb new file mode 100644 index 0000000..fac9d6b --- /dev/null +++ b/meta-arago-extras/recipes-ti/llvm-rtos/llvm-rtos_git.bb @@ -0,0 +1,56 @@ +SUMMARY = "Bare-metal build of a subset of LLVM 3.6 with support for TI C66x" +HOMEPAGE = "http://git.ti.com/opencl/llvm" +DESCRIPTION = "A subset of LLVM 3.6 libraries built using gcc-arm-none-eabi-native. Used in the OpenCL running over a TI-RTOS based host." + +# 3-clause BSD-like +# University of Illinois/NCSA Open Source License +LICENSE = "NCSA" + + +require llvm-rtos.inc +require recipes-ti/includes/arago-paths.inc + +PR = "${INC_PR}.0" + +DEPENDS = "gcc-arm-none-eabi-native cmake-native" + +COMPATIBLE_MACHINE = "omap-a15" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +S = "${WORKDIR}/git" +RELEASE_TARGET = "" +RELEASE_TARGET_omap-a15 = "am57xx" + +CLEANBROKEN = "1" + +export LLVM_SRC_DIR="${S}" +export LLVM_INSTALL_DIR="${LLVM_RTOS_INSTALL_DIR}" + +do_compile() { + unset LDFLAGS + unset TARGET_LDFLAGS + + # Clean the build directory + rm -rf build.sysbios + + mkdir -p build.sysbios/build.native + cd build.sysbios/build.native; CC="${BUILD_CC}" CXX="${BUILD_CXX}" cmake "${S}"; cd ../.. + make -C build.sysbios/build.native llvm-tblgen llvm-config ${PARALLEL_MAKE} + + cd build.sysbios; cmake -DCMAKE_TOOLCHAIN_FILE="${S}/ToolChain_ARMSysBios.cmake" -Wno-dev "${S}"; cd .. + + make -C build.sysbios LLVMSupport LLVMCore LLVMBitReader ${PARALLEL_MAKE} + + cd build.sysbios; make -f include/llvm/Makefile install/local; cd .. + +} + +do_install() { + install -d ${LLVM_RTOS_INSTALL_DIR}/bin + install -m 755 ${S}/build.sysbios/build.native/bin/llvm-config ${LLVM_RTOS_INSTALL_DIR}/bin/llvm-config-host + + install -d ${LLVM_RTOS_INSTALL_DIR}/lib + for libfile in ${S}/build.sysbios/lib/*.a; do + install -m 644 ${libfile} ${LLVM_RTOS_INSTALL_DIR}/lib + done +} -- 1.9.1 _______________________________________________ meta-arago mailing list [email protected] http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago
