Signed-off-by: Khem Raj <raj.k...@gmail.com>
---
v2: Drop setting compiler-rt explicitly

 ...-__clear_cache-declaration-for-clang.patch | 32 +++++++++++++++++++
 meta/recipes-extended/ltp/ltp_20240524.bb     |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 
meta/recipes-extended/ltp/ltp/0001-Add-__clear_cache-declaration-for-clang.patch

diff --git 
a/meta/recipes-extended/ltp/ltp/0001-Add-__clear_cache-declaration-for-clang.patch
 
b/meta/recipes-extended/ltp/ltp/0001-Add-__clear_cache-declaration-for-clang.patch
new file mode 100644
index 00000000000..ade6a52b63f
--- /dev/null
+++ 
b/meta/recipes-extended/ltp/ltp/0001-Add-__clear_cache-declaration-for-clang.patch
@@ -0,0 +1,32 @@
+From 2d384f268791ecd5ff0f26c8137dd4de0a1c4566 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.k...@gmail.com>
+Date: Mon, 10 Jun 2024 22:52:56 -0700
+Subject: [PATCH] Add __clear_cache declaration for clang
+
+__clear_cache was enabled on RISCV recently with 
7352ba02390116f1cd6a9b583860ba28aa0a1b7a
+however it fails to compile with clang19 on RISCV
+With this error
+
+  hugemmap15.c:51:2: error: call to undeclared function '__clear_cache'; ISO 
C99 and later do not support implicit function declarations 
[-Wimplicit-function-declaration]
+      51 |         __clear_cache(p, p + COPY_SIZE);
+         |         ^
+
+Upstream-Status: Submitted 
[https://lists.linux.it/pipermail/ltp/2024-June/038762.html]
+Signed-off-by: Khem Raj <raj.k...@gmail.com>
+Cc: Hui Min Mina Chou <minac...@andestech.com>
+---
+ testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c 
b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c
+index a84ba6476..856e22ff3 100644
+--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c
++++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c
+@@ -21,6 +21,7 @@
+ 
+ #if defined(__clang__)
+       #pragma clang optimize off
++      void __clear_cache(void *start, void *end);
+ #endif
+ 
+ #define _GNU_SOURCE
diff --git a/meta/recipes-extended/ltp/ltp_20240524.bb 
b/meta/recipes-extended/ltp/ltp_20240524.bb
index 1aafed0bf59..7105154712f 100644
--- a/meta/recipes-extended/ltp/ltp_20240524.bb
+++ b/meta/recipes-extended/ltp/ltp_20240524.bb
@@ -28,6 +28,7 @@ SRCREV = "8f21ebba42216dbb7e8d44c23b4a977d6823f7a1"
 
 SRC_URI = 
"git://github.com/linux-test-project/ltp.git;branch=master;protocol=https \
            file://0001-Remove-OOM-tests-from-runtest-mm.patch \
+           file://0001-Add-__clear_cache-declaration-for-clang.patch \
            "
 
 S = "${WORKDIR}/git"
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200532): 
https://lists.openembedded.org/g/openembedded-core/message/200532
Mute This Topic: https://lists.openembedded.org/mt/106614545/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to