In my effort to build a GCC cross-compiler to build code for Android ARM, I have hit some assembler issues. The first error from the "make" is:
/home/skirby/android-29/arm-android-eabi/bin/as: unrecognized option '--64'
To get around this I added these (--with-as=/usr/bin/as and --with-ld=/usr/bin/ld) options to my configure. I did this because this assembler accepts the --64 flag.
But when I do this, the new make error is:
Fatal error: invalid -march= option: `armv5te'
And this happened because I checked the possible options for -march with /usr/bin/as and they are:
march=CPU[,+EXTENSION...]
generate code for CPU and EXTENSION, CPU is one of:
generic32, generic64, i386, i486, i586, i686,
pentium, pentiumpro, pentiumii, pentiumiii, pentium4,
prescott, nocona, core, core2, corei7, l1om, k1om,
iamcu, k6, k6_2, athlon, opteron, k8, amdfam10,
bdver1, bdver2, bdver3, bdver4, znver1, btver1,
btver2
None of these are ARM.
Can somebody please help me as to what I am doing wrong here. Thanks so much.
--Steve
=====================================================================================================================================
Case 1:
configure step:
/home/skirby/gcc-9.1.0/configure --prefix=/home/skirby/android-29 --disable-libquadmath --target=arm-android-eabi --with-gnu-as --with-gnu-ld --enable-languages=c,fortran --with-mpfr=/home/skirby/android-29 --with-gmp=/home/skirby/android-29 --with-mpc=/home/skirby/android-29 --disable-libssp --enable-threads --disable-nls --disable-libgomp --disable-shared --disable-tls --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --disable-nls --with-sysroot=/home/skirby/NDK/android-ndk-r20/platforms/android-29/arch-arm
Error from the make:
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 -fno-PIE -I. -Ibuild -I/home/skirby/gcc-9.1.0/gcc -I/home/skirby/gcc-9.1.0/gcc/build -I/home/skirby/gcc-9.1.0/gcc/../include -I/home/skirby/gcc-9.1.0/gcc/../libcpp/include \
-o build/genmodes.o /home/skirby/gcc-9.1.0/gcc/genmodes.c
/home/skirby/android-29/arm-android-eabi/bin/as: unrecognized option '--64'
=============================================================================
Case 2 (add --with-as=/usr/bin/as and --with-ld=/usr/bin/ld to configure):
configure --
/home/skirby/gcc-9.1.0/configure --prefix=/home/skirby/android-29 --disable-libquadmath --target=arm-android-eabi --with-gnu-as --with-gnu-ld --enable-languages=c,fortran --with-mpfr=/home/skirby/android-29 --with-gmp=/home/skirby/android-29 --with-mpc=/home/skirby/android-29 --disable-libssp --enable-threads --disable-nls --disable-libgomp --disable-shared --disable-tls --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --disable-nls --with-sysroot=/home/skirby/NDK/android-ndk-r20/platforms/android-29/arch-arm --with-as=/usr/bin/as --with-ld=/usr/bin/ld
Error from the make:
checking for arm-android-eabi-gcc... /home/skirby/build-gcc-arm/./gcc/xgcc -B/home/skirby/build-gcc-arm/./gcc/ -B/home/skirby/android-29/arm-android-eabi/bin/ -B/home/skirby/android-29/arm-android-eabi/lib/ -isystem /home/skirby/android-29/arm-android-eabi/include -isystem /home/skirby/android-29/arm-android-eabi/sys-include
checking for suffix of object files... configure: error: in `/home/skirby/build-gcc-arm/arm-android-eabi/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
checking config.log:
configure:3767: /home/skirby/build-gcc-arm/./gcc/xgcc -B/home/skirby/build-gcc-arm/./gcc/ -B/home/skirby/android-29/arm-android-eabi/bin/ -B/home/skirby/android-29/arm-android-eabi/lib/ -isystem /home/skirby/android-29/arm-android-eabi/include -isystem /home/skirby/android-29/arm-android-eabi/sys-include -c -g -O2 -g -Os conftest.c >&5
Assembler messages:
Fatal error: invalid -march= option: `armv5te'