Skip to contentSkip to conversation

xtensa autobuild fixes

PATCH New Baruch Siach 2 participants 7 messages Feb 11, 2014

lore
Share & tools
lore
#0 lore raw

cover xtensa autobuild fixes

This series fixes a few xtensa specific build failures reported by the autobuild machine.

Baruch Siach (3):
gst1-libav: fix build for xtensa
coreutils: fix build against uclibc snapshot
gcc: xtensa: fix __builtin_frame_address use with shared libgcc

 package/coreutils/coreutils-01-spawn-uclibc.patch  | 43 ++++++++++++++++++++++
 package/coreutils/coreutils.mk                     |  3 ++
 .../4.7.3/850-xtensa-libgcc-linker-script.patch    | 29 +++++++++++++++
 .../4.8.2/850-xtensa-libgcc-linker-script.patch    | 29 +++++++++++++++
 package/gstreamer1/gst1-libav/gst1-libav.mk        |  8 ++++
 5 files changed, 112 insertions(+)
 create mode 100644 package/coreutils/coreutils-01-spawn-uclibc.patch
 create mode 100644 package/gcc/4.7.3/850-xtensa-libgcc-linker-script.patch
 create mode 100644 package/gcc/4.8.2/850-xtensa-libgcc-linker-script.patch
Signature · 1 line
1.8.5.3
#1 lore raw

PATCH 1/3 gst1-libav: fix build for xtensa

gst1-libav needs the same fix for xtensa like ffmpeg got in commit 4ec35e76b8a3 (ffmpeg: fix build for xtensa).

Fixes:
http://autobuild.buildroot.net/results/33f/33fcbb79809719f68f3ee2cdb0fcacad82b9e0eb/

---
 package/gstreamer1/gst1-libav/gst1-libav.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/gstreamer1/gst1-libav/gst1-libav.mk +8 -0
index 1c45acc7377a..a498f9ca257d 100644
@@ -83,4 +83,12 @@ endif
 GST1_LIBAV_CONF_OPT = \
 	--with-libav-extra-configure="$(GST1_LIBAV_CONF_EXTRA_OPT)"
 
+GST1_LIBAV_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_xtensa),y)
+GST1_LIBAV_CFLAGS += -mtext-section-literals
+endif
+
+GST1_LIBAV_CONF_ENV = CFLAGS="$(FFMPEG_CFLAGS)"
+
 $(eval $(autotools-package))
Signature · 1 line
1.8.5.3
#2 lore raw

PATCH 1/3 gst1-libav: fix build for xtensa

Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

gst1-libav needs the same fix for xtensa like ffmpeg got in commit 4ec35e76b8a3 (ffmpeg: fix build for xtensa).

Fixes:
http://autobuild.buildroot.net/results/33f/33fcbb79809719f68f3ee2cdb0fcacad82b9e0eb/

---
 package/gstreamer1/gst1-libav/gst1-libav.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/gstreamer1/gst1-libav/gst1-libav.mk +0 -0
index 1c45acc7377a..a498f9ca257d 100644

package/gstreamer1/gst1-libav/gst1-libav.mk endif · line 92

Quoted 10 lines
package/gstreamer1/gst1-libav/gst1-libav.mk +7 -0
@@ -83,4 +83,12 @@ endif
 GST1_LIBAV_CONF_OPT = \
 	--with-libav-extra-configure="$(GST1_LIBAV_CONF_EXTRA_OPT)"
 
+GST1_LIBAV_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_xtensa),y)
+GST1_LIBAV_CFLAGS += -mtext-section-literals
+endif
+
+GST1_LIBAV_CONF_ENV = CFLAGS="$(FFMPEG_CFLAGS)"

Committed with this fixed to use GST1_LIBAV_CFLAGS, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 2/3 coreutils: fix build against uclibc snapshot

In reply to Baruch Siach

uClibc development version adds support for POSIX spawn routines. However, unlike glibc these routines are in librt. This breaks gnulib autoconf detection. Teach gnulib autoconf to look for POSIX spawn in librt.

Fixes:
http://autobuild.buildroot.net/results/246/246b3778a1a646afd1c8b9c17b4579fb5a27120e/

