瀏覽代碼

libxml2: fix build error with musl libc (fixes #454)

Thanks to nakarotori for spotting this.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Michael Heimpold 10 年之前
父節點
當前提交
dd538b6e02

+ 1
- 1
libs/libxml2/Makefile 查看文件

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=libxml2
11 11
 PKG_VERSION:=2.9.2
12
-PKG_RELEASE:=2
12
+PKG_RELEASE:=3
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://gd.tuwien.ac.at/languages/libxml/ \

+ 42
- 0
libs/libxml2/patches/0001-threads-use-forward-declarations-only-for-glibc-fixe.patch 查看文件

@@ -0,0 +1,42 @@
1
+From e3e04d254fb6bac49a285775b729e28b0500476c Mon Sep 17 00:00:00 2001
2
+From: Michael Heimpold <mhei@heimpold.de>
3
+Date: Sun, 21 Dec 2014 01:03:49 +0100
4
+Subject: [PATCH] threads: use forward declarations only for glibc (fixes
5
+ #704908)
6
+
7
+The declarations of pthread functions, used to generate weak references
8
+to them, fail to suppress macros. Thus, if any pthread function has
9
+been provided as a macro, compiling threads.c will fail.
10
+This breaks on musl libc, which defines pthread_equal as a macro (in
11
+addition to providing the function, as required).
12
+
13
+Prevent the declarations for e.g. musl libc by refining the condition.
14
+
15
+The idea for this solution was borrowed from the alpine linux guys, see
16
+http://git.alpinelinux.org/cgit/aports/tree/main/libxml2/libxml2-pthread.patch
17
+
18
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
19
+---
20
+ threads.c |    4 ++--
21
+ 1 file changed, 2 insertions(+), 2 deletions(-)
22
+
23
+--- a/threads.c
24
++++ b/threads.c
25
+@@ -47,7 +47,7 @@
26
+ #ifdef HAVE_PTHREAD_H
27
+ 
28
+ static int libxml_is_threaded = -1;
29
+-#ifdef __GNUC__
30
++#if defined(__GNUC__) && defined(__GLIBC__)
31
+ #ifdef linux
32
+ #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
33
+ extern int pthread_once (pthread_once_t *__once_control,
34
+@@ -89,7 +89,7 @@ extern int pthread_cond_signal ()
35
+ 	   __attribute((weak));
36
+ #endif
37
+ #endif /* linux */
38
+-#endif /* __GNUC__ */
39
++#endif /* defined(__GNUC__) && defined(__GLIBC__) */
40
+ #endif /* HAVE_PTHREAD_H */
41
+ 
42
+ /*