From patchwork Mon Nov 9 23:05:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 542045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 60F62141404 for ; Tue, 10 Nov 2015 10:05:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D9C5D87F91; Mon, 9 Nov 2015 23:05:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PrNDti09Fi0q; Mon, 9 Nov 2015 23:05:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id C874F87F69; Mon, 9 Nov 2015 23:05:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id F3C391BFC09 for ; Mon, 9 Nov 2015 23:05:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EE31388291 for ; Mon, 9 Nov 2015 23:05:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QGlSCBEKF5cJ for ; Mon, 9 Nov 2015 23:05:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by whitealder.osuosl.org (Postfix) with ESMTPS id 8A63088289 for ; Mon, 9 Nov 2015 23:05:51 +0000 (UTC) Received: from linux.local ([178.2.27.180]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Lugbo-1aMUoe1dke-00zqnS for ; Tue, 10 Nov 2015 00:05:48 +0100 From: Peter Seiderer To: buildroot@busybox.net Date: Tue, 10 Nov 2015 00:05:44 +0100 Message-Id: <1447110344-1446-1-git-send-email-ps.report@gmx.net> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-Provags-ID: V03:K0:pB9AAcWhGJEC/YCi/D/d2p7wnX8b01pndtttH9+xo3cIb/aZ5d6 EMUs83eqG4IGAdobz7tE+K/MzOwQNd0UD71YKM/R/LObUATxJ6ZkZfyV4OuOca+MkJ/luEJ dz3FvBrAAS/t26K55Rjcw3VmcdvCmAcGZOVNvytRbXGwyPyKAYYMq7neTxwmZn8ThquDk+0 W9tEUsnk48c+SB9KVZfrg== X-UI-Out-Filterresults: notjunk:1; V01:K0:rNhB/1jx+DY=:2pb8aiF3JLKmmxqqLO8lEx 7Ja5VCLHfyGtajyPzBxVcznaSEXQoN6loZ5axY2gwXWuN5kZZYoAdCmEoV+clV1O8UtD4qjPu iWyT+cf/y9ij6uAS5OP9QGyEgjUX1aZ8Q7xbZMjT+s4CjPnTQvNlbMOuMVYYX9Hjk4iIgZVU7 HkddXqnLDoysKwejbXdAwN6Ek3nbs33otUW4caKW7p/XVT7Ubuyy+XaEgJj/jBK8LcHWq2wi7 qIebtJZis8LWwiysHwVITnkxckAsrhgAdvHxhchFuhb523ZBemHtP5JjkP2fOV5KLR5NywHU3 5dFtjvBbNkgLWBO6AtFFMH5P/T8ZGEySjSHecQaWPIHmZoh4u5cqF6YlEhYYZxgMkoWAbbuM2 79T6n/P5U2m+3Vwftgmi5c5dtZtqIZyG68cOYm3HJiDvW1yWAo2Pag38G1jcW15RYIMfNXhLI t2SrMEHLfNLrLRzUYf2unLNSpl4lRkKQeICzm7Ufe3jg4T5o/bgzAUI9Z2I3fiHjvaWOW8+mP 3iBIovpNbZat4zE7r1trbHz6v4L9BYrpQl3/oUBz22AgffCxJayBJow4Nsw9UffbHsS5st8cO SLvIkz5A1ydmh62vzcNK2NEZoRbHxL+ABrlaZWQsV/3u7rG1Dhr+Gi74+KB8Ec3afe6RsWonV 1T79/26Z0Nx0RI3dLGqzNQKbWSySbp+Phh5fWyUq5UIFLViBC11HJTgYPJCqTKiRNe+KoPaC4 co7Lraxwbj+29Pr1/rG6Ft50McaWQpYP7rD4ahTnLajS2vblYhTQB94P1ZWjGx4AgpSnmS+pi yvvoxS3 Subject: [Buildroot] [RFC v1] directfb: fix musl compile X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" - use 'union sigval' instead of sigval_t (same as suggested for canfestival by Yann E. MORIN, see [2]) - delete DIRECT_RECURSIVE_MUTEX_INITIALIZER define (which uses unknown PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) - use DIRECT_MUTEX_INITIALIZER instead for trace.c (no recursive mutex needed) - use pthread_once and direct_recursive_mutex_init instead for directfb.c Fixes [1]: system.c:114:6: error: unknown type name 'sigval_t' and ../lib/direct/os/linux/glibc/mutex.h:49:53: error: ‘PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP’ undeclared (first use in this function) [1] http://autobuild.buildroot.net/results/548/548bf7b800a946e97135c0ba66363f388e517d6f [2] https://patchwork.ozlabs.org/patch/509731 Signed-off-by: Peter Seiderer --- RFC: not yet runtime tested --- ...6-Fix-musl-sigval_t-related-compile-error.patch | 39 ++++++++++ ...HREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch | 84 ++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 package/directfb/0006-Fix-musl-sigval_t-related-compile-error.patch create mode 100644 package/directfb/0007-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch diff --git a/package/directfb/0006-Fix-musl-sigval_t-related-compile-error.patch b/package/directfb/0006-Fix-musl-sigval_t-related-compile-error.patch new file mode 100644 index 0000000..2a78833 --- /dev/null +++ b/package/directfb/0006-Fix-musl-sigval_t-related-compile-error.patch @@ -0,0 +1,39 @@ +From fdc648277b65e657cebb5c1095a82445d6c2c914 Mon Sep 17 00:00:00 2001 +From: Peter Seiderer +Date: Mon, 9 Nov 2015 22:57:42 +0100 +Subject: [PATCH] Fix musl/sigval_t related compile error. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use 'union sigval' instead of sigval_t (same as suggested +for canfestival by Yann E. MORIN, see [1]). + +Fixes the following compile error with musl libc: + + system.c:114:6: error: unknown type name ‘sigval_t’ + sigval_t val; + +[1] https://patchwork.ozlabs.org/patch/509731 + +Signed-off-by: Peter Seiderer +--- + lib/direct/os/linux/glibc/system.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/direct/os/linux/glibc/system.c b/lib/direct/os/linux/glibc/system.c +index 32086a2..373a711 100644 +--- a/lib/direct/os/linux/glibc/system.c ++++ b/lib/direct/os/linux/glibc/system.c +@@ -111,7 +111,7 @@ direct_tgkill( int tgid, int tid, int sig ) + void + direct_trap( const char *domain, int sig ) + { +- sigval_t val; ++ union sigval val; + + if (direct_config->delay_trap_ms) { + D_LOG( Direct_Trap, VERBOSE, "NOT RAISING signal %d from %s, waiting for %dms... attach gdb --pid=%d\n", sig, domain, direct_config->delay_trap_ms, getpid() ); +-- +2.1.4 + diff --git a/package/directfb/0007-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch b/package/directfb/0007-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch new file mode 100644 index 0000000..702b03e --- /dev/null +++ b/package/directfb/0007-Fix-musl-PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP-comp.patch @@ -0,0 +1,84 @@ +From 85057029179c65bb31a1fdf44121773178e33cf4 Mon Sep 17 00:00:00 2001 +From: Peter Seiderer +Date: Mon, 9 Nov 2015 23:40:28 +0100 +Subject: [PATCH] Fix musl PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP compile + error. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- delete DIRECT_RECURSIVE_MUTEX_INITIALIZER define (which uses unknown + PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) +- use DIRECT_MUTEX_INITIALIZER instead for trace.c (no recursive + mutex needed) +- use pthread_once and direct_recursive_mutex_init instead for + directfb.c + +Fixes: + + ../lib/direct/os/linux/glibc/mutex.h:49:53: error: ‘PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP’ undeclared (first use in this function) + +Signed-off-by: Peter Seiderer +--- + lib/direct/os/linux/glibc/mutex.h | 1 - + lib/direct/trace.c | 2 +- + src/directfb.c | 11 ++++++++++- + 3 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/lib/direct/os/linux/glibc/mutex.h b/lib/direct/os/linux/glibc/mutex.h +index 1049c14..37573b2 100644 +--- a/lib/direct/os/linux/glibc/mutex.h ++++ b/lib/direct/os/linux/glibc/mutex.h +@@ -46,7 +46,6 @@ struct __D_DirectMutex { + /**********************************************************************************************************************/ + + #define DIRECT_MUTEX_INITIALIZER(name) { PTHREAD_MUTEX_INITIALIZER } +-#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name) { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP } + + #endif + +diff --git a/lib/direct/trace.c b/lib/direct/trace.c +index cb43954..88d8e5d 100644 +--- a/lib/direct/trace.c ++++ b/lib/direct/trace.c +@@ -89,7 +89,7 @@ struct __D_DirectTraceBuffer { + /**************************************************************************************************/ + + static DirectLink *buffers; +-static DirectMutex buffers_lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(buffers_lock); ++static DirectMutex buffers_lock = DIRECT_MUTEX_INITIALIZER(buffers_lock); + + /**************************************************************************************************/ + +diff --git a/src/directfb.c b/src/directfb.c +index 713f6c4..d060e58 100644 +--- a/src/directfb.c ++++ b/src/directfb.c +@@ -163,6 +163,15 @@ DirectFBSetOption( const char *name, const char *value ) + return DFB_OK; + } + ++ ++static pthread_once_t lock_init_once = PTHREAD_ONCE_INIT; ++static DirectMutex lock; ++ ++static void lock_init(void) ++{ ++ direct_recursive_mutex_init(&lock); ++} ++ + /* + * Programs have to call this to get the super interface + * which is needed to access other functions +@@ -215,7 +224,7 @@ DirectFBCreate( IDirectFB **interface_ptr ) + if (dfb_config->remote.host) + return CreateRemote( dfb_config->remote.host, dfb_config->remote.port, interface_ptr ); + +- static DirectMutex lock = DIRECT_RECURSIVE_MUTEX_INITIALIZER(lock); ++ pthread_once(&lock_init_once, lock_init); + + direct_mutex_lock( &lock ); + +-- +2.1.4 +