Bug 1296814 - sh binutils: Matching formats: elf32-sh-linux elf32-shl
Summary: sh binutils: Matching formats: elf32-sh-linux elf32-shl
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cross-binutils
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: David Howells
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-08 07:59 UTC by Michael S. Tsirkin
Modified: 2016-03-02 01:51 UTC (History)
2 users (show)

Fixed In Version: cross-binutils-2.26-6.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-02 01:51:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michael S. Tsirkin 2016-01-08 07:59:14 UTC
Description of problem:
building Linux for sh fails

Version-Release number of selected component (if applicable):
binutils-sh-linux-gnu-2.25.1-2.fc23.i686

How reproducible:
always

Steps to Reproduce:
1. git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
2. cd linux
3. export ARCH=sh
4. export CROSS_COMPILE=/usr/bin/sh-linux-gnu-
5. make sdk7786_defconfig
6. make

Actual results:
Many warnings of the form:
/usr/bin/sh-linux-gnu-nm: kernel/rcu/tree.o: File format is ambiguous
/usr/bin/sh-linux-gnu-nm: Matching formats: elf32-sh-linux elf32-shl
/usr/bin/sh-linux-gnu-objdump: kernel/rcu/tree.o: File format is ambiguous
/usr/bin/sh-linux-gnu-objdump: Matching formats: elf32-sh-linux elf32-shl

vmlinux is not produced
Expected results:

No warnings, vmlinux is produced.

Additional info:

Most people are probably doing linux on Fedora.
If there's a wish to support non-linux formats,
maybe they can be supported in a sepatate set of
binaries, to avoid ambiguity?

Comment 1 David Howells 2016-02-05 17:25:05 UTC
The SH cross-binutils is compiled with --enable-targets=sh4-linux,sh-elf,sh-linux.  Removing sh-elf doesn't make the "File format is ambiguous" warnings go away.

I have an SH4 cross-binutils+gcc also, but that doesn't like one of the options the kernel build passes in (-m4-nofpu).

Comment 2 Michael S. Tsirkin 2016-02-07 11:38:49 UTC
kernel.org has a working version.
https://www.kernel.org/pub/tools/crosstool/

I think it was built with just --target=sh4-linux
but I'm not sure. Ask the page owner?

Running it gives:

/opt/cross/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-nm --help
....
/opt/cross/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-nm: supported targets: elf32-sh-linux elf32-shbig-linux elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex


/opt/cross/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-ld -V
GNU ld (GNU Binutils) 2.22
  Supported emulations:
   shlelf_linux


$/opt/cross/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-objdump -i
BFD header file version (GNU Binutils) 2.22
elf32-sh-linux
 (header little endian, data little endian)
  sh
elf32-shbig-linux
 (header big endian, data big endian)
  sh
elf32-little
 (header little endian, data little endian)
  sh
elf32-big
 (header big endian, data big endian)
  sh
srec
 (header endianness unknown, data endianness unknown)
  sh
symbolsrec
 (header endianness unknown, data endianness unknown)
  sh
verilog
 (header endianness unknown, data endianness unknown)
  sh
tekhex
 (header endianness unknown, data endianness unknown)
  sh
binary
 (header endianness unknown, data endianness unknown)
  sh
ihex
 (header endianness unknown, data endianness unknown)
  sh

               elf32-sh-linux elf32-shbig-linux elf32-little elf32-big srec 
            sh elf32-sh-linux elf32-shbig-linux elf32-little elf32-big srec 

               symbolsrec verilog tekhex binary ihex 
            sh symbolsrec verilog tekhex binary ihex

Comment 3 David Howells 2016-02-08 12:09:55 UTC
Interesting: the default multilibs selection for gcc for sh for linux is:

    sh*-*-linux*) sh_multilibs=m1,m2,m2a,m3e,m4 ;;

in gcc/config.gcc, but the kernel wants m4-nofpu which isn't in that list.  Without that, -fm4-nofpu will incur an error from gcc.

What I'll do is split the sh[12] and sh4 toolchains and drop sh-elf support from cross-binutils.  The latter will fix the ambiguity issue.

Comment 4 David Howells 2016-02-08 12:20:42 UTC
Actually, splitting out the sh4 toolchain doesn't seem to be necessary, so I won't do that for now.  I'll just remove sh-elf support from cross-binutils.

Comment 5 Fedora Update System 2016-02-10 10:26:06 UTC
cross-binutils-2.26-4.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-46c27d920e

Comment 6 Fedora Update System 2016-02-10 10:26:06 UTC
cross-binutils-2.26-4.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c3dc8b7bdf

Comment 7 Fedora Update System 2016-02-10 18:22:58 UTC
cross-binutils-2.26-4.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c3dc8b7bdf

Comment 8 Fedora Update System 2016-02-10 18:51:02 UTC
cross-binutils-2.26-4.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-46c27d920e

Comment 9 Fedora Update System 2016-02-11 23:23:02 UTC
cross-binutils-2.26-5.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-46c27d920e

Comment 10 Fedora Update System 2016-02-14 16:24:00 UTC
cross-binutils-2.26-5.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-46c27d920e

Comment 11 Fedora Update System 2016-02-22 15:23:45 UTC
cross-binutils-2.26-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-48f4d42d63

Comment 12 Fedora Update System 2016-02-23 15:20:02 UTC
cross-binutils-2.26-6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-48f4d42d63

Comment 13 Fedora Update System 2016-03-02 01:51:24 UTC
cross-binutils-2.26-6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.