Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] xtensa: add config option to enable longcalls option
@ 2012-12-03  8:58 Chris Zankel
  2012-12-03 13:09 ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Zankel @ 2012-12-03  8:58 UTC (permalink / raw)
  To: buildroot

The longcalls option allows calls across a greater range of addresses.

This option should be used when call targets can potentially be
out of range. It may degrade both code size and performance, but
the linker can generally optimize away the unnecessary overhead
when a call ends up within range.

This option is enabled by default.

Signed-off-by: Chris Zankel <chris@zankel.net>
---
 arch/Config.in.xtensa |   17 +++++++++++++++++
 package/Makefile.in   |    6 ++++++
 2 files changed, 23 insertions(+)

diff --git a/arch/Config.in.xtensa b/arch/Config.in.xtensa
index 60c03f5..a979108 100644
--- a/arch/Config.in.xtensa
+++ b/arch/Config.in.xtensa
@@ -35,3 +35,20 @@ config BR2_XTENSA_OVERLAY_DIR
 
 config BR2_ARCH
 	default "xtensa"	if BR2_xtensa
+
+menu "Target build options"
+
+config BR2_XTENSA_LONGCALLS
+	bool "Enable longcalls option"
+	default y
+	help
+	  Enable or disable transformation of call instructions to allow
+	  calls across a greater range of addresses.
+	  This option should be used when call targets can potentially be
+	  out of range. It may degrade both code size and performance, but
+	  the linker can generally optimize away the unnecessary overhead
+	  when a call ends up within range. 
+
+	  Should be enabled by default.
+
+endmenu
diff --git a/package/Makefile.in b/package/Makefile.in
index 9fdc745..b52d5e0 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -56,6 +56,12 @@ TARGET_ABI+=-mabi=spe -mfloat-gprs=double -Wa,-me500mc
 endif
 endif
 
+# Xtensa: The 'longcalls' option is required for large binary packages.
+# Use a global option for all packages for now.
+ifeq ($(BR2_XTENSA_LONGCALLS),y)
+TARGET_CFLAGS += -mlongcalls
+endif
+
 STAGING_DIR=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/sysroot
 
 TARGET_OPTIMIZATION:=$(call qstrip,$(BR2_TARGET_OPTIMIZATION))
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-04 21:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-03  8:58 [Buildroot] [PATCH v2] xtensa: add config option to enable longcalls option Chris Zankel
2012-12-03 13:09 ` Thomas Petazzoni
2012-12-04  8:36   ` czankel
2012-12-04  9:17     ` Thomas Petazzoni
2012-12-04 20:13       ` Peter Korsgaard
2012-12-04 20:40         ` Chris Zankel
2012-12-04 21:39           ` Thomas Petazzoni
2012-12-04 21:55             ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox