summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas De Schampheleire <patrickdepinguin@gmail.com>2013-10-13 11:45:04 (GMT)
committer Peter Korsgaard <peter@korsgaard.com>2013-10-14 11:01:23 (GMT)
commit61ac6731528bf2c6f0598da02d9134821bbb3b00 (patch)
tree9ff6a6aee8c3aa47df00fc3c1fa5e346e0010a6f
parentf8938bf47d06e445c86d02403122c39926f1d036 (diff)
downloadbuildroot-61ac6731528bf2c6f0598da02d9134821bbb3b00.tar.gz
buildroot-61ac6731528bf2c6f0598da02d9134821bbb3b00.tar.bz2
ruby: fix 'pcrel too far' build problem on SuperH architectures
The 'pcrel too far' problem detected in the autobuild on SuperH architectures, seems to be caused by the -Os optimization flag. Using standard optimization fixes the problem. Fixes http://autobuild.buildroot.net/results/bc36e051e06f596c2fafdd3cc3745bb34b73ace3/ Investigated-by: Lionel Orry <lionel.orry@gmail.com> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/ruby/ruby.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/package/ruby/ruby.mk b/package/ruby/ruby.mk
index 2188837..ea19008 100644
--- a/package/ruby/ruby.mk
+++ b/package/ruby/ruby.mk
@@ -15,6 +15,15 @@ HOST_RUBY_CONF_OPT = --disable-install-doc --with-out-ext=curses,readline
RUBY_LICENSE = Ruby or BSD-2c, BSD-3c, others
RUBY_LICENSE_FILES = LEGAL COPYING BSDL
+RUBY_CFLAGS = $(TARGET_CFLAGS)
+# With some SuperH toolchains (like Sourcery CodeBench 2012.09), ruby fails to
+# build with 'pcrel too far'. This seems to be caused by the -Os option we pass
+# by default. To fix the problem, use standard -O2 optimization instead.
+ifeq ($(BR2_sh)$(BR2_sh64),y)
+RUBY_CFLAGS += -O2
+endif
+RUBY_CONF_ENV = CFLAGS="$(RUBY_CFLAGS)"
+
# Force optionals to build before we do
ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
RUBY_DEPENDENCIES += berkeleydb