summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/0001-Add-__clear_cache-declaration-for-clang.patch
blob: ade6a52b63ff8035637b417f259c64fb6a73feae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 2d384f268791ecd5ff0f26c8137dd4de0a1c4566 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@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.khem@gmail.com>
Cc: Hui Min Mina Chou <minachou@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