From patchwork Wed Aug 5 10:43:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 503969 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 5FCAA1402BA for ; Wed, 5 Aug 2015 20:43:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E37E895488; Wed, 5 Aug 2015 10:42:59 +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 bdljXVAwi8O2; Wed, 5 Aug 2015 10:42:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 16B019509D; Wed, 5 Aug 2015 10:42:58 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 1E9541C2265 for ; Wed, 5 Aug 2015 10:42:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 18D03A39E1 for ; Wed, 5 Aug 2015 10:42:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OpS7HSR3rdCz for ; Wed, 5 Aug 2015 10:42:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx02.posteo.de (mx02.posteo.de [89.146.194.165]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 8662EA39DD for ; Wed, 5 Aug 2015 10:42:55 +0000 (UTC) Received: from dovecot04.posteo.de (unknown [185.67.36.27]) by mx02.posteo.de (Postfix) with ESMTPS id B1CA825ACC27 for ; Wed, 5 Aug 2015 12:42:52 +0200 (CEST) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot04.posteo.de (Postfix) with ESMTPSA id 3mmV0C4y1vzFpW6 for ; Wed, 5 Aug 2015 12:42:51 +0200 (CEST) Received: from timelineX.localdomain (ip5b4111d2.dynamic.kabel-deutschland.de [91.65.17.210]) (Authenticated sender: joerg.krause@embedded.rocks) by embedded.rocks (Postfix) with ESMTPSA id 81A6398032E; Wed, 5 Aug 2015 12:42:50 +0200 (CEST) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Wed, 5 Aug 2015 12:43:49 +0200 Message-Id: <1438771429-15145-1-git-send-email-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/mpd: add patch to fix musl gcc5 build issue 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" Add a patch from the Alpine Linux project [1] to fix a musl build issue with gcc 5: ``` error: temporary of non-literal type ‘pthread_mutex_t’ in a constant expression constexpr PosixMutex():mutex(PTHREAD_MUTEX_INITIALIZER) {} ``` Problem has been reported by the Alpine team upstream and was closed by the MPD maintainer with WONTFIX: http://bugs.musicpd.org/view.php?id=4387 http://bugs.musicpd.org/view.php?id=4110 However... POSIX does not permit using PTHREAD_COND_INITIALIZER except for static initialization, and certainly does not permit using it as a value. Also POSIX does not specify the type of the object (it's opaque) so if there are any types for which their code would be invalid C++, then their code is invalid. Also, volatile in the type is necessary. without that, LTO can break the code. [1] http://git.alpinelinux.org/cgit/aports/log/main/mpd/musl-gcc5-fixes.patch Signed-off-by: Jörg Krause --- package/mpd/0002-musl-gcc5-fixes.patch | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 package/mpd/0002-musl-gcc5-fixes.patch diff --git a/package/mpd/0002-musl-gcc5-fixes.patch b/package/mpd/0002-musl-gcc5-fixes.patch new file mode 100644 index 0000000..a4c65cc --- /dev/null +++ b/package/mpd/0002-musl-gcc5-fixes.patch @@ -0,0 +1,56 @@ +musl gcc5 fixes + +Fetch from: +http://git.alpinelinux.org/cgit/aports/plain/main/mpd/musl-gcc5-fixes.patch + +Problem has been reported upstream and closed with WONTFIX: +http://bugs.musicpd.org/view.php?id=4387 +http://bugs.musicpd.org/view.php?id=4110 + +however... + +POSIX does not permit using PTHREAD_COND_INITIALIZER except for static +initialization, and certainly does not permit using it as a value + +also POSIX does not specify the type of the object (it's opaque) so if +there are any types for which their code would be invalid C++, then their +code is invalid + +also, volatile in the type is necessary. without that, LTO can break the code. + +Signed-off-by: Jörg Krause + +--- ./src/notify.hxx.orig ++++ ./src/notify.hxx +@@ -28,7 +28,7 @@ + Cond cond; + bool pending; + +-#if !defined(WIN32) && !defined(__NetBSD__) && !defined(__BIONIC__) ++#if defined(__GLIBC__) + constexpr + #endif + notify():pending(false) {} +--- ./src/thread/PosixCond.hxx.orig ++++ ./src/thread/PosixCond.hxx +@@ -41,7 +41,7 @@ + pthread_cond_t cond; + + public: +-#if defined(__NetBSD__) || defined(__BIONIC__) ++#if !defined(__GLIBC__) + /* NetBSD's PTHREAD_COND_INITIALIZER is not compatible with + "constexpr" */ + PosixCond() { +--- ./src/thread/PosixMutex.hxx.orig ++++ ./src/thread/PosixMutex.hxx +@@ -41,7 +41,7 @@ + pthread_mutex_t mutex; + + public: +-#if defined(__NetBSD__) || defined(__BIONIC__) ++#if !defined(__GLIBC__) + /* NetBSD's PTHREAD_MUTEX_INITIALIZER is not compatible with + "constexpr" */ + PosixMutex() { +