diff options
Diffstat (limited to 'dynamic-layers/openembedded-layer/recipes-core/ispc')
5 files changed, 207 insertions, 0 deletions
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..4d583657 --- /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,53 @@ | |||
1 | From deccc0c69c2c8759c52885be8bdda54d3cee481c Mon Sep 17 00:00:00 2001 | ||
2 | From: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
3 | Date: Sun, 11 Dec 2022 22:34:15 +0800 | ||
4 | Subject: [PATCH] Add print function to print test run status in ptest format | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE ptest specific] | ||
7 | |||
8 | Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
9 | --- | ||
10 | run_tests.py | 16 ++++++++++++++++ | ||
11 | 1 file changed, 16 insertions(+) | ||
12 | |||
13 | diff --git a/run_tests.py b/run_tests.py | ||
14 | index 1cd796dd..e3ffd1ab 100755 | ||
15 | --- a/run_tests.py | ||
16 | +++ b/run_tests.py | ||
17 | @@ -327,6 +327,9 @@ def run_test(testname, host, target): | ||
18 | else: | ||
19 | ispc_exe_rel = add_prefix(host.ispc_cmd, host, target) | ||
20 | |||
21 | + # to reslove the error '.rodata' can not be used when making a PIE object | ||
22 | + ispc_exe_rel = ispc_exe_rel + " --pic" | ||
23 | + | ||
24 | # is this a test to make sure an error is issued? | ||
25 | want_error = (filename.find("tests_errors") != -1) | ||
26 | if want_error == True: | ||
27 | @@ -795,6 +798,17 @@ def check_compiler_exists(compiler_exe): | ||
28 | return | ||
29 | error("missing the required compiler: %s \n" % compiler_exe, 1) | ||
30 | |||
31 | +def print_test_run_status(results): | ||
32 | + for fstatus in results: | ||
33 | + if (fstatus[1] == Status.Success): | ||
34 | + print( "%s: %s" % ("PASS", fstatus[0])) | ||
35 | + elif (fstatus[1] == Status.Compfail): | ||
36 | + print( "%s: %s" % ("FAIL", fstatus[0])) | ||
37 | + elif (fstatus[1] == Status.Runfail): | ||
38 | + print( "%s: %s" % ("FAIL", fstatus[0])) | ||
39 | + elif (fstatus[1] == Status.Skip): | ||
40 | + print( "%s: %s" % ("SKIP", fstatus[0])) | ||
41 | + | ||
42 | def print_result(status, results, s, run_tests_log, csv): | ||
43 | title = StatusStr[status] | ||
44 | file_list = [fname for fname, fstatus in results if status == fstatus] | ||
45 | @@ -938,6 +952,8 @@ def run_tests(options1, args, print_version): | ||
46 | pass_rate = -1 | ||
47 | print_debug("PASSRATE (%d/%d) = %d%% \n\n" % (len(run_succeed_files), total_tests_executed, pass_rate), s, run_tests_log) | ||
48 | |||
49 | + print_test_run_status(results) | ||
50 | + | ||
51 | for status in Status: | ||
52 | print_result(status, results, s, run_tests_log, options.csv) | ||
53 | fails = [status != Status.Compfail and status != Status.Runfail for _, status in results] | ||
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..b0a76ff9 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 7beff95c11071170eb27b6fa7d0cc77588caee8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
3 | Date: Tue, 26 Jul 2022 15:25:10 +0800 | ||
4 | Subject: [PATCH] Fix QA Issues | ||
5 | |||
6 | Stop ispc from inserting host file path in generated headers which leads to reproducibility problems. | ||
7 | |||
8 | Upstream-Status: Inappropriate [OE build specific] | ||
9 | |||
10 | Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
11 | --- | ||
12 | src/module.cpp | 4 ++-- | ||
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/src/module.cpp b/src/module.cpp | ||
16 | index e2084d2e..e2626865 100644 | ||
17 | --- a/src/module.cpp | ||
18 | +++ b/src/module.cpp | ||
19 | @@ -2555,7 +2555,7 @@ bool Module::writeHeader(const char *fn) { | ||
20 | perror("fopen"); | ||
21 | return false; | ||
22 | } | ||
23 | - fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", fn); | ||
24 | + fprintf(f, "//\n// \n// (Header automatically generated by the ispc compiler.)\n"); | ||
25 | fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n"); | ||
26 | |||
27 | // Create a nice guard string from the filename, turning any | ||
28 | @@ -2677,7 +2677,7 @@ bool Module::writeDispatchHeader(DispatchHeaderInfo *DHI) { | ||
29 | FILE *f = DHI->file; | ||
30 | |||
31 | if (DHI->EmitFrontMatter) { | ||
32 | - fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", DHI->fn); | ||
33 | + fprintf(f, "//\n// \n// (Header automatically generated by the ispc compiler.)\n"); | ||
34 | fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n"); | ||
35 | } | ||
36 | // 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..f452dc50 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 16a2c22339287122d2c25d8bb33a5a51b4e6ee51 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Thu, 24 Feb 2022 20:01:11 +0530 | ||
4 | Subject: [PATCH] cmake: don't build for 32-bit targets | ||
5 | |||
6 | Error log: | ||
7 | | 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 | ||
8 | | #include <bits/long-double-32.h> | ||
9 | | ^~~~~~~~~~~~~~~~~~~~~~~ | ||
10 | | 1 error generated. | ||
11 | |||
12 | Remove SYSTEM include search path and set -isysroot dir path | ||
13 | for root dir for cross compilation. | ||
14 | |||
15 | Upstream-Status: Inappropriate | ||
16 | |||
17 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
18 | --- | ||
19 | cmake/GenerateBuiltins.cmake | 6 +++--- | ||
20 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
21 | |||
22 | diff --git a/cmake/GenerateBuiltins.cmake b/cmake/GenerateBuiltins.cmake | ||
23 | index f84494ed..d90cb1ec 100644 | ||
24 | --- a/cmake/GenerateBuiltins.cmake | ||
25 | +++ b/cmake/GenerateBuiltins.cmake | ||
26 | @@ -253,7 +253,7 @@ function(builtin_to_cpp bit os_name arch supported_archs supported_oses resultFi | ||
27 | # In this case headers will be installed in /usr/arm-linux-gnueabihf/include and will not be picked up | ||
28 | # by clang by default. So the following line adds such path explicitly. If this path doesn't exist and | ||
29 | # the headers can be found in other locations, this should not be a problem. | ||
30 | - set(includePath -isystem/usr/${debian_triple}/include) | ||
31 | + set(includePath -isysroot${SYSROOT_DIR}) | ||
32 | endif() | ||
33 | endif() | ||
34 | |||
35 | @@ -339,7 +339,7 @@ function (generate_target_builtins resultList) | ||
36 | set(regular_targets ${ARGN}) | ||
37 | list(FILTER regular_targets EXCLUDE REGEX wasm) | ||
38 | foreach (ispc_target ${regular_targets}) | ||
39 | - foreach (bit 32 64) | ||
40 | + foreach (bit 64) | ||
41 | foreach (os_name ${TARGET_OS_LIST_FOR_LL}) | ||
42 | target_ll_to_cpp(target-${ispc_target} ${bit} ${os_name} output${os_name}${bit}) | ||
43 | list(APPEND tmpList ${output${os_name}${bit}}) | ||
44 | @@ -405,7 +405,7 @@ function (generate_common_builtins resultList) | ||
45 | endif() | ||
46 | |||
47 | message (STATUS "ISPC will be built with support of ${supported_oses} for ${supported_archs}") | ||
48 | - foreach (bit 32 64) | ||
49 | + foreach (bit 64) | ||
50 | foreach (os_name "windows" "linux" "freebsd" "macos" "android" "ios" "ps4" "web") | ||
51 | foreach (arch "x86" "arm" "wasm") | ||
52 | builtin_to_cpp(${bit} ${os_name} ${arch} "${supported_archs}" "${supported_oses}" res${bit}${os_name}${arch}) | ||
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 @@ | |||
1 | #!/bin/sh | ||
2 | python3 run_tests.py | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb new file mode 100644 index 00000000..ed8df859 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb | |||
@@ -0,0 +1,64 @@ | |||
1 | SUMMARY = "Intel(R) Implicit SPMD Program Compiler" | ||
2 | DESCRIPTION = "ispc is a compiler for a variant of the C programming language, \ | ||
3 | with extensions for single program, multiple data programming." | ||
4 | HOMEPAGE = "https://github.com/ispc/ispc" | ||
5 | |||
6 | LICENSE = "BSD-3-Clause & Apache-2.0-with-LLVM-exception" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=da5ecffdd210b3cf776b32b41c182e87 \ | ||
8 | file://third-party-programs.txt;md5=2061218c7be521556719c8b504bf9ddd" | ||
9 | |||
10 | inherit cmake python3native ptest | ||
11 | |||
12 | S = "${WORKDIR}/git" | ||
13 | |||
14 | SRC_URI = "git://github.com/ispc/ispc.git;protocol=https;branch=main \ | ||
15 | file://0002-cmake-don-t-build-for-32-bit-targets.patch \ | ||
16 | file://0001-Fix-QA-Issues.patch \ | ||
17 | file://0001-Add-print-function-to-print-test-run-status-in-ptest.patch \ | ||
18 | file://run-ptest \ | ||
19 | " | ||
20 | |||
21 | SRCREV = "bcb2cf896c00f9a802a11cbf291ef6e44b205416" | ||
22 | |||
23 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
24 | |||
25 | DEPENDS += " clang-native bison-native flex-native" | ||
26 | DEPENDS:append:class-target = " clang" | ||
27 | RDEPENDS:${PN}-ptest += " python3-multiprocessing" | ||
28 | |||
29 | PACKAGECONFIG ??= "tbb" | ||
30 | PACKAGECONFIG[tbb] = "-DISPCRT_BUILD_TASK_MODEL=TBB, -DISPCRT_BUILD_TASK_MODEL=OpenMP, tbb" | ||
31 | |||
32 | YFLAGS='-d -t -v -y --file-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}' | ||
33 | |||
34 | do_configure:prepend() { | ||
35 | sed -i -e 's#\${BISON_EXECUTABLE}.*#\${BISON_EXECUTABLE} ${YFLAGS} #g' ${S}/CMakeLists.txt | ||
36 | sed -i -e 's#\${FLEX_EXECUTABLE}.*#\${FLEX_EXECUTABLE} \-L #g' ${S}/CMakeLists.txt | ||
37 | } | ||
38 | |||
39 | do_install_ptest() { | ||
40 | cp -rf ${S}/run_tests.py ${D}${PTEST_PATH} | ||
41 | cp -rf ${S}/common.py ${D}${PTEST_PATH} | ||
42 | cp -rf ${S}/tests ${D}${PTEST_PATH} | ||
43 | cp -rf ${S}/test_static.isph ${D}${PTEST_PATH} | ||
44 | cp -rf ${S}/fail_db.txt ${D}${PTEST_PATH} | ||
45 | cp -rf ${S}/test_static.cpp ${D}${PTEST_PATH} | ||
46 | } | ||
47 | |||
48 | EXTRA_OECMAKE += " \ | ||
49 | -DISPC_INCLUDE_TESTS=OFF \ | ||
50 | -DISPC_INCLUDE_EXAMPLES=OFF \ | ||
51 | -DARM_ENABLED=OFF \ | ||
52 | -DISPC_CROSS=ON \ | ||
53 | -DISPC_ANDROID_TARGET=OFF \ | ||
54 | -DISPC_FREEBSD_TARGET=OFF \ | ||
55 | -DISPC_WINDOWS_TARGET=OFF \ | ||
56 | -DISPC_IOS_TARGET=OFF \ | ||
57 | -DISPC_PS_TARGET=OFF \ | ||
58 | -DSYSROOT_DIR=${STAGING_DIR} \ | ||
59 | -DCLANG_EXECUTABLE=${STAGING_BINDIR_NATIVE}/clang \ | ||
60 | -DCLANGPP_EXECUTABLE=${STAGING_BINDIR_NATIVE}/clang++ \ | ||
61 | -DLLVM_AS_EXECUTABLE=${STAGING_BINDIR_NATIVE}/llvm-as \ | ||
62 | " | ||
63 | |||
64 | BBCLASSEXTEND = "native nativesdk" | ||