[PATCH] x86/tools: Scope uapi include dirs to vdso2c
From: Achill Gilgenast
Date: Sun Jul 19 2026 - 16:23:03 EST
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@xxxxxxxxxxxxxxx
Signed-off-by: Achill Gilgenast <achill@xxxxxxxxxx>
---
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