All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] RFC: update libglib2 to 2.32.4
@ 2012-07-18 21:17 Sven Neumann
  2012-07-18 21:17 ` [Buildroot] [PATCH 1/5] libglib2: bump to version 2.32.4 Sven Neumann
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Sven Neumann @ 2012-07-18 21:17 UTC (permalink / raw)
  To: buildroot

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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 1/5] libglib2: bump to version 2.32.4
  2012-07-18 21:17 [Buildroot] RFC: update libglib2 to 2.32.4 Sven Neumann
@ 2012-07-18 21:17 ` Sven Neumann
  2012-07-18 21:17 ` [Buildroot] [PATCH 2/5] libglib2: fix linker flags Sven Neumann
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Sven Neumann @ 2012-07-18 21:17 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
---
 package/libglib2/libglib2.mk |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
index 2b2bd32..976caf0 100644
--- a/package/libglib2/libglib2.mk
+++ b/package/libglib2/libglib2.mk
@@ -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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 2/5] libglib2: fix linker flags
  2012-07-18 21:17 [Buildroot] RFC: update libglib2 to 2.32.4 Sven Neumann
  2012-07-18 21:17 ` [Buildroot] [PATCH 1/5] libglib2: bump to version 2.32.4 Sven Neumann
@ 2012-07-18 21:17 ` Sven Neumann
  2012-07-20 21:32   ` Thomas Petazzoni
  2012-07-18 21:17 ` [Buildroot] [PATCH 3/5] libglib2: fix alignment checks Sven Neumann
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Sven Neumann @ 2012-07-18 21:17 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
---
 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

diff --git a/package/libglib2/libglib2-fix-linker-flags.patch b/package/libglib2/libglib2-fix-linker-flags.patch
new file mode 100644
index 0000000..cc8facf
--- /dev/null
+++ b/package/libglib2/libglib2-fix-linker-flags.patch
@@ -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)
+ 
+ # ------------------------------------------------------------------------
diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
index 976caf0..cc76669 100644
--- a/package/libglib2/libglib2.mk
+++ b/package/libglib2/libglib2.mk
@@ -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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 3/5] libglib2: fix alignment checks
  2012-07-18 21:17 [Buildroot] RFC: update libglib2 to 2.32.4 Sven Neumann
  2012-07-18 21:17 ` [Buildroot] [PATCH 1/5] libglib2: bump to version 2.32.4 Sven Neumann
  2012-07-18 21:17 ` [Buildroot] [PATCH 2/5] libglib2: fix linker flags Sven Neumann
@ 2012-07-18 21:17 ` Sven Neumann
  2012-07-20 21:38   ` Thomas Petazzoni
  2012-07-18 21:17 ` [Buildroot] [PATCH 4/5] libglib2: define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 Sven Neumann
  2012-07-18 21:17 ` [Buildroot] [PATCH 5/5] libglib2: do not use xlocale Sven Neumann
  4 siblings, 1 reply; 11+ messages in thread
From: Sven Neumann @ 2012-07-18 21:17 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
---
 .../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

diff --git a/package/libglib2/libglib2-fix-alignment-tests.patch b/package/libglib2/libglib2-fix-alignment-tests.patch
new file mode 100644
index 0000000..a0f88ff
--- /dev/null
+++ b/package/libglib2/libglib2-fix-alignment-tests.patch
@@ -0,0 +1,35 @@
+From 8f8fc836709cff58bd666b87937542088cfc19db Mon Sep 17 00:00:00 2001
+From: Kalev Lember <kalevlember@gmail.com>
+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
+
diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
index cc76669..004312f 100644
--- a/package/libglib2/libglib2.mk
+++ b/package/libglib2/libglib2.mk
@@ -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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 4/5] libglib2: define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
  2012-07-18 21:17 [Buildroot] RFC: update libglib2 to 2.32.4 Sven Neumann
                   ` (2 preceding siblings ...)
  2012-07-18 21:17 ` [Buildroot] [PATCH 3/5] libglib2: fix alignment checks Sven Neumann
@ 2012-07-18 21:17 ` Sven Neumann
  2012-07-20 21:39   ` Thomas Petazzoni
  2012-07-18 21:17 ` [Buildroot] [PATCH 5/5] libglib2: do not use xlocale Sven Neumann
  4 siblings, 1 reply; 11+ messages in thread
From: Sven Neumann @ 2012-07-18 21:17 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
---
 package/libglib2/libglib2.mk |    1 +
 1 file changed, 1 insertion(+)

diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
index 004312f..353c824 100644
--- a/package/libglib2/libglib2.mk
+++ b/package/libglib2/libglib2.mk
@@ -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 \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 5/5] libglib2: do not use xlocale
  2012-07-18 21:17 [Buildroot] RFC: update libglib2 to 2.32.4 Sven Neumann
                   ` (3 preceding siblings ...)
  2012-07-18 21:17 ` [Buildroot] [PATCH 4/5] libglib2: define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 Sven Neumann
@ 2012-07-18 21:17 ` Sven Neumann
  2012-07-20 21:39   ` Thomas Petazzoni
  4 siblings, 1 reply; 11+ messages in thread
From: Sven Neumann @ 2012-07-18 21:17 UTC (permalink / raw)
  To: buildroot

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).

Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
---
 package/libglib2/libglib2.mk |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/libglib2/libglib2.mk b/package/libglib2/libglib2.mk
index 353c824..6b33215 100644
--- a/package/libglib2/libglib2.mk
+++ b/package/libglib2/libglib2.mk
@@ -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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 2/5] libglib2: fix linker flags
  2012-07-18 21:17 ` [Buildroot] [PATCH 2/5] libglib2: fix linker flags Sven Neumann
@ 2012-07-20 21:32   ` Thomas Petazzoni
  2012-08-07 15:40     ` Sven Neumann
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2012-07-20 21:32 UTC (permalink / raw)
  To: buildroot

Le Wed, 18 Jul 2012 23:17:37 +0200,
Sven Neumann <s.neumann@raumfeld.com> a ?crit :

> The Makefiles distributed with glib 2.32 omit some needed linker flags.
> Fix this and autoreconf to get the changes applied.
> 
> Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>

Do you have sent this one upstream?

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 3/5] libglib2: fix alignment checks
  2012-07-18 21:17 ` [Buildroot] [PATCH 3/5] libglib2: fix alignment checks Sven Neumann
@ 2012-07-20 21:38   ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2012-07-20 21:38 UTC (permalink / raw)
  To: buildroot

Le Wed, 18 Jul 2012 23:17:38 +0200,
Sven Neumann <s.neumann@raumfeld.com> a ?crit :

> 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
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 4/5] libglib2: define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
  2012-07-18 21:17 ` [Buildroot] [PATCH 4/5] libglib2: define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 Sven Neumann
@ 2012-07-20 21:39   ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2012-07-20 21:39 UTC (permalink / raw)
  To: buildroot

Le Wed, 18 Jul 2012 23:17:39 +0200,
Sven Neumann <s.neumann@raumfeld.com> a ?crit :

> 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.
> 
> Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>

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

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 5/5] libglib2: do not use xlocale
  2012-07-18 21:17 ` [Buildroot] [PATCH 5/5] libglib2: do not use xlocale Sven Neumann
@ 2012-07-20 21:39   ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2012-07-20 21:39 UTC (permalink / raw)
  To: buildroot

Le Wed, 18 Jul 2012 23:17:40 +0200,
Sven Neumann <s.neumann@raumfeld.com> a ?crit :

> 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).
> 
> Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>

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

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH 2/5] libglib2: fix linker flags
  2012-07-20 21:32   ` Thomas Petazzoni
@ 2012-08-07 15:40     ` Sven Neumann
  0 siblings, 0 replies; 11+ messages in thread
From: Sven Neumann @ 2012-08-07 15:40 UTC (permalink / raw)
  To: buildroot

On Fri, 2012-07-20 at 23:32 +0200, Thomas Petazzoni wrote:
> Le Wed, 18 Jul 2012 23:17:37 +0200,
> Sven Neumann <s.neumann@raumfeld.com> a ?crit :
> 
> > The Makefiles distributed with glib 2.32 omit some needed linker flags.
> > Fix this and autoreconf to get the changes applied.
> > 
> > Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
> 
> 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-08-07 15:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18 21:17 [Buildroot] RFC: update libglib2 to 2.32.4 Sven Neumann
2012-07-18 21:17 ` [Buildroot] [PATCH 1/5] libglib2: bump to version 2.32.4 Sven Neumann
2012-07-18 21:17 ` [Buildroot] [PATCH 2/5] libglib2: fix linker flags Sven Neumann
2012-07-20 21:32   ` Thomas Petazzoni
2012-08-07 15:40     ` Sven Neumann
2012-07-18 21:17 ` [Buildroot] [PATCH 3/5] libglib2: fix alignment checks Sven Neumann
2012-07-20 21:38   ` Thomas Petazzoni
2012-07-18 21:17 ` [Buildroot] [PATCH 4/5] libglib2: define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 Sven Neumann
2012-07-20 21:39   ` Thomas Petazzoni
2012-07-18 21:17 ` [Buildroot] [PATCH 5/5] libglib2: do not use xlocale Sven Neumann
2012-07-20 21:39   ` Thomas Petazzoni

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.