I installed `aarch64-none-elf-gcc` from gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf.tar.xz, and on my Ubuntu22.04 computer, I try to compile a source code that contain:
#if __has_include(<termios.h>) #include "termios.c" #endif
It found `<termios.h>`, but included it leads to:
<...>/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf/aarch64-none-elf/include/termios.h:4:10: fatal error: sys/termios.h: No such file or directory 4 | #include <sys/termios.h> | ^~~~~~~~~~~~~~~
What am I doing wrong ?
Notice that I am very new to cross compilation, so I may have missed something...
Same problem with arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf...
Hi!
The toolchain 'aarch64-none-elf-gcc' is for bare-metal targets, which use newlib as libc. This libc doesn't implement the POSIX functions for termios.
Use the toolchain 'aarch64-none-linux-gnu' instead, which uses the GNU libc. These libc supports termios.
Hope this helps.
Hi,
I understand that termios functions are not implemented for bare-metal targets, but I would then expect that either <termio.h> was not there (i.e. `__has_include` would be false) or that it could be included without giving an error... It seems that changing `sys` by `machine` in `termio.h` fix the problem, though...
Thank you very much for your answer, anyway.