mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.52k stars 2.37k forks source link

Compilation breaks when modifying one of the original files #229

Closed ddiegow closed 4 months ago

ddiegow commented 4 months ago

Whenever I modify one of the original files provided I start getting a lot of compiler errors of the type

In file included from kernel/fs.c:21:
kernel/stat.h:7:3: error: unknown type name ‘uint’

and

kernel/fs.c: In function ‘bzero’:
kernel/fs.c:51:3: error: implicit declaration of function ‘memset’ [-Werror=implicit-function-declaration]

These specific errors (50+ in total) were generated by the command

riscv64-linux-gnu-gcc -Wall -Werror -O -fno-omit-frame-pointer -ggdb -gdwarf-2 -DSOL_SYSCALL -DLAB_SYSCALL -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I. -fno-stack-protector -fno-pie -no-pie  -c -o kernel/fs.o kernel/fs.c

after modifying fs.c. I'm using Ubuntu 22.04 with qemu 6.2.0 and riscv64-linux-gnu-gcc 11.4.0