diff options
author | Romain Naour <romain.naour@gmail.com> | 2016-09-04 16:14:00 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2016-09-04 17:42:25 +0200 |
commit | 49f574237983ae2e69e4a4c43df7be98902a63be (patch) | |
tree | 19031c8af41db1f13a4cc522de312bf13b8ef975 | |
parent | 26248571b625207a01e529aa439fdef49d2459dc (diff) | |
download | buildroot-49f574237983ae2e69e4a4c43df7be98902a63be.tar.gz buildroot-49f574237983ae2e69e4a4c43df7be98902a63be.zip |
package/binutils: Disable -Os for ARM cortex-M cpus
ERROR: reloc type R_ARM_THM_MOVW_ABS_NC unsupported in this context
ERROR: reloc type R_ARM_THM_MOVT_ABS unsupported in this context
2 bad relocscollect2: error: ld returned 1 exit status
Binutils build fine with -O1, -O2 or -O3.
Reported upstream:
https://sourceware.org/bugzilla/show_bug.cgi?id=20552
Fixes:
http://autobuild.buildroot.net/results/e72/e727e6e9cf361acc786acec192a88f5f5444a2f6
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r-- | package/binutils/binutils.mk | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk index ff90a16d83..97daeff0e6 100644 --- a/package/binutils/binutils.mk +++ b/package/binutils/binutils.mk @@ -77,6 +77,13 @@ ifeq ($(BR2_bfin),y) BINUTILS_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -O1" endif +# Workaround a build issue with -Os for ARM Cortex-M cpus. +# (Binutils 2.25.1 and 2.26.1) +# https://sourceware.org/bugzilla/show_bug.cgi?id=20552 +ifeq ($(BR2_ARM_CPU_ARMV7M)$(BR2_OPTIMIZE_S),yy) +BINUTILS_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -O2" +endif + # Install binutils after busybox to prefer full-blown utilities ifeq ($(BR2_PACKAGE_BUSYBOX),y) BINUTILS_DEPENDENCIES += busybox |