Closed DaTurr3t closed 1 year ago
@mad-jsanjuan @mad-jrodriguez Please try to reproduce the described problem with RHEL 9.1 kernel 5.15 which we will official support with the next release.
Thanks for reporting this. We can reproduce now in our HW setups. We did not detect this before because our Red Hat system had 5.14.0-70.30.1.el9_0.x86_64
kernel package installed. I just updated the kernel and with this package we get the same error.
[men@G25-MEN RedHat5140162121el91x8664x8664]$ cd /usr/src/kernels/
[men@G25-MEN kernels]$ ls -al
total 8
drwxr-xr-x. 4 root root 77 Feb 1 09:21 .
drwxr-xr-x. 5 root root 62 Feb 17 06:49 ..
drwxr-xr-x. 24 root root 4096 Feb 1 09:21 5.14.0-162.12.1.el9_1.x86_64
drwxr-xr-x. 24 root root 4096 Feb 17 06:46 5.14.0-70.30.1.el9_0.x86_64
[men@G25-MEN kernels]$ find . -name stdarg.h
./5.14.0-162.12.1.el9_1.x86_64/include/linux/stdarg.h
It looks stdarg.sh
did not even exist in the older package. Is it possible our MDIS Makefiles were picking it from /usr/include?
Probably the best way to try to fix this is from our Makefiles. We will investigate and fix this.
I did some research and I think I found the actual problem. The file stdarg.h file did never exist in the Kernel sources until 5.15. Instead, whatever the toolchain includes provided was being used when doing #include <stdarg.h>
. Eg:
$ find /usr/ -name stdarg.h
/usr/lib/gcc/x86_64-redhat-linux/11/include/stdarg.h
Now, the kernel sources ship a minimal version of stdarg.h and this should be used when compiling in kernel space. So we will need include the correct header file for userspace and kernel space like so:
#ifdef __KERNEL__
#include <linux/stdarg.h>
#else
#include <stdarg.h>
#endif
This was introduced with this patch in the kernel tree: https://github.com/torvalds/linux/commit/c0891ac15f0428ffa81b2e818d416bdf3cb74ab6
For reference, here is exactly where the kernel prevent accidental inclusion of undesireable headers: https://github.com/torvalds/linux/commit/04e85bbf71c9072dcf0ad9a7150495d72461105c
So from kernel v5.16 is really where the #include <stdarg.h>
directive will stop working as it would be including things from the compilation toolchain and not the kernel sources.
Hello there!
I thought this had already been fixed on the mad-dev branch, but i had this error again on the latest commit (as of writing) of mad-dev. Whilst compiling MDIS5 for Red Hat Enterprise Linux 9 (Kernel 5.14.0-162.6.1.el9_1.x86_64), i encountered the compiler complaining that it was unable to find stdarg.h. Since at least kernel 5.14, stdarg.h has been moved from
/usr/src/linux/include/stdarg.h
to/usr/src/linux/include/linux/stdarg.h
.Modifying
INCLUDE/NATIVE/MEN/oss_os.h
to uselinux/stdarg.h
instead fails a bit further down the log with a similar error, probably due to different Include Paths.The workaround I use at the moment is to symlink the old location to the new one:
ln -s /usr/src/kernels/$(uname -r)/include/linux/stdarg.h /usr/src/kernels/$(uname -r)/include/stdarg.h
.Let me know if you need any further information.
Compilation Error log:
I added the following components to my makefile:
Thank you and kind regards Matthias