https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121336

            Bug ID: 121336
           Summary: cris-elf fails to build with binutils-2.45 due to
                    ambiguous --em option
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikpelinux at gmail dot com
  Target Milestone: ---

Attempting to build a cross to cris-elf with the recently released
binutils-2.45 fails:

> cris-unknown-elf-as --version
GNU assembler (GNU Binutils) 2.45
Copyright (C) 2025 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `cris-unknown-elf'.
> /tmp/gcc-15.1.0/configure --target=cris-unknown-elf --with-newlib ...
> make
...
checking for suffix of object files... configure: error: in
`/tmp/objdir/cris-unknown-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
make[1]: *** [Makefile:13138: configure-target-libgcc] Error 1
make[1]: Leaving directory '/tmp/objdir'
make: *** [Makefile:1042: all] Error 2
> cat config.log
...
configure:3792: checking for suffix of object files
configure:3814: /tmp/objdir/./gcc/xgcc -B/tmp/objdir/./gcc/
-B/tmp/cross-cris/cris-unknown-elf/bin/ -B/tmp/cross-cris/cris-unknown-elf/lib/
-isystem /tmp/cross-cris/cris-unknown-elf/include -isystem
/tmp/cross-cris/cris-unknown-elf/sys-include    -c -g -O2  conftest.c >&5
/tmp/cross-cris/cris-unknown-elf/bin/as: option '--em=criself' is ambiguous;
possibilities: '--emulation' '--emit-local-absolute'
...

The issue is that since the cris port was added to gcc back in 2001, it has
passed --em=criself to gas, as an abbreviation for --emulation=criself. 
binutils-2.45 however added the --emit-local-absolute option, resulting in gas
giving an error due to the ambiguity.

I have a patch (to be finalized once I have a PR number).

Reply via email to