From 9f1dfc1139e9972fdb81f66af4355321eb34caad Mon Sep 17 00:00:00 2001 From: Naveen Saini Date: Fri, 19 May 2023 15:48:48 +0800 Subject: ispc: fix run_tests.py test script Some testcases are currently failing with following error: /usr/bin/x86_64-poky-linux-ld: ./tests/static-array-init-1.ispc.o: relocation R_X86_64_32S against `.rodata.cst16' can not be used when making a PIE object; recompile with -fPIE /usr/bin/x86_64-poky-linux-ld: failed to set dynamic section sizes: bad value Backport patch. Signed-off-by: Naveen Saini Signed-off-by: Anuj Mittal --- ...uce-position-independent-code-for-testing.patch | 42 ++++++++++++++++++++++ .../clang-layer/recipes-core/ispc/ispc_1.17.0.bb | 1 + 2 files changed, 43 insertions(+) create mode 100644 dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-Produce-position-independent-code-for-testing.patch diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-Produce-position-independent-code-for-testing.patch b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-Produce-position-independent-code-for-testing.patch new file mode 100644 index 00000000..37dbd862 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-Produce-position-independent-code-for-testing.patch @@ -0,0 +1,42 @@ +From 14cfd056fe69dc652f824f31462033e82cd54513 Mon Sep 17 00:00:00 2001 +From: Arina Neshlyaeva +Date: Tue, 23 Aug 2022 15:26:21 -0700 +Subject: [PATCH] Produce position independent code for testing + +Upstream-Status: Backport [https://github.com/ispc/ispc/commit/522a7395d762c7f2a3b1f76c6f352b5e5977f08a] + +Signed-off-by: Arina Neshlyaeva +Signed-off-by: Naveen Saini +--- + run_tests.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/run_tests.py b/run_tests.py +index d4a40978..3520d376 100755 +--- a/run_tests.py ++++ b/run_tests.py +@@ -515,6 +515,11 @@ def run_test(testname, host, target): + cc_cmd = "%s -O2 -I. %s test_static.cpp -DTEST_SIG=%d -DTEST_WIDTH=%d %s -o %s" % \ + (options.compiler_exe, gcc_arch, match, width, obj_name, exe_name) + ++ # Produce position independent code for both c++ and ispc compilations. ++ # The motivation for this is that Clang 15 changed default ++ # from "-mrelocation-model static" to "-mrelocation-model pic", so ++ # we enable PIC compilation to have it consistently regardless compiler version. ++ cc_cmd += ' -fPIE' + if should_fail: + cc_cmd += " -DEXPECT_FAILURE" + +@@ -526,8 +531,7 @@ def run_test(testname, host, target): + match, width, exe_name) + exe_name = "./" + exe_name + cc_cmd += " -DTEST_ZEBIN" if options.ispc_output == "ze" else " -DTEST_SPV" +- +- ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --target=%s -DTEST_SIG=%d" % \ ++ ispc_cmd = ispc_exe_rel + " --pic --woff %s -o %s --arch=%s --target=%s -DTEST_SIG=%d" % \ + (filename, obj_name, options.arch, xe_target if target.is_xe() else options.target, match) + + if target.is_xe(): +-- +2.37.3 + diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.17.0.bb b/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.17.0.bb index b9b9ea50..c50d8ef3 100644 --- a/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.17.0.bb +++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.17.0.bb @@ -16,6 +16,7 @@ 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-Enable-LLVM-15.0-support.patch \ file://0001-CMakeLists.txt-allow-to-pick-llvm-config-from-usr-bi.patch \ + file://0001-Produce-position-independent-code-for-testing.patch \ " SRCREV = "7ad8429369a4d5ced6b524fdfffe623939d8fe9a" -- cgit v1.2.3-54-g00ecf