Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 2/3] Makefile.in: add -mtext-section-literals to xtensa ABI
Date: Sun, 30 Mar 2014 20:55:37 +0400	[thread overview]
Message-ID: <1396198538-32628-3-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1396198538-32628-1-git-send-email-jcmvbkbc@gmail.com>

Collecting literals into separate section can be advantageous if that
section is placed into DTCM at link time. This is applicable for code
running on bare metal, but makes no sense under linux, where userspace
is isolated from the physical memory details. OTOH placing literals into
separate section breaks build of huge source files, because l32r
instruction can only access literals in 256 KBytes range.

Add -mtext-section-literals into xtensa ABI to fix build issues of
packages with huge sources.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
Changes v1 -> v2:
- add comment to XTENSA_ABI variable explaining -mtext-section-literals usage

 package/Makefile.in | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index eea7043..a70e538 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -72,8 +72,17 @@ endif
 # 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.
+#
+# Use text-section-literals for Xtensa globally.
+# Collecting literals into separate section can be advantageous if that
+# section is placed into DTCM at link time. This is applicable for code
+# running on bare metal, but makes no sense under linux, where userspace
+# is isolated from the physical memory details. OTOH placing literals into
+# separate section breaks build of huge source files, because l32r
+# instruction can only access literals in 256 KBytes range.
+#
 ifeq ($(BR2_xtensa),y)
-TARGET_ABI += -mlongcalls
+TARGET_ABI += -mlongcalls -mtext-section-literals
 endif
 
 STAGING_SUBDIR = usr/$(GNU_TARGET_NAME)/sysroot
-- 
1.8.1.4

  parent reply	other threads:[~2014-03-30 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-30 16:55 [Buildroot] [PATCH v2 0/3] xtensa: add -mtext-section-literals to xtensa ABI Max Filippov
2014-03-30 16:55 ` [Buildroot] [PATCH v2 1/3] uclibc: add missing .literal_position directives Max Filippov
2014-03-30 16:55 ` Max Filippov [this message]
2014-03-30 16:55 ` [Buildroot] [PATCH v2 3/3] xtensa: remove -mtext-section-literals from individual package *.mk's Max Filippov
2014-03-30 17:30   ` Baruch Siach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396198538-32628-3-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox