All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libxml2: Fix musl compile
@ 2015-04-11  9:30 Bernd Kuhls
  2015-04-11 13:34 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2015-04-11  9:30 UTC (permalink / raw)
  To: buildroot


Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 ...s-use-forward-declarations-only-for-glibc.patch |   52 ++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 package/libxml2/0002-threads-use-forward-declarations-only-for-glibc.patch

diff --git a/package/libxml2/0002-threads-use-forward-declarations-only-for-glibc.patch b/package/libxml2/0002-threads-use-forward-declarations-only-for-glibc.patch
new file mode 100644
index 0000000..4123306
--- /dev/null
+++ b/package/libxml2/0002-threads-use-forward-declarations-only-for-glibc.patch
@@ -0,0 +1,52 @@
+Fix musl compile
+
+Downloaded from upstream commit
+https://git.gnome.org/browse/libxml2/commit/?id=fff8a6b87e05200a0ad0af6f86c2e859c7de9172
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+From fff8a6b87e05200a0ad0af6f86c2e859c7de9172 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Mon, 22 Dec 2014 11:12:12 +0800
+Subject: threads: use forward declarations only for glibc
+
+Fixes bug #704908
+
+The declarations of pthread functions, used to generate weak references
+to them, fail to suppress macros. Thus, if any pthread function has
+been provided as a macro, compiling threads.c will fail.
+This breaks on musl libc, which defines pthread_equal as a macro (in
+addition to providing the function, as required).
+
+Prevent the declarations for e.g. musl libc by refining the condition.
+
+The idea for this solution was borrowed from the alpine linux guys, see
+http://git.alpinelinux.org/cgit/aports/tree/main/libxml2/libxml2-pthread.patch
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+
+diff --git a/threads.c b/threads.c
+index 8921204..78006a2 100644
+--- a/threads.c
++++ b/threads.c
+@@ -47,7 +47,7 @@
+ #ifdef HAVE_PTHREAD_H
+ 
+ static int libxml_is_threaded = -1;
+-#ifdef __GNUC__
++#if defined(__GNUC__) && defined(__GLIBC__)
+ #ifdef linux
+ #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
+ extern int pthread_once (pthread_once_t *__once_control,
+@@ -89,7 +89,7 @@ extern int pthread_cond_signal ()
+ 	   __attribute((weak));
+ #endif
+ #endif /* linux */
+-#endif /* __GNUC__ */
++#endif /* defined(__GNUC__) && defined(__GLIBC__) */
+ #endif /* HAVE_PTHREAD_H */
+ 
+ /*
+-- 
+cgit v0.10.2
+
-- 
1.7.10.4

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

* [Buildroot] [PATCH 1/1] package/libxml2: Fix musl compile
  2015-04-11  9:30 [Buildroot] [PATCH 1/1] package/libxml2: Fix musl compile Bernd Kuhls
@ 2015-04-11 13:34 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2015-04-11 13:34 UTC (permalink / raw)
  To: buildroot

Dear Bernd Kuhls,

On Sat, 11 Apr 2015 11:30:55 +0200, Bernd Kuhls wrote:
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
>  ...s-use-forward-declarations-only-for-glibc.patch |   52 ++++++++++++++++++++
>  1 file changed, 52 insertions(+)
>  create mode 100644 package/libxml2/0002-threads-use-forward-declarations-only-for-glibc.patch

Applied, thanks.

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

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

end of thread, other threads:[~2015-04-11 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-11  9:30 [Buildroot] [PATCH 1/1] package/libxml2: Fix musl compile Bernd Kuhls
2015-04-11 13:34 ` 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.