Skip to contentSkip to conversation

package/qpid-proton: fix build on musl

PATCH New Fabrice Fontaine 2 participants 2 messages Mar 20, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/qpid-proton: fix build on musl

Fix build on musl with qpid-proton in version 0.33.0 which was added with commit d4c0fde91da0d79204a21ed8de1bd410efa1c4d6

Fixes:
- http://autobuild.buildroot.org/results/6a901b9ff68b7f52cabf8273d1017025fbd93b0d

---
 ...r-epoll-internal.h-fix-build-on-musl.patch | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/qpid-proton/0001-c-src-proactor-epoll-internal.h-fix-build-on-musl.patch
package/qpid-proton/0001-c-src-proactor-epoll-internal.h-fix-build-on-musl.patch new file +43 -0
new file mode 100644
index 0000000000..1806a7a780
@@ -0,0 +1,43 @@
+From e4211aa978606b9201dc0eb2399d1af6c010a46a Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Wed, 17 Mar 2021 17:21:52 +0100
+Subject: [PATCH] c/src/proactor/epoll-internal.h: fix build on musl
+
+Build with epoll proactor on musl is broken since at least version 0.23.0 and
+https://github.com/apache/qpid-proton/commit/37136940e3077f25ce58c94775f48c66f666f4a8
+because musl does not define PTHREAD_MUTEX_ADAPTIVE_NP resulting in the
+following build failure:
+
+In file included from /home/giuliobenetti/autobuild/run/instance-0/output-1/build/qpid-proton-0.33.0/c/src/proactor/epoll.c:60:
+/home/giuliobenetti/autobuild/run/instance-0/output-1/build/qpid-proton-0.33.0/c/src/proactor/epoll-internal.h: In function 'pmutex_init':
+/home/giuliobenetti/autobuild/run/instance-0/output-1/build/qpid-proton-0.33.0/c/src/proactor/epoll-internal.h:319:36: error: 'PTHREAD_MUTEX_ADAPTIVE_NP' undeclared (first use in this function); did you mean 'PTHREAD_MUTEX_STALLED'?
+  319 |   pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
+      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
+      |                                    PTHREAD_MUTEX_STALLED
+
+Fixes:
+ - http://autobuild.buildroot.org/results/6a901b9ff68b7f52cabf8273d1017025fbd93b0d
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Upstream status: https://issues.apache.org/jira/browse/PROTON-2346]
+---
+ c/src/proactor/epoll-internal.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/c/src/proactor/epoll-internal.h b/c/src/proactor/epoll-internal.h
+index e8c9f0a9..fa6a6f2a 100644
+--- a/c/src/proactor/epoll-internal.h
++++ b/c/src/proactor/epoll-internal.h
+@@ -315,7 +315,9 @@ static inline void pmutex_init(pthread_mutex_t *pm){
+   pthread_mutexattr_t attr;
+ 
+   pthread_mutexattr_init(&attr);
++#ifdef PTHREAD_MUTEX_ADAPTIVE_NP
+   pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
++#endif
+   if (pthread_mutex_init(pm, &attr)) {
+     perror("pthread failure");
+     abort();
+-- 
+2.30.1
+
Signature · 1 line
2.30.1
#1 lore raw

PATCH 1/1 package/qpid-proton: fix build on musl

Quoted 11 lines · On Sat, 20 Mar 2021 18:40:56 +0100 Fabrice Fontaine…

Fix build on musl with qpid-proton in version 0.33.0 which was added with commit d4c0fde91da0d79204a21ed8de1bd410efa1c4d6

Fixes:
- http://autobuild.buildroot.org/results/6a901b9ff68b7f52cabf8273d1017025fbd93b0d

---
 ...r-epoll-internal.h-fix-build-on-musl.patch | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/qpid-proton/0001-c-src-proactor-epoll-internal.h-fix-build-on-musl.patch

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com