Skip to contentSkip to conversation

libglib bump + host-ffi dependency resolved

PATCH New Daniel Mack 2 participants 7 messages Dec 6, 2011 – Dec 11, 2011

lore
Share & tools
lore
#0 lore raw

cover libglib bump + host-ffi dependency resolved

In order to build libglib2 in version 2.30.2, libffi is required to provide host builds.

Daniel Mack (3):
libffi: remove invalid variable 'includedir' in .pc file
libffi: enable host target
libglib2: bump to version 2.30.2

 package/libffi/libffi.mk                           |    7 +++-
 package/libglib2/Config.in                         |    1 +
 ...ib2-configure.ac-fix-cross-compile-builds.patch |   39 ++++++++++++++++++++
 ...b2-fix-compilation-with-no-builtin-atomic.patch |   25 -------------
 package/libglib2/libglib2.mk                       |   11 ++++--
 5 files changed, 52 insertions(+), 31 deletions(-)
 create mode 100644 package/libglib2/libglib2-configure.ac-fix-cross-compile-builds.patch
 delete mode 100644 package/libglib2/libglib2-fix-compilation-with-no-builtin-atomic.patch
Signature · 1 line
1.7.7.3
#1 lore raw

PATCH 1/3 libffi: remove invalid variable 'includedir' in .pc file

Fixes the following error:

Variable 'includedir' not defined in '/home/daniel/buildroot/output/host/usr/arm-unknown-linux-gnueabi/sysroot/usr/lib/pkgconfig/libffi.pc'

Also, use $(SED) instead of 'sed -i'.

---
 package/libffi/libffi.mk |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
package/libffi/libffi.mk +4 -2
index 660a034..5ada36d 100644
@@ -13,7 +13,8 @@ LIBFFI_INSTALL_STAGING = YES
 # accordingly
 define LIBFFI_MOVE_STAGING_HEADERS
 	mv $(STAGING_DIR)/usr/lib/libffi-*/include/*.h $(STAGING_DIR)/usr/include/
-	sed -i '/^includedir.*/d' $(STAGING_DIR)/usr/lib/pkgconfig/libffi.pc
+	$(SED) '/^includedir.*/d' $(STAGING_DIR)/usr/lib/pkgconfig/libffi.pc
+	$(SED) '/^Cflags:.*/d' $(STAGING_DIR)/usr/lib/pkgconfig/libffi.pc
 	rm -rf $(TARGET_DIR)/usr/lib/libffi-*
 endef
 
@@ -23,7 +24,8 @@ LIBFFI_POST_INSTALL_STAGING_HOOKS += LIBFFI_MOVE_STAGING_HEADERS
 define LIBFFI_MOVE_TARGET_HEADERS
 	install -d $(TARGET_DIR)/usr/include/
 	mv $(TARGET_DIR)/usr/lib/libffi-*/include/*.h $(TARGET_DIR)/usr/include/
-	sed -i '/^includedir.*/d' $(TARGET_DIR)/usr/lib/pkgconfig/libffi.pc
+	$(SED) '/^includedir.*/d' $(STAGING_DIR)/usr/lib/pkgconfig/libffi.pc
+	$(SED) '/^Cflags:.*/d' $(STAGING_DIR)/usr/lib/pkgconfig/libffi.pc
 	rm -rf $(TARGET_DIR)/usr/lib/libffi-*
 endef
 
Signature · 1 line
1.7.7.3
#2 lore raw

PATCH 1/3 libffi: remove invalid variable 'includedir' in .pc file

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel Mack <[email protected]> writes:

Daniel> Fixes the following error:
Daniel> Variable 'includedir' not defined in '/home/daniel/buildroot/output/host/usr/arm-unknown-linux-gnueabi/sysroot/usr/lib/pkgconfig/libffi.pc'

Committed, thanks.

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

PATCH 2/3 libffi: enable host target

In reply to Daniel Mack

libffi is a new requirement for libglib, and as libglib has to be built for the host as well, libffi has to follow.

---
 package/libffi/libffi.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
package/libffi/libffi.mk +1 -0
index 5ada36d..e9e87ef 100644
@@ -32,4 +32,5 @@ endef
 LIBFFI_POST_INSTALL_TARGET_HOOKS += LIBFFI_MOVE_TARGET_HEADERS
 
 $(eval $(call AUTOTARGETS))
