Skip to contentSkip to conversation

libglib2: rename patches

PATCH New Samuel Martin 3 participants 6 messages May 14, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 libglib2: rename patches

---
 ...t.patch => libglib2-0001-make-codegen-python2-python3-compliant.patch} | 0
 .../libglib2/{libglib2-no-tests.patch => libglib2-0002-no-tests.patch}    | 0
 .../{libglib2-optional-ipv6.patch => libglib2-0003-optional-ipv6.patch}   | 0
 3 files changed, 0 insertions(+), 0 deletions(-)
 rename package/libglib2/{libglib2-make-codegen-python2-python3-compliant.patch => libglib2-0001-make-codegen-python2-python3-compliant.patch} (100%)
 rename package/libglib2/{libglib2-no-tests.patch => libglib2-0002-no-tests.patch} (100%)
 rename package/libglib2/{libglib2-optional-ipv6.patch => libglib2-0003-optional-ipv6.patch} (100%)
package/libglib2/libglib2-0001-make-codegen-python2-python3-compliant.patch renamed from package/libglib2/libglib2-make-codegen-python2-python3-compliant.patch +0 -0
similarity index 100%
rename from package/libglib2/libglib2-make-codegen-python2-python3-compliant.patch
rename to package/libglib2/libglib2-0001-make-codegen-python2-python3-compliant.patch
package/libglib2/libglib2-0002-no-tests.patch renamed from package/libglib2/libglib2-no-tests.patch +0 -0
similarity index 100%
rename from package/libglib2/libglib2-no-tests.patch
rename to package/libglib2/libglib2-0002-no-tests.patch
package/libglib2/libglib2-0003-optional-ipv6.patch renamed from package/libglib2/libglib2-optional-ipv6.patch +0 -0
similarity index 100%
rename from package/libglib2/libglib2-optional-ipv6.patch
rename to package/libglib2/libglib2-0003-optional-ipv6.patch
Signature · 1 line
1.8.2.3
#1 lore raw

PATCH 2/3 libglib2: fix build when toolchain has no thread support

---
 ...ib2-0004-fix-build-when-no-thread-support.patch | 40 ++++++++++++++++++++++
 package/libglib2/libglib2.mk                       |  3 ++
 2 files changed, 43 insertions(+)
 create mode 100644 package/libglib2/libglib2-0004-fix-build-when-no-thread-support.patch
