Skip to contentSkip to conversation

xtensa: add config option to enable longcalls option

PATCH Superseded Chris Zankel 1 participant 1 message Nov 26, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 xtensa: add config option to enable longcalls option

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.

---
 arch/Config.in.xtensa |   17 +++++++++++++++++
 package/Makefile.in   |    6 ++++++
 2 files changed, 23 insertions(+)
arch/Config.in.xtensa +17 -0
index 60c03f5..2ab553e 100644
@@ -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
package/Makefile.in +6 -0
index 9fdc745..6a35126 100644
@@ -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_CPPFLAGS += -mlongcalls
+endif
+
 STAGING_DIR=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/sysroot
 
 TARGET_OPTIMIZATION:=$(call qstrip,$(BR2_TARGET_OPTIMIZATION))
Signature · 1 line
1.7.9.5