View Single Post
2021-02-15, 23:40   #6
ewmayer
2ω=0

Sep 2002
República de California

2·5·1,163 Posts

Quote:
 Originally Posted by Dylan14 When I try to build on Arch Linux (which is presently on kernel version 5.10.16) the error I would get if I kept the include is: Code: platform.h:1307:12: fatal error: sys/sysctl.h: No such file or directory compilation terminated. This is using gcc 10.2.0. This would not be needed, if I was using the linux-lts kernel which is on version 5.4 and has the sysctl.h file - so doing my blanket patch is a bit risky - I should only run the patch if the kernel version is at least 5.5.
What is needed is some way of conditionally including the file only on OS/kernel combinations which support it. I dumped all the compiler predefines for one of my Ubuntu v19 systems, 'uname -a ' indicates it's kernel 5.3:

Linux ewmayer-NUC8i3CYS 5.3.0-59-generic #53-Ubuntu SMP Wed Jun 3 15:52:15 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)

...but I don't see any specific-Linux-version info in the GCC predefines.

Do me a favor - for your Arch Linux distro, cd to mlucas_v19.1/src and run the following command there:

gcc -dM -E align.h < /dev/null > predefs.txt

(The align.h header is just so both the system and Mlucas predefs get dumped). Attach the resulting predefs.txt file to a post.