To allow the usage of parse_vdso.c together with a limited libc like
nolibc, use the kernels own elf.h and auxvec.h headers.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
tools/testing/selftests/vDSO/Makefile | 3 +++
tools/testing/selftests/vDSO/parse_vdso.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index 1cf14a8da43803249f72fe1b09689c8834806986..bc8ca186fb877dc11740c37f1e07e45e84c2ae92 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -19,6 +19,9 @@ LDLIBS += -lgcc_s
endif
include ../lib.mk
+
+CFLAGS += $(TOOLS_INCLUDES)
+
$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c
index 3638fe605e80ca41b29d43c6ac452964eef35d56..200c534cc70e2c2381fce3be5c0ebe4cb5675e84 100644
--- a/tools/testing/selftests/vDSO/parse_vdso.c
+++ b/tools/testing/selftests/vDSO/parse_vdso.c
@@ -19,7 +19,8 @@
#include <stdint.h>
#include <string.h>
#include <limits.h>
-#include <elf.h>
+#include <linux/auxvec.h>
+#include <linux/elf.h>
#include "parse_vdso.h"
--
2.48.1
On Wed, Feb 26, 2025 at 12:44:51PM +0100, Thomas Weißschuh wrote: > To allow the usage of parse_vdso.c together with a limited libc like > nolibc, use the kernels own elf.h and auxvec.h headers. The vDSO selftests currently fail build for at least arm64 in -next: CC vdso_test_gettimeofday CC vdso_test_getcpu CC vdso_test_abi CC vdso_test_clock_getres CC vdso_test_correctness CC vdso_test_getrandom CC vdso_test_chacha /build/stage/linux/tools/include/uapi/linux/types.h: Assembler messages: /build/stage/linux/tools/include/uapi/linux/types.h:9: Error: unknown mnemonic `typedef' -- `typedef __u16 __le16' /build/stage/linux/tools/include/uapi/linux/types.h:10: Error: unknown mnemonic `typedef' -- `typedef __u16 __be16' /build/stage/linux/tools/include/uapi/linux/types.h:11: Error: unknown mnemonic `typedef' -- `typedef __u32 __le32' /build/stage/linux/tools/include/uapi/linux/types.h:12: Error: unknown mnemonic `typedef' -- `typedef __u32 __be32' /build/stage/linux/tools/include/uapi/linux/types.h:13: Error: unknown mnemonic `typedef' -- `typedef __u64 __le64' /build/stage/linux/tools/include/uapi/linux/types.h:14: Error: unknown mnemonic `typedef' -- `typedef __u64 __be64' /build/stage/linux/tools/include/uapi/linux/types.h:16: Error: unknown mnemonic `typedef' -- `typedef __u16 __sum16' /build/stage/linux/tools/include/uapi/linux/types.h:17: Error: unknown mnemonic `typedef' -- `typedef __u32 __wsum' a bisect points at this patch, it looks like that's due to the switch to use TOOLS_INCLUDES but I didn't dig into the specifics.
On Thu, Mar 20, 2025 at 01:23:47PM +0000, Mark Brown wrote: > On Wed, Feb 26, 2025 at 12:44:51PM +0100, Thomas Weißschuh wrote: > > To allow the usage of parse_vdso.c together with a limited libc like > > nolibc, use the kernels own elf.h and auxvec.h headers. > The vDSO selftests currently fail build for at least arm64 in -next: ... > a bisect points at this patch, it looks like that's due to the switch to > use TOOLS_INCLUDES but I didn't dig into the specifics. This bug is now in mainline. A fix was posted by Thomas the day after the original report: https://lore.kernel.org/r/20250321-uapi-consistency-v1-1-439070118dc0@linutronix.de but it has apparently slipped through the cracks.
On 3/26/25 07:02, Mark Brown wrote: > On Thu, Mar 20, 2025 at 01:23:47PM +0000, Mark Brown wrote: >> On Wed, Feb 26, 2025 at 12:44:51PM +0100, Thomas Weißschuh wrote: >>> To allow the usage of parse_vdso.c together with a limited libc like >>> nolibc, use the kernels own elf.h and auxvec.h headers. > >> The vDSO selftests currently fail build for at least arm64 in -next: > > ... > >> a bisect points at this patch, it looks like that's due to the switch to >> use TOOLS_INCLUDES but I didn't dig into the specifics. > > This bug is now in mainline. A fix was posted by Thomas the day after > the original report: > > https://lore.kernel.org/r/20250321-uapi-consistency-v1-1-439070118dc0@linutronix.de > > but it has apparently slipped through the cracks. If this is going through tip Acked-by: Shuah Khan <skhan@linuxfoundation.org> Otherwise, I can send this up thanks, -- Shuah
On Fri, Mar 28, 2025 at 05:08:26PM -0600, Shuah Khan wrote: > On 3/26/25 07:02, Mark Brown wrote: > > This bug is now in mainline. A fix was posted by Thomas the day after > > the original report: > > https://lore.kernel.org/r/20250321-uapi-consistency-v1-1-439070118dc0@linutronix.de > > but it has apparently slipped through the cracks. > If this is going through tip > Acked-by: Shuah Khan <skhan@linuxfoundation.org> > Otherwise, I can send this up Given that this hasn't had a response from tip for several weeks it's probably as well for you to pick it up - I was considering sending it directly to Linus myself.
On Mon, Mar 31, 2025 at 12:56:26PM +0100, Mark Brown wrote: > On Fri, Mar 28, 2025 at 05:08:26PM -0600, Shuah Khan wrote: > > If this is going through tip > > Acked-by: Shuah Khan <skhan@linuxfoundation.org> > > Otherwise, I can send this up > Given that this hasn't had a response from tip for several weeks it's > probably as well for you to pick it up - I was considering sending it > directly to Linus myself. I tried sending a copy to Linus but he didn't respond yet, could you send it as part of a kselftest pull request? It'd be unfortunate to have a broken -rc1.
On 26/02/2025 11:44, Thomas Weißschuh wrote: > To allow the usage of parse_vdso.c together with a limited libc like > nolibc, use the kernels own elf.h and auxvec.h headers. > > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com> > --- > tools/testing/selftests/vDSO/Makefile | 3 +++ > tools/testing/selftests/vDSO/parse_vdso.c | 3 ++- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile > index 1cf14a8da43803249f72fe1b09689c8834806986..bc8ca186fb877dc11740c37f1e07e45e84c2ae92 100644 > --- a/tools/testing/selftests/vDSO/Makefile > +++ b/tools/testing/selftests/vDSO/Makefile > @@ -19,6 +19,9 @@ LDLIBS += -lgcc_s > endif > > include ../lib.mk > + > +CFLAGS += $(TOOLS_INCLUDES) > + > $(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c > $(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c > $(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c > diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c > index 3638fe605e80ca41b29d43c6ac452964eef35d56..200c534cc70e2c2381fce3be5c0ebe4cb5675e84 100644 > --- a/tools/testing/selftests/vDSO/parse_vdso.c > +++ b/tools/testing/selftests/vDSO/parse_vdso.c > @@ -19,7 +19,8 @@ > #include <stdint.h> > #include <string.h> > #include <limits.h> > -#include <elf.h> > +#include <linux/auxvec.h> > +#include <linux/elf.h> > > #include "parse_vdso.h" > > -- Regards, Vincenzo
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: c9fbaa879508ea36f5be0b3f1125b8f9f11b4945
Gitweb: https://git.kernel.org/tip/c9fbaa879508ea36f5be0b3f1125b8f9f11b4945
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Wed, 26 Feb 2025 12:44:51 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 03 Mar 2025 20:00:12 +01:00
selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers
To allow the usage of parse_vdso.c together with a limited libc like
nolibc, use the kernels own elf.h and auxvec.h headers.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/all/20250226-parse_vdso-nolibc-v2-12-28e14e031ed8@linutronix.de
---
tools/testing/selftests/vDSO/Makefile | 3 +++
tools/testing/selftests/vDSO/parse_vdso.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index 1cf14a8..bc8ca18 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -19,6 +19,9 @@ LDLIBS += -lgcc_s
endif
include ../lib.mk
+
+CFLAGS += $(TOOLS_INCLUDES)
+
$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c
index 3638fe6..200c534 100644
--- a/tools/testing/selftests/vDSO/parse_vdso.c
+++ b/tools/testing/selftests/vDSO/parse_vdso.c
@@ -19,7 +19,8 @@
#include <stdint.h>
#include <string.h>
#include <limits.h>
-#include <elf.h>
+#include <linux/auxvec.h>
+#include <linux/elf.h>
#include "parse_vdso.h"
© 2016 - 2025 Red Hat, Inc.