Skip to contentSkip to conversation

RFC: update libglib2 to 2.32.4

Buildroot New Sven Neumann 2 participants 11 messages Jul 18, 2012 – Aug 7, 2012

lore
Share & tools
lore
#0 lore raw

This is a series of patches that we use to bring glib2 to the most recent stable version. Some of these patches are not ready for inclusion in buildroot upstream, but I am sending them here anyway in the hope that we can sort things out together.

#1 lore raw

PATCH 1/5 libglib2: bump to version 2.32.4

---
 package/libglib2/libglib2.mk |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/libglib2/libglib2.mk +3 -3
index 2b2bd32..976caf0 100644
@@ -3,10 +3,10 @@
 # libglib2
 #
 #############################################################
-LIBGLIB2_VERSION_MAJOR = 2.30
-LIBGLIB2_VERSION_MINOR = 2
+LIBGLIB2_VERSION_MAJOR = 2.32
+LIBGLIB2_VERSION_MINOR = 4
 LIBGLIB2_VERSION = $(LIBGLIB2_VERSION_MAJOR).$(LIBGLIB2_VERSION_MINOR)
-LIBGLIB2_SOURCE = glib-$(LIBGLIB2_VERSION).tar.bz2
+LIBGLIB2_SOURCE = glib-$(LIBGLIB2_VERSION).tar.xz
 LIBGLIB2_SITE = http://ftp.gnome.org/pub/gnome/sources/glib/$(LIBGLIB2_VERSION_MAJOR)
 
 LIBGLIB2_INSTALL_STAGING = YES
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/5 libglib2: fix linker flags

In reply to Sven Neumann

The Makefiles distributed with glib 2.32 omit some needed linker flags. Fix this and autoreconf to get the changes applied.

---
 package/libglib2/libglib2-fix-linker-flags.patch |   36 ++++++++++++++++++++++
 package/libglib2/libglib2.mk                     |    1 +
 2 files changed, 37 insertions(+)
 create mode 100644 package/libglib2/libglib2-fix-linker-flags.patch
package/libglib2/libglib2-fix-linker-flags.patch new file +36 -0
new file mode 100644
index 0000000..cc8facf
@@ -0,0 +1,36 @@
+--- libglib2-2.31.18-orig/gio/Makefile.am	2012-02-20 21:23:17.000000000 +0100
++++ libglib2-2.31.18/gio/Makefile.am	2012-02-29 12:10:35.680474728 +0100
+@@ -647,6 +647,7 @@
+ glib_compile_resources_LDADD = \
+ 	$(top_builddir)/glib/libglib-2.0.la \
+ 	$(top_builddir)/gobject/libgobject-2.0.la	\
++	$(top_builddir)/gmodule/libgmodule-2.0.la	\
+ 	libgio-2.0.la
+ 
+ glib_compile_resources_SOURCES = \
+@@ -677,6 +678,7 @@
+ gsettings_LDADD = \
+ 	$(top_builddir)/glib/libglib-2.0.la		\
+ 	$(top_builddir)/gobject/libgobject-2.0.la	\
++	$(top_builddir)/gmodule/libgmodule-2.0.la	\
+ 	libgio-2.0.la
+ gsettings_SOURCES = gsettings-tool.c
+ 
+@@ -690,7 +692,8 @@
+ gdbus_SOURCES = gdbus-tool.c
+ gdbus_LDADD = libgio-2.0.la \
+ 	$(top_builddir)/glib/libglib-2.0.la 		\
+-	$(top_builddir)/gobject/libgobject-2.0.la
++	$(top_builddir)/gobject/libgobject-2.0.la	\
++	$(top_builddir)/gmodule/libgmodule-2.0.la
+ 
+ completiondir = $(sysconfdir)/bash_completion.d
+ completion_DATA = \
+@@ -707,6 +710,7 @@
+ gresource_LDADD = libgio-2.0.la \
+ 	$(top_builddir)/glib/libglib-2.0.la 		\
+ 	$(top_builddir)/gobject/libgobject-2.0.la \
++	$(top_builddir)/gmodule/libgmodule-2.0.la	\
+ 	$(ELF_LIBS)
+ 
+ # ------------------------------------------------------------------------
package/libglib2/libglib2.mk +1 -0
index 976caf0..cc76669 100644
@@ -9,6 +9,7 @@ LIBGLIB2_VERSION = $(LIBGLIB2_VERSION_MAJOR).$(LIBGLIB2_VERSION_MINOR)
 LIBGLIB2_SOURCE = glib-$(LIBGLIB2_VERSION).tar.xz
 LIBGLIB2_SITE = http://ftp.gnome.org/pub/gnome/sources/glib/$(LIBGLIB2_VERSION_MAJOR)
 
