binutils: fix bfin build
authorWaldemar Brodkorb <wbx@openadk.org>
Sun, 21 Aug 2016 22:20:24 +0000 (00:20 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 23 Aug 2016 14:44:21 +0000 (16:44 +0200)
See gcc bug for details:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77311

Fixes:

  http://autobuild.buildroot.net/results/1e93be2fb02a3fb2731e48b0d9e54a0d4080a112/

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/binutils/binutils.mk

index 2936eb518a5c8129143af428e49d004ee5a10488..85663a8ce466261c5c52064341a9f5ac6f2043d9 100644 (file)
@@ -71,6 +71,12 @@ endif
 BINUTILS_CONF_ENV += ac_cv_prog_MAKEINFO=missing
 HOST_BINUTILS_CONF_ENV += ac_cv_prog_MAKEINFO=missing
 
+# gcc bug with Os/O2/O3, PR77311
+# error: unable to find a register to spill in class 'CCREGS'
+ifeq ($(BR2_bfin),y)
+BINUTILS_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -O1"
+endif
+
 # Install binutils after busybox to prefer full-blown utilities
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 BINUTILS_DEPENDENCIES += busybox