]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libxml2/0002-threads-use-forward-declarations-only-for-glibc.patch
package/yajl: add patch to fix static build issue
[coffee/buildroot.git] / package / libxml2 / 0002-threads-use-forward-declarations-only-for-glibc.patch
1 Fix musl compile
2
3 Downloaded from upstream commit
4 https://git.gnome.org/browse/libxml2/commit/?id=fff8a6b87e05200a0ad0af6f86c2e859c7de9172
5
6 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
7 ---
8 From fff8a6b87e05200a0ad0af6f86c2e859c7de9172 Mon Sep 17 00:00:00 2001
9 From: Michael Heimpold <mhei@heimpold.de>
10 Date: Mon, 22 Dec 2014 11:12:12 +0800
11 Subject: threads: use forward declarations only for glibc
12
13 Fixes bug #704908
14
15 The declarations of pthread functions, used to generate weak references
16 to them, fail to suppress macros. Thus, if any pthread function has
17 been provided as a macro, compiling threads.c will fail.
18 This breaks on musl libc, which defines pthread_equal as a macro (in
19 addition to providing the function, as required).
20
21 Prevent the declarations for e.g. musl libc by refining the condition.
22
23 The idea for this solution was borrowed from the alpine linux guys, see
24 http://git.alpinelinux.org/cgit/aports/tree/main/libxml2/libxml2-pthread.patch
25
26 Signed-off-by: Michael Heimpold <mhei@heimpold.de>
27
28 diff --git a/threads.c b/threads.c
29 index 8921204..78006a2 100644
30 --- a/threads.c
31 +++ b/threads.c
32 @@ -47,7 +47,7 @@
33  #ifdef HAVE_PTHREAD_H
34  
35  static int libxml_is_threaded = -1;
36 -#ifdef __GNUC__
37 +#if defined(__GNUC__) && defined(__GLIBC__)
38  #ifdef linux
39  #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
40  extern int pthread_once (pthread_once_t *__once_control,
41 @@ -89,7 +89,7 @@ extern int pthread_cond_signal ()
42            __attribute((weak));
43  #endif
44  #endif /* linux */
45 -#endif /* __GNUC__ */
46 +#endif /* defined(__GNUC__) && defined(__GLIBC__) */
47  #endif /* HAVE_PTHREAD_H */
48  
49  /*
50 -- 
51 cgit v0.10.2
52