Skip to contentSkip to conversation

xtensa fixes for jasper

PATCH New Max Filippov 2 participants 4 messages May 19, 2015

lore
Share & tools
lore
#0 lore raw

cover xtensa fixes for jasper

Hi,

There are two patches: one makes jasper configure script preserve CFLAGS when --enable-debug is specified.

I was hoping that that'd be enough for jasper to build on xtensa, but unfortunately no: a bunch of one kind of literal-out-of-range errors is gone but a smaller bunch of other kind of the same error appeared. Xtensa gcc does nothing to place literals closer to their corresponding literal load instructions in functions with huge code size generated with -O0.

So the second patch disables debug for jasper when building for xtensa.

Max Filippov (2):
jasper: Don't overwrite CFLAGS when configured with --enable-debug
jasper: Disable debugging when building for xtensa

 package/jasper/0007-preserve-cflags.patch | 27 +++++++++++++++++++++++++++
 package/jasper/jasper.mk                  |  6 ++++++
 2 files changed, 33 insertions(+)
 create mode 100644 package/jasper/0007-preserve-cflags.patch
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/2 jasper: Don't overwrite CFLAGS when configured with --enable-debug

This drops architecture-specific ABI flags, which may be important.

---
 package/jasper/0007-preserve-cflags.patch | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 package/jasper/0007-preserve-cflags.patch
package/jasper/0007-preserve-cflags.patch new file +27 -0
new file mode 100644
index 0000000..7e4c4a2
@@ -0,0 +1,27 @@
+From: Max Filippov <[email protected]>
+Subject: Don't overwrite CFLAGS when configured with --enable-debug
+
+This drops architecture-specific ABI flags, which may be important.
+
+Signded-off-by: Max Filippov <[email protected]>
+
+--- jasper-1.900.1/configure.ac.orig	2015-05-18 22:27:53.057512760 +0300
++++ jasper-1.900.1/configure.ac	2015-05-18 22:28:36.090415422 +0300
+@@ -327,7 +327,7 @@
+ 	AC_DEFINE(DEBUG)
+ 	AC_DEFINE(DEBUG_OVERFLOW)
+ 	if test "$GCC" = yes; then
+-		CFLAGS="-g -O0"
++		CFLAGS="$CFLAGS -g -O0"
+ 	fi
+ 	;;
+ no)
+@@ -357,7 +357,7 @@
+ case "${enableval}" in
+ yes)
+ 	if test "$GCC" = yes; then
+-		CFLAGS="-g -O0"
++		CFLAGS="$CFLAGS -g -O0"
+ 	fi
+ 	;;
+ no)
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH 2/2 jasper: Disable debugging when building for xtensa

In reply to Max Filippov

xtensa gcc is not able to generate correct code when compiling with -O0 enabled by --enable-debug. Instead of disabling package build it with --disable-debug.

Fixes:
http://autobuild.buildroot.net/results/5d17055027055ffd33fcd28b208130afb26343c9/

---
 package/jasper/jasper.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/jasper/jasper.mk +6 -0
index b2da07d..db86ae8 100644
@@ -14,4 +14,10 @@ JASPER_LICENSE_FILES = LICENSE
 # needed to fix rpath issue (http://autobuild.buildroot.net/results/307/307cac65287420252a5bb64715d9a1edd90e72fa/)
 JASPER_AUTORECONF = YES
 
+# Xtensa gcc is unable to generate correct code with -O0 enabled by
+# --enable-debug. Allow package build but disable debug.
+ifeq ($(BR2_xtensa)$(BR2_ENABLE_DEBUG),yy)
+JASPER_CONF_OPTS += --disable-debug
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
1.8.1.4
#3 lore raw

cover xtensa fixes for jasper

In reply to Max Filippov
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Max" == Max Filippov <[email protected]> writes:

Hi,
There are two patches: one makes jasper configure script preserve CFLAGS when --enable-debug is specified.

I was hoping that that'd be enough for jasper to build on xtensa, but unfortunately no: a bunch of one kind of literal-out-of-range errors is gone but a smaller bunch of other kind of the same error appeared. Xtensa gcc does nothing to place literals closer to their corresponding literal load instructions in functions with huge code size generated with -O0.

Quoted 5 lines

So the second patch disables debug for jasper when building for xtensa.

Max Filippov (2):
jasper: Don't overwrite CFLAGS when configured with --enable-debug
jasper: Disable debugging when building for xtensa

Committed both, thanks.

Signature · 1 line
Bye, Peter Korsgaard