New: building toolchain for sh4 fails
https://bugs.busybox.net/show_bug.cgi?id=6944
Summary: building toolchain for sh4 fails
Product: buildroot
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P5
Component: Other
AssignedTo: unassigned at buildroot.uclibc.org
ReportedBy: gdalex at gmail.com
CC: buildroot at uclibc.org
Estimated Hours: 0.0
Hello support,
I'm trying to build a toolchain for Renesas SH4.
The process fails at the end with the following log:
make[3]: Leaving directory /home/g/toolchain/output/build/host-gcc-final-4.7.3/build/gcc' make[2]: Leaving directory /home/g/toolchain/output/build/host-gcc-final-4.7.3/build'
make[1]: Leaving directory `/home/g/toolchain/output/build/host-gcc-final-4.7.3/build'
if [ ! -e /home/g/toolchain/output/host/usr/bin/sh4-buildroot-linux-gnu-cc ]; then ln -snf sh4-buildroot-linux-gnu-gcc /home/g/toolchain/output/host/usr/bin/sh4-buildroot-linux-gnu-cc; fi if [ ! -e /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/bin/cc ]; then ln -snf gcc /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/bin/cc; fi (cd /home/g/toolchain/output/host/usr/bin; for i in sh4-buildroot-linux-gnu-*; do ln -snf $i sh4-linux${i##sh4-buildroot-linux-gnu}; done)
cp -dpf /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libgcc_s* /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/sysroot/lib/
cp: cannot stat ?/home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libgcc_s*?: No such file or directory
make:
[/home/g/toolchain/output/build/host-gcc-final-4.7.3/.stamp_host_installed] Error 1 (ignored)
cp -dpf /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libgcc_s* /home/g/toolchain/output/target/lib/
cp: cannot stat ?/home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libgcc_s*?: No such file or directory
make:
[/home/g/toolchain/output/build/host-gcc-final-4.7.3/.stamp_host_installed] Error 1 (ignored)
mkdir -p /home/g/toolchain/output/target/usr/lib
for i in libstdc++ libmudflapth ; do cp -dpf /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/${i}.so* /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/sysroot/usr/lib/ ; cp -dpf /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/${i}.a /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/sysroot/usr/lib/ ; cp -dpf /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/${i}.so* /home/g/toolchain/output/target/usr/lib/ ; done
cp: cannot stat ?/home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libstdc++.so*?:
No such file or directory
cp: cannot stat ?/home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libstdc++.a?:
No such file or directory
cp: cannot stat ?/home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libstdc++.so*?:
No such file or directory
cp: cannot stat ?/home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libmudflapth.so*?:
No such file or directory
cp: cannot stat ?/home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libmudflapth.a?:
No such file or directory
cp: cannot stat ?/home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*/libmudflapth.so*?:
No such file or directory
make: *** [/home/g/toolchain/output/build/host-gcc-final-4.7.3/.stamp_host_installed] Error 1
g at g-ThinkPad-X220:~/toolchain/buildroot$
I'm using the SHA 5970e883419a55f25ea900d776287ae6ea34b62e from the buildroot git repo.
The build tries to copy everything that's under /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib*
Under that, I have only one folder named !m4
ls -la /home/g/toolchain/output/host/usr/sh4-buildroot-linux-gnu/lib* total 12
drwxr-xr-x 3 g g 4096 Mar 2 14:16 . drwxr-xr-x 6 g g 4096 Mar 2 14:23 .. drwxr-xr-x 2 g g 4096 Mar 2 18:56 !m4
I guess the ! sign confuses the copy command.
I started the build with this command: make O=../output toolchain
Attached is my config file.
Am I doing something wrong?
Cheers
George
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
https://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #1 from George <[email protected]> 2014-03-03 00:07:58 UTC --- Created attachment 5264
--> https://bugs.busybox.net/attachment.cgi?id=5264
config file for sh4 toolchain build
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #2 from Thomas Petazzoni <[email protected]> 2014-03-03 07:52:07 UTC --- Aah, glad to see we have a SuperH user!
This problem is well-known (at least to me). The issue is that gcc for SH4 insists on being multilib, to all the libraries are not directly in the sysroot but in some directory named "!m4" if I remember correctly. This confuses the Buildroot toolchain logic, which assumes the toolchain is not multilib.
Moreover, the other problem we have with SH4 is that to be able a kernel, you really need to have the m4-nofpu multilib variant, in addition to the m4 one. This is why configs/qemu_sh4_r2d_defconfig has this special configuration option:
BR2_EXTRA_GCC_CONFIG_OPTIONS="--with-multilib-list=m4,m4-nofpu"
At this point, I must say I am not sure how this problem should be fixed exactly.
Do you have some good knowledge of the SuperH architecture variants? That would be very helpful: we lack some contributors using SuperH and having some minimal knowledge of the architecture.
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #3 from George <[email protected]> 2014-03-04 13:00:59 UTC --- Created attachment 5270
--> https://bugs.busybox.net/attachment.cgi?id=5270
Fix the toolchain build for the SuperH architecture.
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #4 from George <[email protected]> 2014-03-04 13:02:09 UTC --- Hi,
I've attached a small patch that fixes the toolchain build for the SuperH architecture.
Could you take a look at it and if it's ok, add it into the git repo?
Cheers
George
(In reply to comment #3)
Quoted 2 lines
Created attachment 5270 [details]
Fix the toolchain build for the SuperH architecture.
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #5 from Thomas Petazzoni <[email protected]> 2014-03-04 19:57:20 UTC --- Thanks for the patch!
However, I am not sure it will work correctly in all cases. It works in your case because only one multilib variant gets built, and installed in the !m4 directory. But if you have BR2_EXTRA_GCC_CONFIG_OPTIONS="--with-multilib-list=m4,m4-nofpu", then two multilib variants will be built, and you will have two directories, not one.
Could you check this case?
It's also a bit annoying that on SuperH, specifying a custom gcc option is needed to even be able to build a kernel. Do you know if there's something that can be done about it?
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #6 from Thomas De Schampheleire <[email protected]> 2014-04-24 20:03:09 UTC --- Hi George,
Did you already find some time to look into this further?
Thanks a lot,
ThomasDS
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #7 from George <[email protected]> 2014-04-26 21:55:13 UTC --- Hi Thomas,
with my little patch, I was able to have a toolchain capable of building the whole rootfs for my board.
I did not use the BR2_EXTRA_GCC_CONFIG_OPTIONS, and to be honest, I don't understand why I'd need those.
I don't know what else to say. It works in my case, but I don't know if there are other cases that might not work.
Cheers
George
(In reply to comment #6)
Quoted 6 lines
Hi George,
Did you already find some time to look into this further?
Thanks a lot,
ThomasDS
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #8 from Thomas Petazzoni <[email protected]> 2014-04-29 05:21:57 UTC --- Did you try building an SH4 Linux kernel with the generated toolchain?
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #9 from George <[email protected]> 2014-05-02 17:22:26 UTC --- Yes, I was able to build using the default defconfig for ecovec24. I had to modify the ./arch/sh/Makefile in that kernel by removing the -m4-nofpu for sh4.
cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \
$(call cc-option,-mno-implicit-fp)Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #10 from Thomas Petazzoni <[email protected]> 2014-05-17 08:57:43 UTC --- (In reply to comment #9)
Quoted 7 lines
Yes, I was able to build using the default defconfig for ecovec24. I had to modify the
./arch/sh/Makefilein that kernel by removing the -m4-nofpu for sh4.cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \ $(call cc-option,-mno-implicit-fp)
Hum, right, but we don't want people to be forced to modify the kernel Makefiles in order to be able to build a SH4 kernel with a Buildroot toolchain. That isn't really nice, right?
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
--- Comment #11 from mail at waldemar-brodkorb.de 2014-09-09 17:01:53 UTC --- Hi,
I don't think removing m4-nofpu is the right thing to create a good kernel. As gcc does not include support for -mno-implicit-fp, there is no way around using
a multilib gcc to compile a kernel without floating point instructions.
See here for an interesting thread:
http://sourceforge.net/p/linuxsh/mailman/linuxsh-dev/thread/3B732B78.28B8BF39 at pocketpenguins.com/
It seems Codesourcery has some gcc patches included to support -mno-implicit-fp.
But the gcc people have rejected it.
best regards
Waldemar
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
[Buildroot] [Bug 6944] building toolchain for sh4 fails
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=6944
Thomas Petazzoni <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED--- Comment #12 from Thomas Petazzoni <[email protected]> 2015-06-03 01:29:53 UTC --- Fixed by
http://git.buildroot.net/buildroot/commit/package/gcc?id=19d5953bf15b9e68d083fc72bcd40b02b7ab810a.
Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.