Voglio compilare uno dei file sorgente del kernel linux (/net/rds/recv.c) per questo, chiamare gcc come di seguito:
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
cc1 -E -quiet -nostdinc -v -imultiarch x86_64-linux-gnu
-iprefix ../lib/gcc/x86_64-linux-gnu/5/
-D __attribute__(x)=
-D __restrict= -D __extension__=
-D __asm__= -D __asm__(x)=
-D __const= -D __inline__=
-D __inline= -D __volatile__=
-D __builtin_va_list=int
-D __KERNEL__ -isystem /lib/modules/4.7.0-rc1+/build/
-isystem /home/username/Desktop/linux/include/
-isystem /home/username/Desktop/linux/usr/include/
-isystem /home/username/workspace/Repositories/4.7.0-rc1+-
headers/linux/arch/x86/include/
-isystem /home/username/workspace/Repositories/4.7.0-rc1+-
headers/linux/arch/x86/include/uapi/
-isystem /home/username/workspace/Repositories/4.7.0-rc1+-
headers/linux/arch/x86/include/generated/
-isystem /home/username/workspace/Repositories/4.7.0-rc1+-
headers/linux/arch/x86/include/generated/uapi/
-isystem /usr/lib/gcc/x86_64-linux-gnu/5/include/
-isystem /usr/include/
home/myfolder/linux/net/rds/recv.c -mtune=generic -march=x86-64 -std=c99 -
fstack-protector-strong -Wformat -Wformat-security
ma gcc mi restituisce errore:
/home/username/linux/include/linux/jiffies.h:40:3: error: #error Invalid
value of HZ.
# error Invalid value of HZ.
/home/username/linux/include/linux/jiffies.h:257:31: error: division by zero
in #if
#if !((((NSEC_PER_SEC << 2) / TICK_NSEC) << (SEC_JIFFIE_SC - 2)) &
0x80000000)
^
/home/username/linux/include/linux/jiffies.h:293:42: error: division by zero
in #if
#if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ)
^
/home/username/linux/include/linux/jiffies.h:366:20: error: division by
zero in #if
#if !(USEC_PER_SEC % HZ)
/home/username/linux/include/linux/mm_types.h:163:45: error: missing binary
operator before token "("
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS
. . .
come posso risolvere questi errori. grazie mille per il tuo aiuto.