From 3c367f25f6a0c043733b752e084a9c419416b5ad Mon Sep 17 00:00:00 2001 From: Teoh Suh Haw Date: Thu, 8 Jun 2023 16:00:25 +0800 Subject: ispc: upgrade 1.19.0 -> 1.20.0 * Release Notes: https://github.com/ispc/ispc/releases/tag/v1.20.0 * Drop already merged patches: 0001-CMakeLists.txt-allow-to-pick-llvm-config-from-usr-bi.patch 0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch ffc75e464ff2b8fce7dbf74f1846ebd0852bc6f9.patch * Fix packaging to ensure libispcrt is packaged correctly. * ISPC runtime with CPU support can either be enabled with OpenMP or TBB. TBB is enabled by default that needs meta-oe to be included. Signed-off-by: Teoh Suh Haw Signed-off-by: Anuj Mittal --- ...unction-to-print-test-run-status-in-ptest.patch | 56 ++++++++++++++++ .../ispc/ispc/0001-Fix-QA-Issues.patch | 37 +++++++++++ ...0002-cmake-don-t-build-for-32-bit-targets.patch | 64 +++++++++++++++++++ .../recipes-core/ispc/ispc/run-ptest | 2 + .../recipes-core/ispc/ispc_1.20.0.bb | 74 ++++++++++++++++++++++ 5 files changed, 233 insertions(+) create mode 100644 dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest create mode 100644 dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.20.0.bb (limited to 'dynamic-layers/openembedded-layer') diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch new file mode 100644 index 00000000..3ce431d4 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch @@ -0,0 +1,56 @@ +From 6ba81efe971fb6038af6e950e853d35ee6dd9cc3 Mon Sep 17 00:00:00 2001 +From: Yogesh Tyagi +Date: Sun, 11 Dec 2022 22:34:15 +0800 +Subject: [PATCH] Add print function to print test run status in ptest format + +Upstream-Status: Inappropriate [OE ptest specific] + +Signed-off-by: Yogesh Tyagi +--- + run_tests.py | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/run_tests.py b/run_tests.py +index 87305a06..4f2f0f59 100755 +--- a/run_tests.py ++++ b/run_tests.py +@@ -385,6 +385,9 @@ def run_test(testname, host, target): + else: + ispc_exe_rel = add_prefix(host.ispc_cmd, host, target) + ++ # to reslove the error '.rodata' can not be used when making a PIE object ++ ispc_exe_rel = ispc_exe_rel + " --pic" ++ + # is this a test to make sure an error is issued? + want_error = (filename.find("tests_errors") != -1) + if want_error == True: +@@ -844,6 +847,17 @@ def check_compiler_exists(compiler_exe): + return + error("missing the required compiler: %s \n" % compiler_exe, 1) + ++def print_test_run_status(results): ++ for fstatus in results: ++ if (fstatus[1] == Status.Success): ++ print( "%s: %s" % ("PASS", fstatus[0])) ++ elif (fstatus[1] == Status.Compfail): ++ print( "%s: %s" % ("FAIL", fstatus[0])) ++ elif (fstatus[1] == Status.Runfail): ++ print( "%s: %s" % ("FAIL", fstatus[0])) ++ elif (fstatus[1] == Status.Skip): ++ print( "%s: %s" % ("SKIP", fstatus[0])) ++ + def print_result(status, results, s, run_tests_log, csv): + title = StatusStr[status] + file_list = [fname for fname, fstatus in results if status == fstatus] +@@ -987,6 +1001,8 @@ def run_tests(options1, args, print_version): + pass_rate = -1 + print_debug("PASSRATE (%d/%d) = %d%% \n\n" % (len(run_succeed_files), total_tests_executed, pass_rate), s, run_tests_log) + ++ print_test_run_status(results) ++ + for status in Status: + print_result(status, results, s, run_tests_log, options.csv) + fails = [status != Status.Compfail and status != Status.Runfail for _, status in results] +-- +2.37.3 + diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch new file mode 100644 index 00000000..e7bb599e --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch @@ -0,0 +1,37 @@ +From 139b94a7fb72114c31a2a6ab3f7e6024b4a738ec Mon Sep 17 00:00:00 2001 +From: Yogesh Tyagi +Date: Tue, 26 Jul 2022 15:25:10 +0800 +Subject: [PATCH] Fix QA Issues + +Stop ispc from inserting host file path in generated headers which leads to reproducibility problems. + +Upstream-Status: Inappropriate [OE build specific] + +Signed-off-by: Yogesh Tyagi + +--- + src/module.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/module.cpp b/src/module.cpp +index 58a2ae83..82673052 100644 +--- a/src/module.cpp ++++ b/src/module.cpp +@@ -2105,7 +2105,7 @@ bool Module::writeHeader(const char *fn) { + perror("fopen"); + return false; + } +- fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", fn); ++ fprintf(f, "//\n// \n// (Header automatically generated by the ispc compiler.)\n"); + fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n"); + + // Create a nice guard string from the filename, turning any +@@ -2219,7 +2219,7 @@ bool Module::writeDispatchHeader(DispatchHeaderInfo *DHI) { + FILE *f = DHI->file; + + if (DHI->EmitFrontMatter) { +- fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", DHI->fn); ++ fprintf(f, "//\n// \n// (Header automatically generated by the ispc compiler.)\n"); + fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n"); + } + // Create a nice guard string from the filename, turning any diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch new file mode 100644 index 00000000..a13ade9f --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch @@ -0,0 +1,64 @@ +From 493e886d6dae2ed7bdc12ed03f717ee0e98dfe09 Mon Sep 17 00:00:00 2001 +From: Naveen Saini +Date: Thu, 24 Feb 2022 20:01:11 +0530 +Subject: [PATCH] cmake: don't build for 32-bit targets + +Error log: +| tmp/work/corei7-64-poky-linux/ispc/1.16.0-r0/recipe-sysroot/usr/include/bits/long-double.h:23:10: fatal error: 'bits/long-double-32.h' file not found +| #include +| ^~~~~~~~~~~~~~~~~~~~~~~ +| 1 error generated. + +Remove SYSTEM include search path and set -isysroot dir path +for root dir for cross compilation. + +Upstream-Status: Inappropriate + +Signed-off-by: Naveen Saini +--- + cmake/GenerateBuiltins.cmake | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/cmake/GenerateBuiltins.cmake b/cmake/GenerateBuiltins.cmake +index fa228247..7adc7e52 100644 +--- a/cmake/GenerateBuiltins.cmake ++++ b/cmake/GenerateBuiltins.cmake +@@ -272,7 +272,7 @@ function(builtin_to_cpp bit os_name arch supported_archs supported_oses resultFi + # In this case headers will be installed in /usr/arm-linux-gnueabihf/include and will not be picked up + # by clang by default. So the following line adds such path explicitly. If this path doesn't exist and + # the headers can be found in other locations, this should not be a problem. +- set(includePath -isystem/usr/${debian_triple}/include) ++ set(includePath -isysroot${SYSROOT_DIR}) + endif() + endif() + +@@ -354,7 +354,7 @@ function (generate_target_builtins resultList) + set(regular_targets ${ARGN}) + list(FILTER regular_targets EXCLUDE REGEX wasm) + foreach (ispc_target ${regular_targets}) +- foreach (bit 32 64) ++ foreach (bit 64) + foreach (os_name ${TARGET_OS_LIST_FOR_LL}) + target_ll_to_cpp(target-${ispc_target} ${bit} ${os_name} output${os_name}${bit}) + list(APPEND tmpList ${output${os_name}${bit}}) +@@ -415,7 +415,7 @@ function (generate_common_builtins resultList) + endif() + + message (STATUS "ISPC will be built with support of ${supported_oses} for ${supported_archs}") +- foreach (bit 32 64) ++ foreach (bit 64) + foreach (os_name "windows" "linux" "freebsd" "macos" "android" "ios" "ps4" "web") + foreach (arch "x86" "arm" "wasm32") + builtin_to_cpp(${bit} ${os_name} ${arch} "${supported_archs}" "${supported_oses}" res${bit}${os_name}${arch}) +@@ -428,7 +428,7 @@ function (generate_common_builtins resultList) + endforeach() + endforeach() + if (XE_ENABLED) +- foreach (bit 32 64) ++ foreach (bit 64) + builtin_xe_to_cpp(${bit} res_xe_${bit}) + list(APPEND tmpList ${res_xe_${bit}} ) + if(MSVC) +-- +2.17.1 + diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest new file mode 100644 index 00000000..77d13bb4 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +python3 run_tests.py diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.20.0.bb b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.20.0.bb new file mode 100644 index 00000000..4e607004 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.20.0.bb @@ -0,0 +1,74 @@ +SUMMARY = "Intel(R) Implicit SPMD Program Compiler" +DESCRIPTION = "ispc is a compiler for a variant of the C programming language, \ +with extensions for single program, multiple data programming." +HOMEPAGE = "https://github.com/ispc/ispc" + +LICENSE = "BSD-3-Clause & Apache-2.0-with-LLVM-exception" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=da5ecffdd210b3cf776b32b41c182e87 \ + file://third-party-programs.txt;md5=2061218c7be521556719c8b504bf9ddd" + +inherit cmake python3native ptest + +S = "${WORKDIR}/git" + +SRC_URI = "git://github.com/ispc/ispc.git;protocol=https;branch=main \ + file://0002-cmake-don-t-build-for-32-bit-targets.patch \ + file://0001-Fix-QA-Issues.patch \ + file://0001-Add-print-function-to-print-test-run-status-in-ptest.patch \ + file://run-ptest \ + " + +SRCREV = "14bd04aa7e68cd33eb1d96b33058cb64d7ef76f4" + +COMPATIBLE_HOST = '(x86_64).*-linux' + +DEPENDS += " clang-native bison-native flex-native" +DEPENDS:append:class-target = " clang" +RDEPENDS:${PN}-ptest += " python3-multiprocessing" + +PACKAGECONFIG ??= "tbb" +PACKAGECONFIG[tbb] = "-DISPCRT_BUILD_TASK_MODEL=TBB, -DISPCRT_BUILD_TASK_MODEL=OpenMP, tbb" + +YFLAGS='-d -t -v -y --file-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}' + +do_configure:prepend() { + sed -i -e 's#\${BISON_EXECUTABLE}.*#\${BISON_EXECUTABLE} ${YFLAGS} #g' ${S}/CMakeLists.txt + sed -i -e 's#\${FLEX_EXECUTABLE}.*#\${FLEX_EXECUTABLE} \-L #g' ${S}/CMakeLists.txt +} + +do_install_ptest() { + cp -rf ${S}/run_tests.py ${D}${PTEST_PATH} + cp -rf ${S}/common.py ${D}${PTEST_PATH} + cp -rf ${S}/tests ${D}${PTEST_PATH} + cp -rf ${S}/test_static.isph ${D}${PTEST_PATH} + cp -rf ${S}/fail_db.txt ${D}${PTEST_PATH} + cp -rf ${S}/test_static.cpp ${D}${PTEST_PATH} +} + +EXTRA_OECMAKE += " \ + -DISPC_INCLUDE_TESTS=OFF \ + -DISPC_INCLUDE_EXAMPLES=OFF \ + -DISPC_NO_DUMPS=ON \ + -DARM_ENABLED=OFF \ + -DISPC_CROSS=ON \ + -DISPC_ANDROID_TARGET=OFF \ + -DISPC_FREEBSD_TARGET=OFF \ + -DISPC_WINDOWS_TARGET=OFF \ + -DISPC_IOS_TARGET=OFF \ + -DISPC_PS4_TARGET=OFF \ + -DSYSROOT_DIR=${STAGING_DIR} \ + -DCLANG_EXECUTABLE=${STAGING_BINDIR_NATIVE}/clang \ + -DCLANGPP_EXECUTABLE=${STAGING_BINDIR_NATIVE}/clang++ \ + -DLLVM_DIS_EXECUTABLE=${STAGING_BINDIR_NATIVE}/llvm-dis \ + -DLLVM_AS_EXECUTABLE=${STAGING_BINDIR_NATIVE}/llvm-as \ + " + +FILES:${PN}-dev = "\ + ${libdir}/libispcrt_device_cpu${SOLIBSDEV} \ + ${libdir}/cmake \ + ${includedir} \ + " + +FILES:${PN} += "${libdir}/libispcrt.so" + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf