I am having this issue while compiling hello.c. I tried the solution mentioned in the other issue as well. Please see the compilation results below:
PS: I noticed that I did not have riscv-elf folder in my /opt/riscv folder which has all the the standard libraries. What is wrong with the installation. I followed the steps here: https://riscv.org/software-tools/low-level-virtual-machine-llvm/
Compilation Results:
% clang -target riscv64 -mriscv=RV64IAMFD -S hello.c -o hello.S
gives:
In file included from hello.c:1:
In file included from /usr/include/stdio.h:27:
/usr/include/features.h:367:12: fatal error: 'sys/cdefs.h' file not found
#include
^
1 error generated.
% clang -target riscv -mriscv=RV64IAMFD -nostdinc -I/opt/riscv/riscv-elf/include -I/opt/riscv/lib/clang/3.9.0/include -S hello.c -o hello.S
gives:
hello.c:1:10: fatal error: 'stdio.h' file not found
#include
^
1 error generated.
and
% clang -target riscv64 -mriscv=RV64IAMFD -nostdinc -I/opt/riscv/riscv-elf/include -I/opt/riscv/lib/clang/3.9.0/include -S hello.c -o hello.S
gives:
hello.c:1:10: fatal error: 'stdio.h' file not found
#include
^
1 error generated.
I am having this issue while compiling hello.c. I tried the solution mentioned in the other issue as well. Please see the compilation results below:
PS: I noticed that I did not have riscv-elf folder in my /opt/riscv folder which has all the the standard libraries. What is wrong with the installation. I followed the steps here: https://riscv.org/software-tools/low-level-virtual-machine-llvm/
Compilation Results:
% clang -target riscv64 -mriscv=RV64IAMFD -S hello.c -o hello.S
gives:
In file included from hello.c:1:
In file included from /usr/include/stdio.h:27:
/usr/include/features.h:367:12: fatal error: 'sys/cdefs.h' file not found
#include
^
1 error generated.
% clang -target riscv -mriscv=RV64IAMFD -nostdinc -I/opt/riscv/riscv-elf/include -I/opt/riscv/lib/clang/3.9.0/include -S hello.c -o hello.S
gives:
hello.c:1:10: fatal error: 'stdio.h' file not found
#include
^
1 error generated.
and
% clang -target riscv64 -mriscv=RV64IAMFD -nostdinc -I/opt/riscv/riscv-elf/include -I/opt/riscv/lib/clang/3.9.0/include -S hello.c -o hello.S
gives:
hello.c:1:10: fatal error: 'stdio.h' file not found
#include
^
1 error generated.