By following our previous blog Build
GCC, we should be able to CROSS-BUILD GCC for
various ARM architectures. Today, we are building GCC 9.1.0 for Hikey 970, which
is of aarch64
architecture. (More details about aarch64 can be found
on ARM
architecture )
➜ aarch64 mkdir build-binutils ➜ aarch64 cd build-binutils lvision@hikey970:~/Downloads/Programming/GCC/build-binutils$ ../binutils-2.32/configure --prefix=/opt/aarch64 --enable-shared --enable-vtable-verify checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking target system type... aarch64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /bin/sed checking for gawk... gawk checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether g++ accepts -static-libstdc++ -static-libgcc... yes checking for gnatbind... gnatbind checking for gnatmake... gnatmake checking whether compiler driver understands Ada... no checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2 checking for objdir... .libs checking for isl 0.15 or later... yes checking for default BUILD_CONFIG... checking for --enable-vtable-verify... yes checking for bison... bison -y checking for bison... bison checking for gm4... no checking for gnum4... no checking for m4... m4 checking for flex... flex checking for flex... flex checking for makeinfo... makeinfo checking for expect... expect checking for runtest... no checking for ar... ar checking for as... as checking for dlltool... no checking for ld... ld checking for lipo... no checking for nm... nm checking for ranlib... ranlib checking for strip... strip checking for windres... no checking for windmc... no checking for objcopy... objcopy checking for objdump... objdump checking for readelf... readelf checking for cc... cc checking for c++... c++ checking for gcc... gcc checking for gfortran... gfortran checking for gccgo... gccgo checking for ar... ar checking for as... as checking for dlltool... no checking for ld... ld checking for lipo... no checking for nm... nm checking for objcopy... objcopy checking for objdump... objdump checking for ranlib... ranlib checking for readelf... readelf checking for strip... strip checking for windres... no checking for windmc... no checking where to find the target ar... just compiled checking where to find the target as... just compiled checking where to find the target cc... host tool checking where to find the target c++... host tool checking where to find the target c++ for libstdc++... host tool checking where to find the target dlltool... just compiled checking where to find the target gcc... host tool checking where to find the target gfortran... host tool checking where to find the target gccgo... host tool checking where to find the target ld... just compiled checking where to find the target lipo... host tool checking where to find the target nm... just compiled checking where to find the target objcopy... just compiled checking where to find the target objdump... just compiled checking where to find the target ranlib... just compiled checking where to find the target readelf... just compiled checking where to find the target strip... just compiled checking where to find the target windres... just compiled checking where to find the target windmc... just compiled checking whether to enable maintainer-specific portions of Makefiles... no configure: creating ./config.status config.status: creating Makefile ➜ build-binutils make -j4 ...... ➜ build-binutils make install ➜ build-binutils cd ..
➜ aarch64 mkdir -p build-gcc ➜ aarch64 cd build-gcc $ ../gcc-9.1.0/configure --prefix=/opt/aarch64 --enable-multiarch --enable-languages=c,c++,fortran,go --disable-multilib --disable-libvtv --enable-vtable-verify checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking target system type... aarch64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /bin/sed checking for gawk... gawk checking for libatomic support... yes checking for libitm support... yes checking for libsanitizer support... yes checking for libhsail-rt support... no checking for libphobos support... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether g++ accepts -static-libstdc++ -static-libgcc... yes checking for gnatbind... gnatbind checking for gnatmake... gnatmake checking whether compiler driver understands Ada... no checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2 checking for objdir... .libs checking for the correct version of gmp.h... yes checking for the correct version of mpfr.h... yes checking for the correct version of mpc.h... yes checking for the correct version of the gmp/mpfr/mpc libraries... yes checking for isl 0.15 or later... yes *** This configuration is not supported in the following subdirectories: gnattools target-libada target-libhsail-rt target-libphobos target-zlib target-libobjc target-liboffloadmic target-libvtv (Any other directories should still work fine.) checking for default BUILD_CONFIG... bootstrap-debug checking for --enable-vtable-verify... yes checking for bison... bison -y checking for bison... bison checking for gm4... no checking for gnum4... no checking for m4... m4 checking for flex... flex checking for flex... flex checking for makeinfo... makeinfo checking for expect... expect checking for runtest... no checking for ar... ar checking for as... as checking for dlltool... no checking for ld... ld checking for lipo... no checking for nm... nm checking for ranlib... ranlib checking for strip... strip checking for windres... no checking for windmc... no checking for objcopy... objcopy checking for objdump... objdump checking for otool... no checking for readelf... readelf checking for cc... cc checking for c++... c++ checking for gcc... gcc checking for gfortran... gfortran checking for gccgo... gccgo checking for gdc... no checking for ar... /opt/aarch64/aarch64-unknown-linux-gnu/bin/ar checking for as... /opt/aarch64/aarch64-unknown-linux-gnu/bin/as checking for dlltool... no checking for dlltool... no checking for ld... /opt/aarch64/aarch64-unknown-linux-gnu/bin/ld checking for lipo... no checking for lipo... no checking for nm... /opt/aarch64/aarch64-unknown-linux-gnu/bin/nm checking for objcopy... /opt/aarch64/aarch64-unknown-linux-gnu/bin/objcopy checking for objdump... /opt/aarch64/aarch64-unknown-linux-gnu/bin/objdump checking for otool... no checking for otool... no checking for ranlib... /opt/aarch64/aarch64-unknown-linux-gnu/bin/ranlib checking for readelf... /opt/aarch64/aarch64-unknown-linux-gnu/bin/readelf checking for strip... /opt/aarch64/aarch64-unknown-linux-gnu/bin/strip checking for windres... no checking for windres... no checking for windmc... no checking for windmc... no checking where to find the target ar... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target as... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target cc... just compiled checking where to find the target c++... just compiled checking where to find the target c++ for libstdc++... just compiled checking where to find the target dlltool... host tool checking where to find the target gcc... just compiled checking where to find the target gfortran... just compiled checking where to find the target gccgo... just compiled checking where to find the target gdc... host tool checking where to find the target ld... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target lipo... host tool checking where to find the target nm... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target objcopy... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target objdump... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target otool... host tool checking where to find the target ranlib... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target readelf... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target strip... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target windres... host tool checking where to find the target windmc... host tool checking whether to enable maintainer-specific portions of Makefiles... no configure: creating ./config.status config.status: creating Makefile ➜ build-gcc make -j4 all-gcc ➜ build-gcc make install-gcc ➜ build-gcc cd ..