diff options
author | Naveen Saini <naveen.kumar.saini@intel.com> | 2023-05-19 15:48:48 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2023-05-19 17:39:59 +0800 |
commit | 9f1dfc1139e9972fdb81f66af4355321eb34caad (patch) | |
tree | ff628a824fd51e590b9ec0c452fa9de20ec9a44c /dynamic-layers/clang-layer/recipes-core/ispc/ispc | |
parent | 597b894d37289dab7562a613a1f6d066deb69e77 (diff) | |
download | meta-intel-9f1dfc1139e9972fdb81f66af4355321eb34caad.tar.gz |
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 <naveen.kumar.saini@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'dynamic-layers/clang-layer/recipes-core/ispc/ispc')
-rw-r--r-- | dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-Produce-position-independent-code-for-testing.patch | 42 |
1 files changed, 42 insertions, 0 deletions
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 @@ | |||
1 | From 14cfd056fe69dc652f824f31462033e82cd54513 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arina Neshlyaeva <arina.neshlyaeva@intel.com> | ||
3 | Date: Tue, 23 Aug 2022 15:26:21 -0700 | ||
4 | Subject: [PATCH] Produce position independent code for testing | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/ispc/ispc/commit/522a7395d762c7f2a3b1f76c6f352b5e5977f08a] | ||
7 | |||
8 | Signed-off-by: Arina Neshlyaeva <arina.neshlyaeva@intel.com> | ||
9 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
10 | --- | ||
11 | run_tests.py | 8 ++++++-- | ||
12 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/run_tests.py b/run_tests.py | ||
15 | index d4a40978..3520d376 100755 | ||
16 | --- a/run_tests.py | ||
17 | +++ b/run_tests.py | ||
18 | @@ -515,6 +515,11 @@ def run_test(testname, host, target): | ||
19 | cc_cmd = "%s -O2 -I. %s test_static.cpp -DTEST_SIG=%d -DTEST_WIDTH=%d %s -o %s" % \ | ||
20 | (options.compiler_exe, gcc_arch, match, width, obj_name, exe_name) | ||
21 | |||
22 | + # Produce position independent code for both c++ and ispc compilations. | ||
23 | + # The motivation for this is that Clang 15 changed default | ||
24 | + # from "-mrelocation-model static" to "-mrelocation-model pic", so | ||
25 | + # we enable PIC compilation to have it consistently regardless compiler version. | ||
26 | + cc_cmd += ' -fPIE' | ||
27 | if should_fail: | ||
28 | cc_cmd += " -DEXPECT_FAILURE" | ||
29 | |||
30 | @@ -526,8 +531,7 @@ def run_test(testname, host, target): | ||
31 | match, width, exe_name) | ||
32 | exe_name = "./" + exe_name | ||
33 | cc_cmd += " -DTEST_ZEBIN" if options.ispc_output == "ze" else " -DTEST_SPV" | ||
34 | - | ||
35 | - ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --target=%s -DTEST_SIG=%d" % \ | ||
36 | + ispc_cmd = ispc_exe_rel + " --pic --woff %s -o %s --arch=%s --target=%s -DTEST_SIG=%d" % \ | ||
37 | (filename, obj_name, options.arch, xe_target if target.is_xe() else options.target, match) | ||
38 | |||
39 | if target.is_xe(): | ||
40 | -- | ||
41 | 2.37.3 | ||
42 | |||