On 24.09.21 10:45, Peng Fan wrote: >> Subject: Re: [PATCH 2/2] Kbuild: use toolchain stdarg.h >> >> On 17.09.21 09:46, Peng Fan (OSS) wrote: >>> From: Peng Fan <[email protected]> >>> >>> Linux Kernel has shipped a in-house stdarg.h under include/linux/ and >>> drop using the header files with -isystem. >>> >>> However jailhouse need to support multiple kernel versions, instead to >>> add Kernel version check in various source files, update to still use >>> toolchain stdarg.h with -isystem option. >>> >> >> Also here: 5.15+? >> >>> Signed-off-by: Peng Fan <[email protected]> >>> --- >>> Kbuild | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/Kbuild b/Kbuild >>> index 2863c121..fecf61f7 100644 >>> --- a/Kbuild >>> +++ b/Kbuild >>> @@ -58,6 +58,8 @@ subdir-y := hypervisor configs inmates tools >>> >>> obj-m := driver/ >>> >>> +NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) >>> +-print-file-name=include) >>> + >> >> Shouldn't we prepare for phasing this out at some point, i.e. indeed make >> these flags version-dependent? Would be a single point, no? > > Kernel put stdarg.h under include/linux/, so if need version check, I suppose > in .h/.c file, need add for all the files include stdarg.h > > #if xxx > #include <linux/stdarg.h> > #else > #include <stdarg.h> > #endif > > So I choose to use toolchain stdarg.h here.
We could carry a stub linux/stdarg.h in our include folder that pulls the toolchain stdarg.h for older kernels or does #include_next otherwise. Jan -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/caeffc84-ecdc-408d-b759-4294911af7cf%40web.de.