+$(eval $(call AUTOTARGETS,host))
 
Signature · 1 line
1.7.7.3
#4 lore raw

PATCH 2/3 libffi: enable host target

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel Mack <[email protected]> writes:

Daniel> libffi is a new requirement for libglib, and as libglib has to be built Daniel> for the host as well, libffi has to follow.

Committed, thanks.

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

PATCH 3/3 libglib2: bump to version 2.30.2

In reply to Daniel Mack

Important changes for this version bump are that libffi (for both host and target) is now a hard requirement for libglib.

The patch regarding atomic function seems obsolete now, as this part of the lib was rewritten. I couldn't figure which platform this used to break on, but in worst case, it would be trivial to redo this one-liner.

Also, there's an issue in the upstream package that makes configure fail for cross-builds with "configure: error: cannot run test program while cross compiling". This issue was reported, but the patch was rejected. Appearantly, the developers don't expect people to use configure for cross environments anymore, so we have to maintain this patch locally. For more information, see

https://bugzilla.gnome.org/show_bug.cgi?id=665607

---
 package/libglib2/Config.in                         |    1 +
 ...ib2-configure.ac-fix-cross-compile-builds.patch |   39 ++++++++++++++++++++
 ...b2-fix-compilation-with-no-builtin-atomic.patch |   25 -------------
 package/libglib2/libglib2.mk                       |   11 ++++--
 4 files changed, 47 insertions(+), 29 deletions(-)
 create mode 100644 package/libglib2/libglib2-configure.ac-fix-cross-compile-builds.patch
 delete mode 100644 package/libglib2/libglib2-fix-compilation-with-no-builtin-atomic.patch
package/libglib2/Config.in +1 -0
index 3d42430..71682cd 100644
@@ -4,6 +4,7 @@ config BR2_PACKAGE_LIBGLIB2
 	select BR2_PACKAGE_LIBINTL if BR2_NEEDS_GETTEXT
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
 	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_LIBFFI
 	depends on BR2_USE_WCHAR # gettext
 	help
 	  Low-level core library that forms the basis of GTK+ and GNOME.
package/libglib2/libglib2-configure.ac-fix-cross-compile-builds.patch new file +39 -0
new file mode 100644
index 0000000..ff0d036
@@ -0,0 +1,39 @@
+From 22fd992b8e4acbbbcaf099bb1eafab6670a22022 Mon Sep 17 00:00:00 2001
+From: Daniel Mack <[email protected]>
+Date: Mon, 5 Dec 2011 17:28:32 +0100
+Subject: [PATCH] configure.ac: fix cross-compile builds
+
+When cross-compiling for ARM platforms, I was getting the following
+error:
+
+  checking for qsort_r... yes
+  checking if qsort_r uses glibc compatible argument order... configure:
+  error: in `/home/daniel/src/glib':
+  configure: error: cannot run test program while cross compiling
+  See `config.log' for more details
+
+Use the 4th argument of AC_RUN_IFELSE and assume
+glib_cv_have_qsort_r=no for cross-compile builds, just to be sure glib
+doesn't relay on any faulty functions.
+
+Signed-off-by: Daniel Mack <[email protected]>
+---
+ configure.ac |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1befff3..e770c20 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -608,7 +608,7 @@ if test x$ac_cv_func_qsort_r = xyes ; then
+       return 0;
+     else
+       return 1;
+-  }]])],[glib_cv_have_qsort_r=yes],[glib_cv_have_qsort_r=no])])
++  }]])],[glib_cv_have_qsort_r=yes],[glib_cv_have_qsort_r=no],[glib_cv_have_qsort_r=no])])
+ fi
+ 
+ if test x$glib_cv_have_qsort_r = xyes ; then
+-- 
+1.7.7.3
+
package/libglib2/libglib2-fix-compilation-with-no-builtin-atomic.patch deleted +0 -25
deleted file mode 100644
index 39c0510..0000000
@@ -1,25 +0,0 @@
-From 58096320ea0888c4fbbff318839017a4d2e82703 Mon Sep 17 00:00:00 2001
-From: Lionel Landwerlin <[email protected]>
-Date: Sat, 6 Nov 2010 14:56:15 +0100
-Subject: [PATCH] glib: fix compilation with no builtin atomic operations compilers
-
-Signed-off-by: Lionel Landwerlin <[email protected]>
----
- glib/gatomic.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diff --git a/glib/gatomic.c b/glib/gatomic.c
-index 845c866..01468ce 100644
---- a/glib/gatomic.c
-+++ b/glib/gatomic.c
-@@ -881,6 +881,7 @@ g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomi
- #endif /* DEFINE_WITH_WIN32_INTERLOCKED */
- 
- #ifdef DEFINE_WITH_MUTEXES
-+# include "gthread.h"
- /* We have to use the slow, but safe locking method */
- static GMutex *g_atomic_mutex; 
- 
--- 
-1.7.2.3
-
package/libglib2/libglib2.mk +7 -4
index 0832ac3..c5bc4a9 100644
@@ -3,8 +3,8 @@
 # libglib2
 #
 #############################################################
