From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Xi Ruoyao <xry111@xry111.site>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"loongarch@lists.linux.dev" <loongarch@lists.linux.dev>,
Jinyang He <hejinyang@loongson.cn>,
Tiezhu Yang <yangtiezhu@loongson.cn>,
Arnd Bergmann <arnd@arndb.de>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom
Date: Wed, 28 Aug 2024 13:36:03 +0200 [thread overview]
Message-ID: <Zs8Lo9IM9zO0iwXd@zx2c4.com> (raw)
In-Reply-To: <CAHmME9rpVOy7wteac6BS9N++rsEELA98QR-LEjWLD8MjSLoJvA@mail.gmail.com>
On Tue, Aug 27, 2024 at 05:29:56PM +0200, Jason A. Donenfeld wrote:
> On Tue, Aug 27, 2024 at 5:29 PM Xi Ruoyao <xry111@xry111.site> wrote:
> > Or, I can add $(KHDR_INCLUDES) but also keep
> > -isystem $(top_srcdir)/include/uapi, so "make -C tools/testing/selftests
> > TARGETS=vDSO" will still (happens to) work on x86 and ppc (without
> > headers in kernel-tree/usr).
>
> Oh, the porquenolosdos solution. That sounds good to me.
Does the below work for you?
From 0a769491e0193cdf9728a23d02be5e6be975b513 Mon Sep 17 00:00:00 2001
From: Xi Ruoyao <xry111@xry111.site>
Date: Wed, 28 Aug 2024 13:29:57 +0200
Subject: [PATCH] selftests/vDSO: use KHDR_INCLUDES to locate UAPI headers for
vdso_test_getrandom
Building test_vdso_getrandom currently leads to following issue:
In file included from /home/xry111/git-repos/linux/tools/include/linux/compiler_types.h:36,
from /home/xry111/git-repos/linux/include/uapi/linux/stddef.h:5,
from /home/xry111/git-repos/linux/include/uapi/linux/posix_types.h:5,
from /usr/include/asm/sigcontext.h:12,
from /usr/include/bits/sigcontext.h:30,
from /usr/include/signal.h:301,
from vdso_test_getrandom.c:14:
/home/xry111/git-repos/linux/tools/include/linux/compiler-gcc.h:3:2: error: #error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
3 | #error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
| ^~~~~
It's because the compiler_types.h inclusion in
include/uapi/linux/stddef.h is expected to be removed by the
header_install.sh script, as compiler_types.h shouldn't be used from
user space.
Add KHDR_INCLUDES before the existing include/uapi inclusion so that
usr/include takes precedence if it's populated.
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
tools/testing/selftests/vDSO/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index d1452c7d6d4f..13a626ef64f7 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -39,6 +39,7 @@ $(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl
$(OUTPUT)/vdso_test_getrandom: parse_vdso.c
$(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
+ $(KHDR_INCLUDES) \
-isystem $(top_srcdir)/include/uapi
$(OUTPUT)/vdso_test_chacha: $(top_srcdir)/tools/arch/$(ARCH)/vdso/vgetrandom-chacha.S
--
2.46.0
next prev parent reply other threads:[~2024-08-28 11:36 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 13:20 [PATCH v4 0/4] LoongArch: Implement getrandom() in vDSO Xi Ruoyao
2024-08-27 13:20 ` [PATCH v4 1/4] LoongArch: vDSO: Wire up getrandom() vDSO implementation Xi Ruoyao
2024-08-27 13:36 ` Xi Ruoyao
2024-08-27 13:49 ` Jason A. Donenfeld
2024-08-27 14:26 ` Xi Ruoyao
2024-08-27 14:30 ` Jason A. Donenfeld
2024-08-27 15:07 ` Xi Ruoyao
2024-08-28 14:26 ` Jason A. Donenfeld
2024-08-28 14:33 ` Jason A. Donenfeld
2024-08-27 13:20 ` [PATCH v4 2/4] selftests/vDSO: Add --cflags for pkg-config command querying libsodium Xi Ruoyao
2024-08-27 13:54 ` Jason A. Donenfeld
2024-08-27 13:20 ` [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom Xi Ruoyao
2024-08-27 13:58 ` Jason A. Donenfeld
2024-08-27 14:07 ` LEROY Christophe
2024-08-27 14:15 ` Jason A. Donenfeld
2024-08-27 14:41 ` Xi Ruoyao
2024-08-27 14:50 ` Christophe Leroy
2024-08-27 15:00 ` Jason A. Donenfeld
2024-08-27 15:05 ` Xi Ruoyao
2024-08-27 15:10 ` Jason A. Donenfeld
2024-08-27 15:28 ` Xi Ruoyao
2024-08-27 15:29 ` Jason A. Donenfeld
2024-08-28 11:36 ` Jason A. Donenfeld [this message]
2024-08-28 12:00 ` Xi Ruoyao
2024-08-27 15:12 ` Christophe Leroy
2024-08-27 13:20 ` [PATCH v4 4/4] selftests/vDSO: Enable vdso getrandom tests for LoongArch Xi Ruoyao
2024-08-27 14:00 ` Jason A. Donenfeld
2024-08-27 14:45 ` Xi Ruoyao
2024-08-27 13:51 ` [PATCH v4 0/4] LoongArch: Implement getrandom() in vDSO Jason A. Donenfeld
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=Zs8Lo9IM9zO0iwXd@zx2c4.com \
--to=jason@zx2c4.com \
--cc=arnd@arndb.de \
--cc=chenhuacai@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=hejinyang@loongson.cn \
--cc=kernel@xen0n.name \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=tglx@linutronix.de \
--cc=xry111@xry111.site \
--cc=yangtiezhu@loongson.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).