I was trying to create my own Hosted GCC Cross Compiler, and I followed the following tutorials on OSDev:
https://wiki.osdev.org/OS_Specific_Toolchain
https://wiki.osdev.org/Hosted_GCC_Cross-Compiler
I reviewed the steps many times but there must be something that I did wrong.
I used binutils-2.30 and gcc-7.3.0, and my OS name is nuos, so I substituted all "myos" with "nuos" in the above two tutorials.
I have created my sysroot under $HOME/nuos/sysroot/, and under that I created "usr/include/" and I stored the header files from the git repo mentioned in
https://wiki.osdev.org/Hosted_GCC_Cross-Compiler : errno.h, stdio.h, stdlib.h, string.h, time.h, unistd.h, sys/types.h
The binutils compile and install successfully.
In case of GCC I use the following commands:
Code: Select all
mkdir build-gcc
cd build-gcc
../gcc-7.3.0-nuos/configure --target=x86_64-nuos --prefix="$PREFIX" --with-sysroot=$HOME/nuos/sysroot --enable-languages=c,c++
make all-gcc
make all-target-libgcc
Code: Select all
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown
checking size of double... 8
checking size of long double... 16
checking for inttypes.h... no
checking for stdint.h... no
checking for stdlib.h... yes
checking for ftw.h... no
checking for unistd.h... yes
checking for sys/stat.h... no
checking for sys/types.h... yes
checking for string.h... yes
checking for strings.h... no
checking for memory.h... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... no
checking whether decimal floating point is supported... no
configure: WARNING: decimal float is not supported for this target, ignored
checking whether fixed-point is supported... no
checking whether the compiler is configured for setjmp/longjmp exceptions... no
checking if the linker (/home/..../crossenv/src/build-gcc/./gcc/collect-ld) is GNU ld... yes
checking for thread model used by GCC... single
checking whether assembler supports CFI directives... yes
checking for target glibc version... 0.0
*** Configuration x86_64-pc-nuos not supported
Makefile:13391: recipe for target 'configure-target-libgcc' failed
make: *** [configure-target-libgcc] Error 1
Note: I was able to build a cross compiler from the same sources following https://wiki.osdev.org/GCC_Cross-Compiler.
I appreciate If anyone went through this problem or know how to fix that can help.
Thanks,
Karim.