-LIBGLIB2_VERSION_MAJOR = 2.28
-LIBGLIB2_VERSION_MINOR = 8
+LIBGLIB2_VERSION_MAJOR = 2.30
+LIBGLIB2_VERSION_MINOR = 2
 LIBGLIB2_VERSION = $(LIBGLIB2_VERSION_MAJOR).$(LIBGLIB2_VERSION_MINOR)
 LIBGLIB2_SOURCE = glib-$(LIBGLIB2_VERSION).tar.bz2
 LIBGLIB2_SITE = http://ftp.gnome.org/pub/gnome/sources/glib/$(LIBGLIB2_VERSION_MAJOR)
@@ -13,6 +13,9 @@ LIBGLIB2_INSTALL_STAGING = YES
 LIBGLIB2_INSTALL_TARGET = YES
 LIBGLIB2_INSTALL_STAGING_OPT = DESTDIR=$(STAGING_DIR) LDFLAGS=-L$(STAGING_DIR)/usr/lib install
 
+# we have to patch configure.ac
+LIBGLIB2_AUTORECONF = YES
+
 LIBGLIB2_CONF_ENV =	\
 		ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
 		glib_cv_uscore=no ac_cv_func_strtod=yes \
@@ -48,9 +51,9 @@ HOST_LIBGLIB2_CONF_OPT = \
 		--disable-gtk-doc \
 		--enable-debug=no \
 
-LIBGLIB2_DEPENDENCIES = host-pkg-config host-libglib2 zlib $(if $(BR2_NEEDS_GETTEXT),gettext libintl)
+LIBGLIB2_DEPENDENCIES = host-pkg-config host-libglib2 zlib libffi $(if $(BR2_NEEDS_GETTEXT),gettext libintl)
 
-HOST_LIBGLIB2_DEPENDENCIES = host-pkg-config host-zlib
+HOST_LIBGLIB2_DEPENDENCIES = host-pkg-config host-zlib host-libffi
 
 ifneq ($(BR2_ENABLE_LOCALE),y)
 LIBGLIB2_DEPENDENCIES+=libiconv
Signature · 1 line
1.7.7.3
#6 lore raw

PATCH 3/3 libglib2: bump to version 2.30.2

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel Mack <[email protected]> writes:

Daniel> Important changes for this version bump are that libffi (for both host Daniel> and target) is now a hard requirement for libglib.

Daniel> The patch regarding atomic function seems obsolete now, as this part of Daniel> the lib was rewritten. I couldn't figure which platform this used to Daniel> break on, but in worst case, it would be trivial to redo this one-liner.

Daniel> Also, there's an issue in the upstream package that makes configure fail Daniel> for cross-builds with "configure: error: cannot run test program while Daniel> cross compiling". This issue was reported, but the patch was rejected. Daniel> Appearantly, the developers don't expect people to use configure for Daniel> cross environments anymore, so we have to maintain this patch locally. Daniel> For more information, see

Thanks. Instead of using this patch I would prefer to just pass glib_cv_have_qsort_r=yes/no in LIBGLIB2_CONF_ENV like Colin suggested. That way we can set it to yes for external glibc-based toolchains (BR2_TOOLCHAIN_EXTERNAL_GLIBC) and no otherwise.

Care to respin this patch with that change?

Thanks.

Signature · 1 line
Bye, Peter Korsgaard