+LIBGLIB2_AUTORECONF = YES
 LIBGLIB2_INSTALL_STAGING = YES
 LIBGLIB2_INSTALL_TARGET = YES
 LIBGLIB2_INSTALL_STAGING_OPT = DESTDIR=$(STAGING_DIR) LDFLAGS=-L$(STAGING_DIR)/usr/lib install
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 2/5 libglib2: fix linker flags

Le Wed, 18 Jul 2012 23:17:37 +0200,
Sven Neumann <[email protected]> a ?crit :

Quoted 4 lines

The Makefiles distributed with glib 2.32 omit some needed linker flags. Fix this and autoreconf to get the changes applied.

Do you have sent this one upstream?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 2/5 libglib2: fix linker flags

Quoted 9 lines · Thomas Petazzoni

Le Wed, 18 Jul 2012 23:17:37 +0200,
Sven Neumann <[email protected]> a ?crit :

Quoted 4 lines

The Makefiles distributed with glib 2.32 omit some needed linker flags. Fix this and autoreconf to get the changes applied.

Do you have sent this one upstream?

I was about to do so, but it seems that this has been fixed with newer versions of glib2. The patch is not any longer needed (for 2.32.4).

Regards,
Sven

#5 lore raw

PATCH 3/5 libglib2: fix alignment checks

In reply to Sven Neumann

The configure script fails to calculate alignments when cross-compiling.

This commit hardcodes alignments for 32 bit platforms. It will need to be adjusted for other platforms. Please advice on how to fix this properly.

---
 .../libglib2/libglib2-fix-alignment-tests.patch    |   35 ++++++++++++++++++++
 package/libglib2/libglib2.mk                       |    1 +
 2 files changed, 36 insertions(+)
 create mode 100644 package/libglib2/libglib2-fix-alignment-tests.patch
package/libglib2/libglib2-fix-alignment-tests.patch new file +35 -0
new file mode 100644
index 0000000..a0f88ff
@@ -0,0 +1,35 @@
+From 8f8fc836709cff58bd666b87937542088cfc19db Mon Sep 17 00:00:00 2001
+From: Kalev Lember <[email protected]>
+Date: Wed, 28 Mar 2012 12:42:49 +0300
+Subject: [PATCH] configure: Fix alignment tests when cross compiling
+
+When inserting custom code to AC_CHECK_ALIGNOF, make sure to not replace
+the default includes, but instead append to them.
+
+This fixes ALIGNOF_GUINT32 and ALIGNOF_GUINT64 that were both 0 when cross
+compiling. The third 'unsigned long' test wasn't affected because the
+AC_CHECK_ALIGNOF call didn't specify the optional 2nd parameter.
+---
+ configure.ac |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0d30b3e..82d74c6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3405,8 +3405,10 @@ $ac_cv_sizeof___int64)
+   ;;
+ esac
+ 
+-AC_CHECK_ALIGNOF([guint32], [typedef unsigned $gint32 guint32;])
+-AC_CHECK_ALIGNOF([guint64], typedef unsigned $gint64 guint64;)
++AC_CHECK_ALIGNOF([guint32], [AC_INCLUDES_DEFAULT
++typedef unsigned $gint32 guint32;])
++AC_CHECK_ALIGNOF([guint64], [AC_INCLUDES_DEFAULT
++typedef unsigned $gint64 guint64;])
+ AC_CHECK_ALIGNOF([unsigned long])
+ 
+ # Check for libdbus1 - Optional - is only used in the GDBus test cases
+-- 
+1.7.9.1
+
package/libglib2/libglib2.mk +1 -0
index cc76669..004312f 100644
@@ -43,6 +43,7 @@ LIBGLIB2_CONF_ENV = \
 		ac_use_included_regex=no gl_cv_c_restrict=no \
 		ac_cv_path_GLIB_GENMARSHAL=$(HOST_DIR)/usr/bin/glib-genmarshal ac_cv_prog_F77=no \
 		ac_cv_func_posix_getgrgid_r=no \