package/libglib2/libglib2-0004-fix-build-when-no-thread-support.patch new file +40 -0
new file mode 100644
index 0000000..e1de20a
@@ -0,0 +1,40 @@
+Fix gio/gcancellable.c build when thread support is disabled
+
+Signed-off-by: "Samuel Martin" <[email protected]>
+---
+--- a/gio/gcancellable.c	2013-05-14 10:49:10.656384566 +0200
++++ b/gio/gcancellable.c	2013-05-14 12:38:46.339432786 +0200
+@@ -263,6 +263,7 @@ g_cancellable_reset (GCancellable *cance
+ 
+   g_return_if_fail (G_IS_CANCELLABLE (cancellable));
+ 
++#ifdef G_THREADS_ENABLED
+   G_LOCK(cancellable);
+ 
+   priv = cancellable->priv;
+@@ -282,6 +283,7 @@ g_cancellable_reset (GCancellable *cance
+       priv->cancelled = FALSE;
+     }
+   G_UNLOCK(cancellable);
++#endif
+ }
+ 
+ /**
+@@ -612,6 +614,9 @@ g_cancellable_disconnect (GCancellable
+   if (handler_id == 0 ||  cancellable == NULL)
+     return;
+ 
++  g_return_if_fail (G_IS_CANCELLABLE (cancellable));
++
++#ifdef G_THREADS_ENABLED
+   G_LOCK (cancellable);
+ 
+   priv = cancellable->priv;
+@@ -625,6 +630,7 @@ g_cancellable_disconnect (GCancellable
+ 
+   g_signal_handler_disconnect (cancellable, handler_id);
+   G_UNLOCK (cancellable);
++#endif
+ }
+ 
+ typedef struct {
package/libglib2/libglib2.mk +3 -0
index d78e8ec..3ac78ba 100644
@@ -67,6 +67,9 @@ HOST_LIBGLIB2_CONF_OPT = \
 		--disable-tests
 
 LIBGLIB2_CONF_OPT += --disable-tests
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
+	LIBGLIB2_CONF_OPT += --with-threads=none --disable-threads
+endif
 
 LIBGLIB2_DEPENDENCIES = host-pkgconf host-libglib2 libffi zlib $(if $(BR2_NEEDS_GETTEXT),gettext) host-gettext
 
Signature · 1 line
1.8.2.3
#2 lore raw

PATCH 2/3 libglib2: fix build when toolchain has no thread support

Dear Samuel Martin,

Quoted 25 lines · Samuel Martin
+---
+--- a/gio/gcancellable.c	2013-05-14 10:49:10.656384566 +0200

++++ b/gio/gcancellable.c 2013-05-14 12:38:46.339432786 +0200
+@@ -263,6 +263,7 @@ g_cancellable_reset (GCancellable *cance +

package/libglib2/libglib2-0004-fix-build-when-no-thread-support.patch new file +20 -0
+   g_return_if_fail (G_IS_CANCELLABLE (cancellable));
+ 
++#ifdef G_THREADS_ENABLED
+   G_LOCK(cancellable);
+ 
+   priv = cancellable->priv;
+@@ -282,6 +283,7 @@ g_cancellable_reset (GCancellable *cance
+       priv->cancelled = FALSE;
+     }
+   G_UNLOCK(cancellable);
++#endif
+ }
+ 
+ /**
+@@ -612,6 +614,9 @@ g_cancellable_disconnect (GCancellable
+   if (handler_id == 0 ||  cancellable == NULL)
+     return;
+ 
++  g_return_if_fail (G_IS_CANCELLABLE (cancellable));
++

package/libglib2/libglib2-0004-fix-build-when-no-thread-support.patch line 38

Quoted 10 lines
package/libglib2/libglib2-0004-fix-build-when-no-thread-support.patch new file +10 -0
++#ifdef G_THREADS_ENABLED
+   G_LOCK (cancellable);
+ 
+   priv = cancellable->priv;
+@@ -625,6 +630,7 @@ g_cancellable_disconnect (GCancellable
+ 
+   g_signal_handler_disconnect (cancellable, handler_id);
+   G_UNLOCK (cancellable);
++#endif
+ }

Are you sure about this patch? It completely removes the behavior of the cancellation functions of glib, which may be used even if there are no threads.

Are you sure that what needs to be removed is not just the G_LOCK() and G_UNLOCK() calls ?

Thomas

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

PATCH 2/3 libglib2: fix build when toolchain has no thread support

Hi Thomas, all,

2013/5/14 Thomas Petazzoni <[email protected]>:

Quoted 36 lines

Dear Samuel Martin,

Quoted 32 lines · Samuel Martin
+---
+--- a/gio/gcancellable.c     2013-05-14 10:49:10.656384566 +0200
++++ b/gio/gcancellable.c     2013-05-14 12:38:46.339432786 +0200

+@@ -263,6 +263,7 @@ g_cancellable_reset (GCancellable *cance

package/libglib2/libglib2-0004-fix-build-when-no-thread-support.patch new file +28 -0
+
+   g_return_if_fail (G_IS_CANCELLABLE (cancellable));
+
++#ifdef G_THREADS_ENABLED
+   G_LOCK(cancellable);
+
+   priv = cancellable->priv;
+@@ -282,6 +283,7 @@ g_cancellable_reset (GCancellable *cance
+       priv->cancelled = FALSE;
+     }
+   G_UNLOCK(cancellable);
++#endif
+ }
+
+ /**
+@@ -612,6 +614,9 @@ g_cancellable_disconnect (GCancellable
+   if (handler_id == 0 ||  cancellable == NULL)
+     return;
+
++  g_return_if_fail (G_IS_CANCELLABLE (cancellable));
++
++#ifdef G_THREADS_ENABLED
+   G_LOCK (cancellable);
+
+   priv = cancellable->priv;
+@@ -625,6 +630,7 @@ g_cancellable_disconnect (GCancellable
+
+   g_signal_handler_disconnect (cancellable, handler_id);
Quoted 8 lines
Quoted 3 lines

+ G_UNLOCK (cancellable);
++#endif
+ }

Are you sure about this patch? It completely removes the behavior of the cancellation functions of glib, which may be used even if there are no threads.

Well, I thought that glib handles that too, but without this patch I
always trigger the following error
(using this unchanged config:
http://autobuild.buildroot.net/results/d49/d491de5a774592929a59f3bfd0b1fd8cbc089ac0/config):
---
libtool: compile: /opt/br-output/cairo-fix/host/usr/bin/arm-linux-gcc -DHAVE_CONFIG_H -I. -I.. -I/opt/br-output/cairo-fix/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include -DG_LOG_DOMAIN=\"GLib-GIO\" -I.. -I../glib -I../glib -I.. -I../gmodule -DG_DISABLE_CAST_CHECKS -DG_THREADS_MANDATORY -DG_DISABLE_DEPRECATED -DGIO_COMPILATION -DGIO_MODULE_DIR=\"/usr/lib/gio/modules\" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DG_DISABLE_SINGLE_INCLUDES -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -g2 -Wall -MT libgio_2_0_la-gcancellable.lo -MD -MP -MF .deps/libgio_2_0_la-gcancellable.Tpo -c gcancellable.c -fPIC -DPIC -o .libs/libgio_2_0_la-gcancellable.o
gcancellable.c: In function 'g_cancellable_reset':
gcancellable.c:273:7: error 'g__cancellable_lock' undeclared (first
use in this function)
gcancellable.c:273:7: note: each undeclared identifier is reported
only once for each function it appears in
gcancellable.c: In function 'g_cancellable_disconnect':
gcancellable.c:622:7: error 'g__cancellable_lock' undeclared (first
use in this function)
make[5]: *** [libgio_2_0_la-gcancellable.lo] Error 1
---

Quoted 3 lines

Are you sure that what needs to be removed is not just the G_LOCK() and G_UNLOCK() calls ?

Actually, it's g_cond_wait that triggers this build failure. Looking at its definition, it should do nothing when thread support is disabled...

Note that a more finely grained patch, disabling only the g_cond_wait call, is enough to fix this build issue.

Regards,

Signature · 1 line
Samuel
#4 lore raw

PATCH 3/3 cairo: fix build when toolchain has no thread support

In reply to Samuel Martin

Fixes the build failure visible at
http://autobuild.buildroot.net/results/d49/d491de5a774592929a59f3bfd0b1fd8cbc089ac0

---
 package/cairo/cairo.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/cairo/cairo.mk +4 -0
index 83c82c0..203dbbe 100644
@@ -36,6 +36,10 @@ CAIRO_CONF_ENV = ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
 		ac_cv_func_working_mktime=yes jm_cv_func_working_re_compile_pattern=yes \
 		ac_use_included_regex=no gl_cv_c_restrict=no
 
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
+	CAIRO_CONF_ENV += CPPFLAGS="$(TARGET_CPPFLAGS) -DCAIRO_NO_MUTEX=1"
+endif
+
 CAIRO_CONF_OPT = \
 	--enable-trace=no \
 	--enable-interpreter=no
Signature · 1 line
1.8.2.3