So, I have been keeping some languag packages for OpenWRT here,
mostly for fun:
(There are even BASIC and Algol compilers/interpreters there!)
Anyway -- I used to compile the 19.07 branch from git without problems.
When I saw that 21.02 was out, I moved to the openwrt-21.02 branch, and tried compiling again. And strangely, it won't compile gcc. It doesnt seem to find any headers:
checking whether we are using the GNU C++ compiler... no
checking whether x86_64-pc-linux-gnu-g++ accepts -g... no
checking for x86_64-pc-linux-gnu-gnatbind... no
checking for gnatbind... gnatbind
checking for x86_64-pc-linux-gnu-gnatmake... no
checking for gnatmake... gnatmake
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... /home/jeronimo/pkg/openwrt-19.07/staging_dir/host/bin/grep
checking for egrep... /home/jeronimo/pkg/openwrt-19.07/staging_dir/host/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... 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
make[3]: *** [Makefile:4193: configure-gcc] Error 1
make[3]: Leaving directory '/home/jeronimo/pkg/openwrt-19.07/build_dir/toolchain-mips_24kc_gcc-8.4.0_musl/gcc-8.4.0-initial'
make[2]: *** [Makefile:37: /home/jeronimo/pkg/openwrt-19.07/build_dir/toolchain-mips_24kc_gcc-8.4.0_musl/gcc-8.4.0-initial/.built] Error 2
make[2]: Leaving directory '/home/jeronimo/pkg/openwrt-19.07/toolchain/gcc/initial'
time: toolchain/gcc/initial/compile#1.94#1.46#5.09
ERROR: toolchain/gcc/initial failed to build.
make[1]: *** [toolchain/Makefile:97: toolchain/gcc/initial/compile] Error 1
make[1]: Leaving directory '/home/jeronimo/pkg/openwrt-19.07'`
make: *** [/home/jeronimo/pkg/openwrt-19.07/include/toplevel.mk:230: toolchain/install] Error 2
What could have been happening?
The method I used for compiling is
make clean && make tools/clean && make toolchain/clean
make menuconfig
./scripts/feeds update -a
./scripts/feeds install -a
make tools/install
make toolchain/install
Sounds like your buildhost is incompatible with the current gcc compilation requirements.
What is your host?
You should use something current like Ubuntu 20.04 or similar.
But you should also follow the advice and clean up the buildroot. Do "make dirclean", and rebuild the toold and toolchain. ( You seem to have done most of the steps individually, but you might do the normal make routine)
Additional idea is to remove .config to ensure that you start the OpenWrt config side from scratch.
I also got a fresh git checkout (hence a new .config).
But it still fails... This is Debian sid, so I'd expect it to have all recent dependencies. It's "sid" so not totally stable, but missing headers is something I wouldn't expect. Also, the headers are there!
-rw-r--r-- 1 root root 11893 May 1 17:56 /usr/include/inttypes.h
-rw-r--r-- 1 root root 8474 May 1 17:56 /usr/include/stdint.h
-rw-r--r-- 1 root root 42804 May 1 17:56 /usr/include/unistd.h
Thank you! I have tried your suggestions, but I already have all of those installed.
Next thing I'm trying is to do everything with a different user account (so as to check if something in my environment could be the problem). I'm waiting for it to finish...