From: Petr Vorel <petr.vorel@gmail.com>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: Hui Min Mina Chou <minachou@andestech.com>,
Khem Raj <raj.khem@gmail.com>,
ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] Add __clear_cache declaration for clang
Date: Sun, 12 Oct 2025 21:10:10 +0200 [thread overview]
Message-ID: <20251012191010.GA361831@pevik> (raw)
In-Reply-To: <Zmg9WZ1TitB7D_RC@yuki>
Hi Khem, Cyril,
> Hi!
> > __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);
> > | ^
> This sounds like a clnag bug. The __clear_cache() is a pre-defined
> function and as such the signature should be part of the compiler.
> Is the call even supported by clang19 on RISCV?
I think Cyril is correct. IMHO __clear_cache() on riscv64 was added in
https://github.com/llvm/llvm-project/commit/9d469b5988bfb1c2e99533f863b1f9eb5b0c58b7
which was added in llvmorg-20.1.0-rc1.
BTW we have m4 check for __clear_cache(), I'll send a patch.
Kind regards,
Petr
> > 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
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2025-10-12 19:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 5:56 [LTP] [PATCH] Add __clear_cache declaration for clang Khem Raj
2024-06-11 12:04 ` Cyril Hrubis
2025-10-12 19:10 ` Petr Vorel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251012191010.GA361831@pevik \
--to=petr.vorel@gmail.com \
--cc=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=minachou@andestech.com \
--cc=raj.khem@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.