mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/tools: Scope uapi include dirs to vdso2c
@ 2026-07-19 20:12 Achill Gilgenast
  0 siblings, 0 replies; only message in thread
From: Achill Gilgenast @ 2026-07-19 20:12 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Achill Gilgenast, stable, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin

With a76108d05ee1 ("x86/entry/vdso: Move vdso2c to arch/x86/tools"),
-I$(srctree)/include/uapi and -I$(srctree)/arch/$(SUBARCH)/include/uapi
were added to HOST_EXTRACFLAGS, which also applies to hostprogs like tools/insn_sanity.

As a result <asm/insn.h> -> <asm/byteorder.h> -> <linux/swab.h> now
resolves to include/uapi/linux/swab.h when building insn_sanity. However the
uapi header uses __attribute_const__ which is normally undefined.

	In file included from /home/achill/git/linux/include/uapi/linux/byteorder/little_endian.h:14,
	                 from /usr/include/asm/byteorder.h:5,
	                 from /home/achill/git/linux/tools/arch/x86/include/asm/insn.h:10,
	                 from /home/achill/git/linux/arch/x86/tools/insn_sanity.c:17:
	/home/achill/git/linux/include/uapi/linux/swab.h:48:15: error: unknown type name '__attribute_const__'; did you mean '__attribute__'?
	   48 | static inline __attribute_const__ __u16 __fswab16(__u16 val)
	      |               ^~~~~~~~~~~~~~~~~~~
	      |               __attribute__

So only include the uapi include dirs when building vdso2c.

Fixes: a76108d05ee1 ("x86/entry/vdso: Move vdso2c to arch/x86/tools")
Cc: stable@vger.kernel.org
Signed-off-by: Achill Gilgenast <achill@achill.org>
---
 arch/x86/tools/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile
index 39a183fffd04..24030dcc3243 100644
--- a/arch/x86/tools/Makefile
+++ b/arch/x86/tools/Makefile
@@ -38,8 +38,10 @@ $(obj)/insn_decoder_test.o: $(srctree)/tools/arch/x86/lib/insn.c $(srctree)/tool
 
 $(obj)/insn_sanity.o: $(srctree)/tools/arch/x86/lib/insn.c $(srctree)/tools/arch/x86/lib/inat.c $(srctree)/tools/arch/x86/include/asm/inat_types.h $(srctree)/tools/arch/x86/include/asm/inat.h $(srctree)/tools/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
 
-HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi \
-		    -I$(srctree)/arch/$(SUBARCH)/include/uapi
+HOST_EXTRACFLAGS += -I$(srctree)/tools/include
+
+HOSTCFLAGS_vdso2c.o += -I$(srctree)/include/uapi \
+	-I$(srctree)/arch/$(SUBARCH)/include/uapi
 
 hostprogs	+= relocs vdso2c
 relocs-objs	:= relocs_32.o relocs_64.o relocs_common.o
-- 
2.55.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-19 20:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-19 20:12 [PATCH] x86/tools: Scope uapi include dirs to vdso2c Achill Gilgenast

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®