xtensa: add -mlongcalls to CFLAGS for xtensa

Submitted by Chris Zankel on Dec. 6, 2012, 5:36 a.m.

Details

Message ID 50c0320c.05bf440a.60fe.60b5@mx.google.com
State Accepted
Commit f7ccd30afbd989085be834b23ac2ea997c50b883
Headers show

Commit Message

Chris Zankel Dec. 6, 2012, 5:36 a.m.
The longcalls option allows calls across a greater range of addresses.

This option may degrade both code size and performance, but
the linker can generally optimize away the unnecessary overhead
when a call ends up within range

Signed-off-by: Chris Zankel <chris@zankel.net>
---
 package/Makefile.in |    9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Peter Korsgaard Dec. 10, 2012, 9:26 p.m.
>>>>> "Chris" == Chris Zankel <chris@zankel.net> writes:

 Chris> The longcalls option allows calls across a greater range of addresses.
 Chris> This option may degrade both code size and performance, but
 Chris> the linker can generally optimize away the unnecessary overhead
 Chris> when a call ends up within range

Committed, thanks.

Patch hide | download patch | download mbox

diff --git a/package/Makefile.in b/package/Makefile.in
index 9fdc745..98e7f7c 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -56,6 +56,15 @@  TARGET_ABI+=-mabi=spe -mfloat-gprs=double -Wa,-me500mc
 endif
 endif
 
+# Use longcalls option for Xtensa globally.
+# The 'longcalls' option allows calls across a greater range of addresses,
+# and is required for some packages. While this option can degrade both
+# code size and performance, the linker can usually optimize away the
+# overhead when a call ends up within a certain range.
+ifeq ($(BR2_xtensa),y)
+TARGET_ABI += -mlongcalls
+endif
+
 STAGING_DIR=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/sysroot
 
 TARGET_OPTIMIZATION:=$(call qstrip,$(BR2_TARGET_OPTIMIZATION))