I want to build xv6 on macOS, so I installed the cross-compiler toolchain i386-elf-gcc and i386-elf-gcc from a Homebrew Tap.
The problem is i386-elf-gcc cant link standard libraries while compiling. I tested on a simple c file, and got the following error.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
printf("d\n");
return 0;
}
Error:
> i386-elf-gcc --sysroot=usr/includes test.c
test.c:1:10: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^~~~~~~~~
compilation terminated.