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?
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).
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
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.
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.
cross-binutils-2.26-4.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-46c27d920e
cross-binutils-2.26-4.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c3dc8b7bdf
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
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
cross-binutils-2.26-5.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-46c27d920e
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
cross-binutils-2.26-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-48f4d42d63
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
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.