I am building my own linux system from scratch.
As I am a beginner I don't know much about the error, and I've tried some ways, but still I am unable to solve this. I came across a step to compile gcc.
The command I used to compile is
CC=$LFS_TGT-gcc \
CXX=$LFS_TGT-g++\
AR=$LFS_TGT-ar \
RANLIB=$LFS_TGT-ranlib \
../gcc-7.3.0/configure \
--prefix=/tools \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--enable-languages=c,c++ \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-bootstrap \
--disable-libgomp
When I run make
it gives the following error
Configuring in ./gcc
configure: creating cache ./config.cache
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking LIBRARY_PATH variable... ok
checking GCC_EXEC_PREFIX variable... ok
checking whether to place generated files in the source directory... no
checking whether a default linker was specified... no
checking whether a default assembler was specified... no
checking for x86_64-pc-linux-gnu-gcc... x86_64-lfs-linux-gnu-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-lfs-linux-gnu-gcc accepts -g... yes
checking for x86_64-lfs-linux-gnu-gcc option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... no
checking whether x86_64-lfs-linux-gnu-g++AR=x86_64-lfs-linux-gnu-ar accepts -g... no
checking for x86_64-pc-linux-gnu-gnatbind... no
checking for x86_64-pc-linux-gnu-gnatmake... no
checking whether compiler driver understands Ada... no
checking how to run the C++ preprocessor... /lib/cpp
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 for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... no
checking how to run the C preprocessor... x86_64-lfs-linux-gnu-gcc -E
checking for inline... no
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 void *... 0
checking size of short... 0
checking size of int... 0
checking size of long... 0
checking for long long... no
checking for int8_t... no
checking for int16_t... no
checking for int32_t... no
checking for int64_t... no
checking for long long int... no
checking for intmax_t... no
checking for intptr_t... no
checking for uint8_t... no
checking for uint16_t... no
checking for uint32_t... no
checking for uint64_t... no
checking for unsigned long long int... no
checking for uintmax_t... no
checking for uintptr_t... no
configure: error: uint64_t or int64_t not found
Makefile:4186: recipe for target 'configure-gcc' failed
make[1]: *** [configure-gcc] Error 1
make[1]: Leaving directory '/mnt/lfs/sources/old-gcc'
Makefile:902: recipe for target 'all' failed
make: *** [all] Error 2
Can anyone help me to solve this? Any ideas are appreciated.
If you look at this output you will see "configure" is not able to find some headers :
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
And on my system I have this header file. So, I suspect, you're system need at this step to find those headers to be able to compile "gcc"
ls -l /usr/include/stdlib.h
-rw-r--r--. 1 root root 34030 Aug 7 2019 /usr/include/stdlib.h
Seem like you have try to say to "configure" that your header is located there :
--with-native-system-header-dir=/tools/include
Please double check configure.log if the right "-I" was used by the compiler, and this header exist.