+		ac_cv_alignof_guint32=4 ac_cv_alignof_guint64=8 ac_cv_alignof_unsigned_long=4 \
 		gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no)
 
 # old uClibc versions don't provide qsort_r
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 3/5 libglib2: fix alignment checks

Le Wed, 18 Jul 2012 23:17:38 +0200,
Sven Neumann <[email protected]> a ?crit :

Quoted 4 lines

The configure script fails to calculate alignments when cross-compiling.

This commit hardcodes alignments for 32 bit platforms. It will need to be adjusted for other platforms. Please advice on how to fix this properly.

OE is doing the same thing, so apparently, it seems like there isn't any other obvious solution. We'll have to define those values for each architecture.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#7 lore raw

PATCH 4/5 libglib2: define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4

In reply to Sven Neumann

On ARMv5 atomic operations are not actually available as inlines but libgcc does still provide them as functions. Trick glib into using the functions instead of using the mutex-based fallbacks.

This should probably be platform-dependant. The inline functions are available for ARMv6 and above and probably for other platforms as well. Please advice on how to fix this properly.

Without this change performance of atomic operations is horrible on ARMv5 systems.

---
 package/libglib2/libglib2.mk |    1 +
 1 file changed, 1 insertion(+)
package/libglib2/libglib2.mk +1 -0
index 004312f..353c824 100644
@@ -15,6 +15,7 @@ LIBGLIB2_INSTALL_TARGET = YES
 LIBGLIB2_INSTALL_STAGING_OPT = DESTDIR=$(STAGING_DIR) LDFLAGS=-L$(STAGING_DIR)/usr/lib install
 
 LIBGLIB2_CONF_ENV = \
+		CPPFLAGS=-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 \
 		ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
 		glib_cv_uscore=no ac_cv_func_strtod=yes \
 		ac_fsusage_space=yes fu_cv_sys_stat_statfs2_bsize=yes \
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 4/5 libglib2: define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4

Le Wed, 18 Jul 2012 23:17:39 +0200,
Sven Neumann <[email protected]> a ?crit :

Quoted 4 lines

On ARMv5 atomic operations are not actually available as inlines but libgcc does still provide them as functions. Trick glib into using the functions instead of using the mutex-based fallbacks.

Quoted 8 lines

This should probably be platform-dependant. The inline functions are available for ARMv6 and above and probably for other platforms as well. Please advice on how to fix this properly.

Without this change performance of atomic operations is horrible on ARMv5 systems.

But isn't the compiler supposed to define
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 by itself?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#9 lore raw

PATCH 5/5 libglib2: do not use xlocale

In reply to Sven Neumann

The xlocale based implementations of g_ascii_strto{d,ll,ull} and g_ascii_formatd crash with uClibC 0.9.32 (and probably other versions as well). So trick the configure script into believing that this functionality was not available so that the good old home-grown code is used again (as was the case with glib 2.30).

---
 package/libglib2/libglib2.mk |    2 ++
 1 file changed, 2 insertions(+)
package/libglib2/libglib2.mk +2 -0
index 353c824..6b33215 100644
@@ -45,6 +45,8 @@ LIBGLIB2_CONF_ENV = \
 		ac_cv_path_GLIB_GENMARSHAL=$(HOST_DIR)/usr/bin/glib-genmarshal ac_cv_prog_F77=no \
 		ac_cv_func_posix_getgrgid_r=no \
 		ac_cv_alignof_guint32=4 ac_cv_alignof_guint64=8 ac_cv_alignof_unsigned_long=4 \
+		ac_cv_func_newlocale=no ac_cv_func_uselocale=no \
+		ac_cv_func_strtod_l=no ac_cv_func_strtoll_l=no ac_cv_func_strtoull_l=no \
 		gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no)
 
 # old uClibc versions don't provide qsort_r
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH 5/5 libglib2: do not use xlocale

Le Wed, 18 Jul 2012 23:17:40 +0200,
Sven Neumann <[email protected]> a ?crit :

Quoted 7 lines

The xlocale based implementations of g_ascii_strto{d,ll,ull} and g_ascii_formatd crash with uClibC 0.9.32 (and probably other versions as well). So trick the configure script into believing that this functionality was not available so that the good old home-grown code is used again (as was the case with glib 2.30).

Have you tried with uClibc 0.9.33 ? Is there a fix available ?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com