I found this bug while trying to build cross-arm-android-linux-gnueabi/gcc-13.2.1_p20230826. Bug seems to have same symptoms as #506208. Steps to reproduce: 1. emerge -1av cross-arm-android-linux-gnueabi/gcc-13.2.1_p20230826 From the printed out build log from emerge: checking for arm-android-linux-gnueabi-ranlib... arm-android-linux-gnueabi-ranlib checking for arm-android-linux-gnueabi-strip... arm-android-linux-gnueabi-strip checking whether ln -s works... yes checking for arm-android-linux-gnueabi-gcc... /var/tmp/portage/cross-arm-android-linux-gnueabi/gcc-13.2.1_p20230826/work/build/./gcc/xgcc -B/var/tmp/portage/cross-arm-android-linux-gnueabi/gcc-13.2.1_p20230826/work/build/./gcc/ -B/usr/arm-android-linux-gnueabi/bin/ -B/usr/arm-android-linux-gnueabi/lib/ -isystem /usr/arm-android-linux-gnueabi/include -isystem /usr/arm-android-linux-gnueabi/sys-include checking for suffix of object files... configure: error: in `/var/tmp/portage/cross-arm-android-linux-gnueabi/gcc-13.2.1_p20230826/work/build/arm-android-linux-gnueabi/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details From the relevant config.log file: configure:3792: checking for suffix of object files configure:3814: /var/tmp/portage/cross-arm-android-linux-gnueabi/gcc-13.2.1_p20230826/work/build/./gcc/xgcc -B/var/tmp/portage/cross-arm-android-linux-gnueabi/gcc-13.2.1_p20230826/work/build/./gcc/ -B/usr/arm-android-linux-gnueabi/bin/ -B/usr/arm-android-linux-gnueabi/lib/ -isystem /usr/arm-android-linux-gnueabi/include -isystem /usr/arm-android-linux-gnueabi/sys-include -c -g -O2 conftest.c >&5 /var/tmp/portage/cross-arm-android-linux-gnueabi/gcc-13.2.1_p20230826/work/build/./gcc/as: line 114: exec: -m: invalid option exec: usage: exec [-cl] [-a name] [command [argument ...]] [redirection ...] configure:3818: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNU C Runtime Library" | #define PACKAGE_TARNAME "libgcc" | #define PACKAGE_VERSION "1.0" | #define PACKAGE_STRING "GNU C Runtime Library 1.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "http://www.gnu.org/software/libgcc/" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3832: error: in `/var/tmp/portage/cross-arm-android-linux-gnueabi/gcc-13.2.1_p20230826/work/build/arm-android-linux-gnueabi/libgcc': configure:3834: error: cannot compute suffix of object files: cannot compile See `config.log' for more details Problem seems to be in the gcc/as script. Rolling back from the error message. 112 ;; 113 *) 114 exec $original ${1+"$@"} 115 ;; 116 esac When I instrument that with an "echo $original" before line 114 it prints blank. Further up where original is set: 35 case "$invoked" in 36 as) 37 original=$ORIGINAL_AS_FOR_TARGET 38 prog=as-new$exeext 39 dir=gas 40 ;; 20 # Invoke as, ld or nm from the build tree. 21 22 ORIGINAL_AS_FOR_TARGET="" 23 ORIGINAL_LD_FOR_TARGET="" 24 ORIGINAL_LD_BFD_FOR_TARGET="/.bfd" I'm going to try to find a kludge to fix the ORIGINAL_AS_FOR_TARGET, but could really use some help from someone that knows how this is supposed to properly behave.
Created attachment 870488 [details] As script that has missing ORIGINAL_AS_FOR_TARGET
I think I've root caused this (testing now). There was no arm-android-linux-gnueabi-as, which is why the variable wasn't set. cross-.../binutils was installed. I ran the following bit showing that binutils wasn't setup for the target in question for some reason: $ binutils-config --list-profiles [1] arm-android-linux-gnueabi-2.41 [2] arm-android-linux-gnueabihf-2.41 * [3] arm-linux-eabi-2.40 * [4] x86_64-pc-linux-gnu-2.40 * So I ran: sudo binutils-config 1 And now there's an arm-android-linux-gnueabi-as. Testing now to confirm whether gcc will compile for it (running an emerge --resume which doesn't seem to run in exactly the same order, so not sure how long it will take to get to it).
This is a common issue where the GCC configure script doesn't really error out properly when it finds a tool is missing, so it ends up propagating down and just dying on a blank var when it tries to execute its value.