* [Buildroot] [git commit] package/chicken: move literals into text section for xtensa architecture
@ 2024-08-02 17:06 Thomas Petazzoni via buildroot
2024-08-02 17:24 ` Max Filippov
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-02 17:06 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=86e51fd5fe2810bbf833b48c4914dcd2de01bdbe
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
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>
---
.../0001-xtensa-text-section-literals.patch | 30 ++++++++++++++++++++++
package/chicken/chicken.mk | 14 ++++++++--
2 files changed, 42 insertions(+), 2 deletions(-)
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..0520280134 100644
--- a/package/chicken/chicken.mk
+++ b/package/chicken/chicken.mk
@@ -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 \
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Buildroot] [git commit] package/chicken: move literals into text section for xtensa architecture
2024-08-02 17:06 [Buildroot] [git commit] package/chicken: move literals into text section for xtensa architecture Thomas Petazzoni via buildroot
@ 2024-08-02 17:24 ` Max Filippov
2024-08-02 17:43 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 6+ messages in thread
From: Max Filippov @ 2024-08-02 17:24 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
Hello,
On Fri, Aug 2, 2024 at 10:07 AM Thomas Petazzoni via buildroot
<buildroot@buildroot.org> wrote:
>
> commit: https://git.buildroot.net/buildroot/commit/?id=86e51fd5fe2810bbf833b48c4914dcd2de01bdbe
> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
>
> 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>
> ---
> .../0001-xtensa-text-section-literals.patch | 30 ++++++++++++++++++++++
> package/chicken/chicken.mk | 14 ++++++++--
> 2 files changed, 42 insertions(+), 2 deletions(-)
>
> 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
There's a stronger version of this option, -mauto-litpools, in the xtensa
TARGET_ABI and it is passed to the TARGET_CFLAGS. Why does
this package need special treatment?
> ++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..0520280134 100644
> --- a/package/chicken/chicken.mk
> +++ b/package/chicken/chicken.mk
> @@ -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 \
--
Thanks.
-- Max
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [git commit] package/chicken: move literals into text section for xtensa architecture
2024-08-02 17:24 ` Max Filippov
@ 2024-08-02 17:43 ` Thomas Petazzoni via buildroot
2024-08-02 18:00 ` Max Filippov
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-02 17:43 UTC (permalink / raw)
To: Max Filippov; +Cc: Woodrow Douglass, buildroot
Hello Max,
On Fri, 2 Aug 2024 10:24:20 -0700
Max Filippov <jcmvbkbc@gmail.com> wrote:
> > ++ifeq ($(ARCH),xtensa)
> > ++C_COMPILER_OPTIONS += -mtext-section-literals
> > ++LINKER_OPTIONS += -mtext-section-literals
>
> There's a stronger version of this option, -mauto-litpools, in the xtensa
> TARGET_ABI and it is passed to the TARGET_CFLAGS. Why does
> this package need special treatment?
It causes build failures:
http://autobuild.buildroot.net/results/ce36170d67c4702f34bee025d8a46e5269c4573e/
There's some explanation from the patch contributor in the commit
message BTW:
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.
Note: I'm not at all an expert with Xtensa, so I'd be happy to have
your input on this!
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [git commit] package/chicken: move literals into text section for xtensa architecture
2024-08-02 17:43 ` Thomas Petazzoni via buildroot
@ 2024-08-02 18:00 ` Max Filippov
2024-08-02 20:05 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 6+ messages in thread
From: Max Filippov @ 2024-08-02 18:00 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Woodrow Douglass, buildroot
On Fri, Aug 2, 2024 at 10:43 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> On Fri, 2 Aug 2024 10:24:20 -0700
> Max Filippov <jcmvbkbc@gmail.com> wrote:
>
> > > ++ifeq ($(ARCH),xtensa)
> > > ++C_COMPILER_OPTIONS += -mtext-section-literals
> > > ++LINKER_OPTIONS += -mtext-section-literals
> >
> > There's a stronger version of this option, -mauto-litpools, in the xtensa
> > TARGET_ABI and it is passed to the TARGET_CFLAGS. Why does
> > this package need special treatment?
>
> It causes build failures:
>
> http://autobuild.buildroot.net/results/ce36170d67c4702f34bee025d8a46e5269c4573e/
I see the following in the build-end.log:
/home/autobuild/autobuild/instance-2/output-1/per-package/chicken/host/bin/xtensa-buildroot-linux-uclibc-gcc
-fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H
-DC_ENABLE_PTABLES -c -Os -fomit-frame-pointer -fPIC -DPIC
-DC_BUILDING_LIBCHICKEN library.c -o library.o -I. -I./
There's no TARGET_CFLAGS in this command line.
> There's some explanation from the patch contributor in the commit
> message BTW:
>
> 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.
xtensa TARGET_ABI flag -mauto-litpool is there to address this specific issue.
--
Thanks.
-- Max
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [git commit] package/chicken: move literals into text section for xtensa architecture
2024-08-02 18:00 ` Max Filippov
@ 2024-08-02 20:05 ` Thomas Petazzoni via buildroot
2024-08-05 15:47 ` Woody Douglass via buildroot
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-02 20:05 UTC (permalink / raw)
To: Max Filippov; +Cc: Woodrow Douglass, buildroot
On Fri, 2 Aug 2024 11:00:02 -0700
Max Filippov <jcmvbkbc@gmail.com> wrote:
> > It causes build failures:
> >
> > http://autobuild.buildroot.net/results/ce36170d67c4702f34bee025d8a46e5269c4573e/
>
> I see the following in the build-end.log:
>
> /home/autobuild/autobuild/instance-2/output-1/per-package/chicken/host/bin/xtensa-buildroot-linux-uclibc-gcc
> -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H
> -DC_ENABLE_PTABLES -c -Os -fomit-frame-pointer -fPIC -DPIC
> -DC_BUILDING_LIBCHICKEN library.c -o library.o -I. -I./
>
> There's no TARGET_CFLAGS in this command line.
Hm, indeed!
So, Woodrow, could you have a look at the chicken build system, and why
our CFLAGS are not passed down to the build?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [git commit] package/chicken: move literals into text section for xtensa architecture
2024-08-02 20:05 ` Thomas Petazzoni via buildroot
@ 2024-08-05 15:47 ` Woody Douglass via buildroot
0 siblings, 0 replies; 6+ messages in thread
From: Woody Douglass via buildroot @ 2024-08-05 15:47 UTC (permalink / raw)
To: Thomas Petazzoni, Max Filippov; +Cc: buildroot@buildroot.org
On 8/2/24 16:05, Thomas Petazzoni wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
>
>
> On Fri, 2 Aug 2024 11:00:02 -0700
> Max Filippov <jcmvbkbc@gmail.com> wrote:
>
>>> It causes build failures:
>>>
>>> http://autobuild.buildroot.net/results/ce36170d67c4702f34bee025d8a46e5269c4573e/
>> I see the following in the build-end.log:
>>
>> /home/autobuild/autobuild/instance-2/output-1/per-package/chicken/host/bin/xtensa-buildroot-linux-uclibc-gcc
>> -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H
>> -DC_ENABLE_PTABLES -c -Os -fomit-frame-pointer -fPIC -DPIC
>> -DC_BUILDING_LIBCHICKEN library.c -o library.o -I. -I./
>>
>> There's no TARGET_CFLAGS in this command line.
> Hm, indeed!
>
> So, Woodrow, could you have a look at the chicken build system, and why
> our CFLAGS are not passed down to the build?
>
> Thanks!
>
> Thomas
I'll take a look and submit a patch hopefully later this week -- sorry
to have caused this. Not sure why this seemed to build on my machine (I
tested with buildroot's docker-run testing script)
Thanks,
Woodrow Douglass
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-08-05 15:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-02 17:06 [Buildroot] [git commit] package/chicken: move literals into text section for xtensa architecture Thomas Petazzoni via buildroot
2024-08-02 17:24 ` Max Filippov
2024-08-02 17:43 ` Thomas Petazzoni via buildroot
2024-08-02 18:00 ` Max Filippov
2024-08-02 20:05 ` Thomas Petazzoni via buildroot
2024-08-05 15:47 ` Woody Douglass via buildroot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.