diff mbox series

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

Message ID 20240722131117.273274-1-wdouglass@carnegierobotics.com
State Changes Requested
Headers show
Series package/chicken: move literals into text section for xtensa architecture | expand

Commit Message

Woodrow Douglass July 22, 2024, 1:11 p.m. UTC
Signed-off-by: Woodrow Douglass <wdouglass@carnegierobotics.com>
---
 .../0001-xtensa-text-section-literals.patch   | 30 +++++++++++++++++++
 package/chicken/chicken.mk                    |  3 +-
 2 files changed, 31 insertions(+), 2 deletions(-)
 create mode 100644 package/chicken/0001-xtensa-text-section-literals.patch

Comments

Thomas Petazzoni July 22, 2024, 1:41 p.m. UTC | #1
Hello Woodrow,

On Mon, 22 Jul 2024 09:11:16 -0400
Woodrow Douglass via buildroot <buildroot@buildroot.org> wrote:

> Signed-off-by: Woodrow Douglass <wdouglass@carnegierobotics.com>

Thanks for the patch. Would be good to have a non-empty commit message.

> -# If ARCH is not set, it attempts to autodiscover. But it is anyway not used.
>  CHICKEN_MAKE_OPTS = \
> -	ARCH=unused \
> +	ARCH=$(BR2_NORMALIZED_ARCH) \

Are you sure that all values of BR2_NORMALIZED_ARCH are supported by
the chicken build system? What happens when the value passed is unknown
to the chicken build system?

Best regards,

Thomas
diff mbox series

Patch

diff --git a/package/chicken/0001-xtensa-text-section-literals.patch b/package/chicken/0001-xtensa-text-section-literals.patch
new file mode 100644
index 0000000000..b93aaf9e21
--- /dev/null
+++ b/package/chicken/0001-xtensa-text-section-literals.patch
@@ -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
+
diff --git a/package/chicken/chicken.mk b/package/chicken/chicken.mk
index 2667f7823d..8c7c1c4d8a 100644
--- a/package/chicken/chicken.mk
+++ b/package/chicken/chicken.mk
@@ -11,9 +11,8 @@  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_MAKE_OPTS = \
-	ARCH=unused \
+	ARCH=$(BR2_NORMALIZED_ARCH) \
 	C_COMPILER="$(TARGET_CC)" \
 	CXX_COMPILER="$(TARGET_CXX)" \
 	PREFIX=/usr \