All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [git commit] package/libgpg-error: fix build without threads
Date: Mon, 15 Feb 2021 23:04:35 +0100	[thread overview]
Message-ID: <20210215215557.6903C8469B@busybox.osuosl.org> (raw)

commit: https://git.buildroot.net/buildroot/commit/?id=f9596e50ece8f3ba290953b596280f976e23ec67
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fix build without threads of libgpg-error in version >= 1.40

Fixes:
 - http://autobuild.buildroot.org/results/3344c96e5627a9327b0eabe0b27f34490bbabc0d

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 ...01-configure.ac-fix-build-without-threads.patch | 54 ++++++++++++++++++++++
 package/libgpg-error/libgpg-error.mk               |  8 ++++
 2 files changed, 62 insertions(+)

diff --git a/package/libgpg-error/0001-configure.ac-fix-build-without-threads.patch b/package/libgpg-error/0001-configure.ac-fix-build-without-threads.patch
new file mode 100644
index 0000000000..5f5147e0df
--- /dev/null
+++ b/package/libgpg-error/0001-configure.ac-fix-build-without-threads.patch
@@ -0,0 +1,54 @@
+From 77c89f62f106d88ef2b5963f4a13755c337c793d Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Mon, 15 Feb 2021 07:56:29 +0100
+Subject: [PATCH] configure.ac: fix build without threads
+
+Cross-compilation of libgpg-error fails on toolchain without threads
+since commit 988211d3d4c1f3d5cfa6b460210f65ab636763b5,
+9ee011259f819a3cf50fe7019fa4366dbc437e0e and
+50e62b36ea01ed25d12c443088b85d4f41a2b3e1
+
+Indeed, since that time, libgpg-error assumes that pthread.h is always
+available resulting in the following error at configure time:
+
+checking for arm-unknown-linux-gnueabi-objdump... (cached) /tmp/instance-1/output-1/host/bin/arm-linux-objdump
+conftest.c:1:10: fatal error: pthread.h: No such file or directory
+    1 | #include <pthread.h>
+      |          ^~~~~~~~~~~
+compilation terminated.
+configure: generated src/lock-obj-pub.native.h using arm-unknown-linux-gnueabi-objdump and gawk
+checking whether to enable log_clock... no
+
+This error will in turn results in a build failure because
+"Can't determine mutex size" is echoed by gen-lock-obj.sh:
+
+In file included from strsource-sym.c:27:
+./gpg-error.h:1115:4: warning: missing terminating ' character
+ 1115 | Can't determine mutex size
+      |    ^
+
+Full build log:
+http://autobuild.buildroot.org/results/334/3344c96e5627a9327b0eabe0b27f34490bbabc0d/build-end.log
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://dev.gnupg.org/T5296]
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index b9a2a3e..15d9fdc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -599,7 +599,7 @@ if test x$cross_compiling = xyes; then
+   case $host in
+     *-*-linux*)
+     AC_CHECK_TOOL(OBJDUMP, [objdump])
+-    if test -n "$OBJDUMP"; then
++    if test -n "$OBJDUMP" -a x"$gl_use_threads" != xno; then
+       lock_obj_h_generated=yes
+       if test ! -d src; then mkdir src; fi
+       LOCK_ABI_VERSION=1 host=$host host_alias=$host_alias \
+-- 
+2.30.0
+
diff --git a/package/libgpg-error/libgpg-error.mk b/package/libgpg-error/libgpg-error.mk
index 78ed3e5464..1b35e5c8f0 100644
--- a/package/libgpg-error/libgpg-error.mk
+++ b/package/libgpg-error/libgpg-error.mk
@@ -15,5 +15,13 @@ LIBGPG_ERROR_CONFIG_SCRIPTS = gpg-error-config
 LIBGPG_ERROR_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
 LIBGPG_ERROR_CONF_OPTS = --disable-tests \
 		--host=$(BR2_PACKAGE_LIBGPG_ERROR_SYSCFG)
+# We're patching configure.ac
+LIBGPG_ERROR_AUTORECONF= YES
+
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+LIBGPG_ERROR_CONF_OPTS += --enable-threads
+else
+LIBGPG_ERROR_CONF_OPTS += --disable-threads
+endif
 
 $(eval $(autotools-package))

                 reply	other threads:[~2021-02-15 22:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210215215557.6903C8469B@busybox.osuosl.org \
    --to=peter@korsgaard.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.