package/chicken: move literals into text section for xtensa architecture

This solves a build problem -- by default xtensa-gcc puts literals in a
different section of memory then the program text, and chicken is a very
literal-heavy program, so they don't all fit there. This avoids that problem.

Fixes:

  http://autobuild.buildroot.net/results/ce36170d67c4702f34bee025d8a46e5269c4573e/

Signed-off-by: Woodrow Douglass <wdouglass@carnegierobotics.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Woodrow Douglass
2024-07-22 13:31:36 -04:00
committed by Thomas Petazzoni
parent f0877f5f9d
commit 86e51fd5fe
2 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
From e8d177f4d4e1c6bc41787ea1621e323ff4ad493e Mon Sep 17 00:00:00 2001
From: Woodrow Douglass <wdouglass@carnegierobotics.com>
Date: Mon, 22 Jul 2024 08:50:37 -0400
Subject: [PATCH] Move literals into text section for xtensa architecture
Upstream: https://bugs.call-cc.org/ticket/1840
Signed-off-by: Woodrow Douglass <wdouglass@carnegierobotics.com>
---
Makefile.linux | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Makefile.linux b/Makefile.linux
index b628cda4..e97c2b94 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -52,6 +52,11 @@ USES_SONAME = yes
# architectures
+ifeq ($(ARCH),xtensa)
+C_COMPILER_OPTIONS += -mtext-section-literals
+LINKER_OPTIONS += -mtext-section-literals
+endif
+
ifeq ($(ARCH),x32)
C_COMPILER_OPTIONS += -mx32
LINKER_OPTIONS += -mx32
--
2.39.2

View File

@@ -11,9 +11,19 @@ CHICKEN_LICENSE_FILES = LICENSE
CHICKEN_CPE_ID_VENDOR = call-cc
CHICKEN_INSTALL_STAGING = YES
# If ARCH is not set, it attempts to autodiscover. But it is anyway not used.
# Chicken only uses the "arch" variable for some special-case compile
# arguments If it's empty, it tries to detect the arch host Filter out
# values that have an effect, or pass "unused" here
ifeq ($(NORMALIZED_ARCH),x86_64)
CHICKEN_ARCH = x86-64
else ifeq ($(NORMALIZED_ARCH),xtensa)
CHICKEN_ARCH = xtensa
else
CHICKEN_ARCH = unused
endif
CHICKEN_MAKE_OPTS = \
ARCH=unused \
ARCH="$(CHICKEN_ARCH)" \
C_COMPILER="$(TARGET_CC)" \
CXX_COMPILER="$(TARGET_CXX)" \
PREFIX=/usr \