Skip to contentSkip to conversation

package/libgpg-error: fix no-thread build

PATCH New Yann E. MORIN 2 participants 2 messages Jul 14, 2016 – Jul 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/libgpg-error: fix no-thread build

Including the pthreads header was not properly guarded; fix that.

Disable building tests, as they are not really needed for Buildroot.

Note that autoreconfiguring is very noisy and spits out a lot of git errors as their configure.ac expects, and even *requires* to be run from a git clone. Although reported as fatal errors, it's just git whining. We can ignore them.

Fixes:

    http://autobuild.buildroot.org/results/049/0495d60556139de8f3f6df420d9a226ee8a432a0/
    http://autobuild.buildroot.org/results/0d1/0d12423877b4aac2a18fac651063de98774b5108/
    [...]
Cc Maxime Hadjinlian <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Romain Naour <[email protected]>
Cc J?rg Krause <[email protected]>
Cc Vicente Olivert Riera <[email protected]>
Cc Arnout Vandecappelle <[email protected]>

---
Changes v1 -> v2;
- upstream has accepted my patches, so we use them instead of the previous workarounds.

---
Notes:
- patches backported from upstream;
- upstream has tagged a new release with those, but not yet

    made the releas tarballs available;
  - when it is done, we can bump to 1.24 and drop those two patches.
---
 .../0001-Fix-build-without-threads.patch           | 71 ++++++++++++++++++++++
 .../0002-Add-an-option-to-disable-tests.patch      | 57 +++++++++++++++++
 package/libgpg-error/libgpg-error.mk               |  5 ++
 3 files changed, 133 insertions(+)
 create mode 100644 package/libgpg-error/0001-Fix-build-without-threads.patch
 create mode 100644 package/libgpg-error/0002-Add-an-option-to-disable-tests.patch
package/libgpg-error/0001-Fix-build-without-threads.patch new file +71 -0
new file mode 100644
index 0000000..9154cd8
@@ -0,0 +1,71 @@
+From abcdfa7964da62b92984516608faf8941038b71d Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Sun, 10 Jul 2016 11:38:46 +0200
+Subject: [PATCH 1/2] Fix build without threads
+
+* src/gen-posix-lock-obj.c: properly guard inclusioin of pthread.h
+* tests/t-lock.c: likewise
+* tests/t-poll.c: likewise
+--
+
+Although ./configure checks for thread support, gen-posix-lock-obj and
+two tests still include pthread.h unconditionally.
+
+Guard that inclusion using the same condition as all other uses of
+pthread-related code.
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+ src/gen-posix-lock-obj.c | 4 +++-
+ tests/t-lock.c           | 4 +++-
+ tests/t-poll.c           | 4 +++-
+ 3 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/src/gen-posix-lock-obj.c b/src/gen-posix-lock-obj.c
+index e32a3cd..e6f33ae 100644
+--- a/src/gen-posix-lock-obj.c
++++ b/src/gen-posix-lock-obj.c
+@@ -29,7 +29,9 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <errno.h>
+-#include <pthread.h>
++#ifdef USE_POSIX_THREADS
++# include <pthread.h>
++#endif
+ 
+ #include "posix-lock-obj.h"
+ 
+diff --git a/tests/t-lock.c b/tests/t-lock.c
+index 38c9cec..6add18b 100644
+--- a/tests/t-lock.c
++++ b/tests/t-lock.c
+@@ -31,7 +31,9 @@
+ # include <windows.h>
+ # include <time.h>
+ #else
+-# include <pthread.h>
++# ifdef USE_POSIX_THREADS
++#  include <pthread.h>
++# endif
+ #endif
+ 
+ #define PGM "t-lock"
+diff --git a/tests/t-poll.c b/tests/t-poll.c
+index 811f895..a26cbfa 100644
+--- a/tests/t-poll.c
++++ b/tests/t-poll.c
+@@ -34,7 +34,9 @@
+ # include <windows.h>
+ # include <time.h>
+ #else
+-# include <pthread.h>
++# ifdef USE_POSIX_THREADS
++#  include <pthread.h>
++# endif
+ #endif
+ 
+ #define PGM "t-lock"
+-- 
+2.7.4
+
package/libgpg-error/0002-Add-an-option-to-disable-tests.patch new file +57 -0

57 lines not on this page · raw message

package/libgpg-error/libgpg-error.mk +5 -0
index b074ff6..c8c60fa 100644
@@ -11,6 +11,9 @@ LIBGPG_ERROR_LICENSE_FILES = COPYING COPYING.LIB
 LIBGPG_ERROR_INSTALL_STAGING = YES
 LIBGPG_ERROR_CONFIG_SCRIPTS = gpg-error-config
 
+# 0002-tests-do-not-build.patch touches Makefile.am
+LIBGPG_ERROR_AUTORECONF = YES
+
 define LIBGPG_ERROR_FIX_CROSS_COMPILATION
 	cd $(@D)/src/syscfg && \
 	ln -s lock-obj-pub.$(call qstrip, $(BR2_PACKAGE_LIBGPG_ERROR_SYSCFG)).h \
@@ -18,4 +21,6 @@ define LIBGPG_ERROR_FIX_CROSS_COMPILATION
 endef
 LIBGPG_ERROR_PRE_CONFIGURE_HOOKS += LIBGPG_ERROR_FIX_CROSS_COMPILATION
 
+LIBGPG_ERROR_CONF_OPTS = --disable-tests
+
 $(eval $(autotools-package))
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 package/libgpg-error: fix no-thread build

Hello,

Quoted 9 lines · Yann E. MORIN

Including the pthreads header was not properly guarded; fix that.

Disable building tests, as they are not really needed for Buildroot.

Note that autoreconfiguring is very noisy and spits out a lot of git errors as their configure.ac expects, and even *requires* to be run from a git clone. Although reported as fatal errors, it's just git whining. We can ignore them.

Quoted 4 lines

Fixes:

    http://autobuild.buildroot.org/results/049/0495d60556139de8f3f6df420d9a226ee8a432a0/
    http://autobuild.buildroot.org/results/0d1/0d12423877b4aac2a18fac651063de98774b5108/
    [...]

In the mean time, your patches have been merged upstream (thanks for doing this work!), upstream has done a new release, and Vicente has sent patches to bump libgpg-error. So I've merged Vicente patches.

Therefore, I think the no thread problem is gone. The only thing that remains to be done is disabling the tests. Could you send a patch that does just this?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com