---
 package/coreutils/coreutils-01-spawn-uclibc.patch | 43 +++++++++++++++++++++++
 package/coreutils/coreutils.mk                    |  3 ++
 2 files changed, 46 insertions(+)
 create mode 100644 package/coreutils/coreutils-01-spawn-uclibc.patch
package/coreutils/coreutils-01-spawn-uclibc.patch new file +43 -0
new file mode 100644
index 000000000000..47609b75bc08
@@ -0,0 +1,43 @@
+From 71cf16e435bf5db64abcf81a9dc6dc36ce37d58d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
+Date: Tue, 14 Jan 2014 16:59:07 +0000
+Subject: [PATCH] spawn: fix link error on uclibc
+
+* m4/spawn_h.m4 (gl_HAVE_POSIX_SPAWN): use AC_SEARCH_LIBS,
+to incorporate -lrt if needed (on uclibc for example).
+* modules/posix_spawn: Reference the substituted LIB.
+
+Patch status: suggested by gnulib maintainer
+(http://article.gmane.org/gmane.comp.lib.gnulib.bugs/33610), not in upstream
+gnulib yet
+
+This issue should be fixed in coreutils version 2.23.
+
+Sign-off-by: Baruch Siach <[email protected]>
+---
+
+diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4
+index 87fe122..3eb835c 100644
+--- a/m4/spawn_h.m4
++++ b/m4/spawn_h.m4
+@@ -64,7 +64,15 @@ AC_DEFUN([gl_HAVE_POSIX_SPAWN],
+   dnl once only, before all statements that occur in other macros.
+   AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
+ 
+-  AC_CHECK_FUNCS_ONCE([posix_spawn])
++  LIB_POSIX_SPAWN=
++  AC_SUBST([LIB_POSIX_SPAWN])
++  gl_saved_libs=$LIBS
++    AC_SEARCH_LIBS([posix_spawn], [rt],
++                   [test "$ac_cv_search_posix_spawn" = "none required" ||
++                    LIB_POSIX_SPAWN=$ac_cv_search_posix_spawn])
++    AC_CHECK_FUNCS([posix_spawn])
++  LIBS=$gl_saved_libs
++
+   if test $ac_cv_func_posix_spawn != yes; then
+     HAVE_POSIX_SPAWN=0
+   fi
+ 
+-- 
+1.7.7.6
+
package/coreutils/coreutils.mk +3 -0
index e0e9d80b3989..72087523f413 100644
@@ -10,6 +10,9 @@ COREUTILS_SOURCE = coreutils-$(COREUTILS_VERSION).tar.xz
 COREUTILS_LICENSE = GPLv3+
 COREUTILS_LICENSE_FILES = COPYING
 
+# patching gnulib .m4 file
+COREUTILS_AUTORECONF = YES
+
 # If both coreutils and busybox are selected, make certain coreutils
 # wins the fight over who gets to have their utils actually installed.
 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
Signature · 1 line
1.8.5.3
#4 lore raw

PATCH 2/3 coreutils: fix build against uclibc snapshot

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

uClibc development version adds support for POSIX spawn routines. However, unlike glibc these routines are in librt. This breaks gnulib autoconf detection. Teach gnulib autoconf to look for POSIX spawn in librt.

Fixes:
http://autobuild.buildroot.net/results/246/246b3778a1a646afd1c8b9c17b4579fb5a27120e/

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 3/3 gcc: xtensa: fix __builtin_frame_address use with shared libgcc

In reply to Baruch Siach

The xtensa port uses __xtensa_libgcc_window_spill in libgcc to implement __builtin_frame_address. This symbol is local/hidden in libgcc. This is not a problem when linking against static libgcc. But g++ defaults to -shared-libgcc, thus breaking link against C++ shared libraries that are using __builtin_frame_address as follows:

ld: test: hidden symbol `__xtensa_libgcc_window_spill' in .../libgcc.a(lib2funcs.o) is referenced by DSO

Add upstream patches that make libgcc_s.so a linker script that links in unresolved symbols from the static libgcc, similar to the ARM and PowerPC ports.

Fixes:
http://autobuild.buildroot.net/results/e2d/e2d1a763fa86b8575e2e48e6d73c018175f43e7c/

---
 .../4.7.3/850-xtensa-libgcc-linker-script.patch    | 29 ++++++++++++++++++++++
 .../4.8.2/850-xtensa-libgcc-linker-script.patch    | 29 ++++++++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 package/gcc/4.7.3/850-xtensa-libgcc-linker-script.patch
 create mode 100644 package/gcc/4.8.2/850-xtensa-libgcc-linker-script.patch
package/gcc/4.7.3/850-xtensa-libgcc-linker-script.patch new file +29 -0
new file mode 100644
index 000000000000..6ffa897863fd
@@ -0,0 +1,29 @@
+From a89db366b98fffc61b20074e658c7285fb302776 Mon Sep 17 00:00:00 2001
+Message-Id: <a89db366b98fffc61b20074e658c7285fb302776.1392126646.git.baruch@tkos.co.il>
+From: sterling <sterling@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 21 Jan 2014 19:29:23 +0000
+Subject: [PATCH] 2014-01-21  Baruch Siach <[email protected]>
+
+	* config.host (tmake_file): add t-slibgcc-libgcc for xtensa*-*-linux*.
+
+Patch status: upstream (4.7 branch commit r206898)
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+
+diff --git a/libgcc/config.host b/libgcc/config.host
+index e18e1d25021d..a6f7c450d702 100644
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -1127,7 +1127,7 @@ xtensa*-*-elf*)
+ 	extra_parts="$extra_parts crti.o crtn.o"
+ 	;;
+ xtensa*-*-linux*)
+-	tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux"
++	tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
+ 	md_unwind_header=xtensa/linux-unwind.h
+ 	;;
+ am33_2.0-*-linux*)
+-- 
+1.8.5.3
+
package/gcc/4.8.2/850-xtensa-libgcc-linker-script.patch new file +29 -0
new file mode 100644
index 000000000000..378445da3904
@@ -0,0 +1,29 @@
+From 7c722c07a0781e4279f643650bc528422c80ce5e Mon Sep 17 00:00:00 2001
+Message-Id: <7c722c07a0781e4279f643650bc528422c80ce5e.1392126765.git.baruch@tkos.co.il>
+From: sterling <sterling@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 21 Jan 2014 19:50:02 +0000
+Subject: [PATCH] 2014-01-21  Baruch Siach <[email protected]>
+
+	* config.host (tmake_file): add t-slibgcc-libgcc for xtensa*-*-linux*.
+
+Patch status: upstream (4.8 branch commit r206905)
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+
+diff --git a/libgcc/config.host b/libgcc/config.host
+index ee16d60e34a6..302aa6135211 100644
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -1102,7 +1102,7 @@ xtensa*-*-elf*)
+ 	extra_parts="$extra_parts crti.o crtn.o"
+ 	;;
+ xtensa*-*-linux*)
+-	tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux"
++	tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
+ 	md_unwind_header=xtensa/linux-unwind.h
+ 	;;
+ am33_2.0-*-linux*)
+-- 
+1.8.5.3
+
Signature · 1 line
1.8.5.3
#6 lore raw

PATCH 3/3 gcc: xtensa: fix __builtin_frame_address use with shared libgcc

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

The xtensa port uses __xtensa_libgcc_window_spill in libgcc to implement __builtin_frame_address. This symbol is local/hidden in libgcc. This is not a problem when linking against static libgcc. But g++ defaults to -shared-libgcc, thus breaking link against C++ shared libraries that are using __builtin_frame_address as follows:

Quoted 8 lines

ld: test: hidden symbol `__xtensa_libgcc_window_spill' in .../libgcc.a(lib2funcs.o) is referenced by DSO

Add upstream patches that make libgcc_s.so a linker script that links in unresolved symbols from the static libgcc, similar to the ARM and PowerPC ports.

Fixes:
http://autobuild.buildroot.net/results/e2d/e2d1a763fa86b8575e2e48e6d73c018175f43e7c/

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard