I am trying to build an aarch64 cross compiler for my Ubuntu 20.04 system. I am running into an issue after configuring and trying to build the toolchain. The source I am using is https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz
./configure --target=aarch64-linux-gnu --prefix=/usr/local
make -j4
Normally when there is some unmet dependency it is obvious in the logs. However, I am having trouble deciphering what is actually going wrong here. I see some compiler warnings (which I am not sure are related) and then make reports an error. The line before is:
as: 114: exec: -I: not found
So it seems like it is trying to run something that it cannot find? I’m not sure what file to be looking at to track this down. I looked in genchecksum.cc and genhooks.cc but don’t see anything immediately relevant on line 114.
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/matthew/gcc-12.2.0/build-x86_64-pc-linux-gnu/fixincludes'
make[2]: Entering directory '/home/matthew/gcc-12.2.0/build-x86_64-pc-linux-gnu/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[3]: Leaving directory '/home/matthew/gcc-12.2.0/host-x86_64-pc-linux-gnu/lto-plugin'
make[2]: Leaving directory '/home/matthew/gcc-12.2.0/host-x86_64-pc-linux-gnu/lto-plugin'
make[2]: Leaving directory '/home/matthew/gcc-12.2.0/build-x86_64-pc-linux-gnu/libcpp'
make[2]: Entering directory '/home/matthew/gcc-12.2.0/host-x86_64-pc-linux-gnu/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[2]: Leaving directory '/home/matthew/gcc-12.2.0/host-x86_64-pc-linux-gnu/libcpp'
make[2]: Entering directory '/home/matthew/gcc-12.2.0/host-x86_64-pc-linux-gnu/gcc'
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../.././gcc -I../.././gcc/build -I../.././gcc/../include -I../.././gcc/../libcpp/include
-o build/gengenrtl.o ../.././gcc/gengenrtl.cc
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../.././gcc -I../.././gcc/build -I../.././gcc/../include -I../.././gcc/../libcpp/include
-o build/sort.o ../.././gcc/sort.cc
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../.././gcc -I../.././gcc/build -I../.././gcc/../include -I../.././gcc/../libcpp/include
-o build/genhooks.o ../.././gcc/genhooks.cc
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../.././gcc -I../.././gcc/build -I../.././gcc/../include -I../.././gcc/../libcpp/include
-o build/genchecksum.o ../.././gcc/genchecksum.cc
../.././gcc/genhooks.cc: In function ‘void emit_documentation(const char*)’:
../.././gcc/genhooks.cc:111:17: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
111 | while (fscanf (f, "%*[^@]"), buf[0] = ' ',
| ~~~~~~~^~~~~~~~~~~~~
../.././gcc/genhooks.cc:120:14: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
120 | fscanf (f, "%999s", buf);
| ~~~~~~~^~~~~~~~~~~~~~~~~
../.././gcc/genhooks.cc:173:14: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
173 | fscanf (f, "%5[^ n]", buf);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~
../.././gcc/genhooks.cc:179:14: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
179 | fscanf (f, "%999s", buf);
| ~~~~~~~^~~~~~~~~~~~~~~~~
as: 114: exec: -I: not found
make[2]: *** [Makefile:2827: build/genchecksum.o] Error 1
make[2]: *** Waiting for unfinished jobs....
as: 114: exec: -I: not found
make[2]: *** [Makefile:2827: build/gengenrtl.o] Error 1
as: 114: exec: -I: not found
make[2]: *** [Makefile:2827: build/genhooks.o] Error 1
as: 114: exec: -I: not found
make[2]: *** [Makefile:2827: build/sort.o] Error 1
make[2]: Leaving directory '/home/matthew/gcc-12.2.0/host-x86_64-pc-linux-gnu/gcc'
make[1]: *** [Makefile:4620: all-gcc] Error 2
make[1]: Leaving directory '/home/matthew/gcc-12.2.0'
make: *** [Makefile:1034: all] Error 2
At this point I am not sure how to go about debugging this further. Is there an easy way to get more error information from the build? Thanks!