From patchwork Fri Sep 12 01:45:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten ter Huurne X-Patchwork-Id: 388462 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 56B5A140131 for ; Fri, 12 Sep 2014 11:45:53 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3D3E7A1A65; Fri, 12 Sep 2014 01:45:52 +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 XvNNav4MvTxF; Fri, 12 Sep 2014 01:45:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id BAFEBA1A51; Fri, 12 Sep 2014 01:45:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 475851C1E6B for ; Fri, 12 Sep 2014 01:45:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4047B91D37 for ; Fri, 12 Sep 2014 01:45:48 +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 QBQ5Sg7uHIwe for ; Fri, 12 Sep 2014 01:45:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by whitealder.osuosl.org (Postfix) with ESMTPS id A4FF691D15 for ; Fri, 12 Sep 2014 01:45:46 +0000 (UTC) Received: from mfilter25-d.gandi.net (mfilter25-d.gandi.net [217.70.178.153]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id E646FFB8A0; Fri, 12 Sep 2014 03:45:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter25-d.gandi.net Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter25-d.gandi.net (mfilter25-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id wCfCGHMf7l03; Fri, 12 Sep 2014 03:45:42 +0200 (CEST) X-Originating-IP: 88.159.34.112 Received: from starbug-2.treewalker.org (unknown [88.159.34.112]) (Authenticated sender: relay@treewalker.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 55A50FB88B; Fri, 12 Sep 2014 03:45:42 +0200 (CEST) Received: from hyperion.trinair2002 (hyperion.trinair2002 [192.168.0.43]) by starbug-2.treewalker.org (Postfix) with ESMTP id DD22631876; Fri, 12 Sep 2014 03:45:41 +0200 (CEST) From: Maarten ter Huurne To: buildroot@busybox.net Date: Fri, 12 Sep 2014 03:45:39 +0200 Message-Id: <1410486339-2001-1-git-send-email-maarten@treewalker.org> X-Mailer: git-send-email 1.8.4.5 Subject: [Buildroot] [PATCH] rpi-userland: Add patches to fix compilation with musl libc X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Maarten ter Huurne --- .../rpi-userland-003-disable-timer_t-typedef.patch | 22 ++++++++++++++++++++++ .../rpi-userland-004-include-for-HZ.patch | 19 +++++++++++++++++++ ...land-005-do-not-check-__USE_FILE_OFFSET64.patch | 16 ++++++++++++++++ package/rpi-userland/rpi-userland-006-mode_t.patch | 13 +++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch create mode 100644 package/rpi-userland/rpi-userland-004-include-for-HZ.patch create mode 100644 package/rpi-userland/rpi-userland-005-do-not-check-__USE_FILE_OFFSET64.patch create mode 100644 package/rpi-userland/rpi-userland-006-mode_t.patch diff --git a/package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch b/package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch new file mode 100644 index 0000000..e51a93f --- /dev/null +++ b/package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch @@ -0,0 +1,22 @@ +I don't know which platform is missing the timer_t definition, but it would +be better to check for that platform specifically instead of explicitly +excluding platforms that do have it. + +This fixes compilation with musl libc, which does define timer_t but does +not define __timer_t. + +Note that _HAVE_TIMER_T suggests it would prevent breakage, but it is +unrealistic to expect every application to set that macro. Not even all CMake +files in the userland package itself set it... + +--- userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe.org/interface/vcos/pthreads/vcos_platform.h 2014-08-05 19:43:53.000000000 +0200 ++++ rpi-userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe/interface/vcos/pthreads/vcos_platform.h 2014-09-11 21:04:36.418943953 +0200 +@@ -120,7 +120,7 @@ + + #define VCOS_ONCE_INIT PTHREAD_ONCE_INIT + +-#if defined(__arm__) && !defined(_HAVE_TIMER_T) && !defined(ANDROID) ++#if 0 + typedef __timer_t timer_t; + #endif + typedef struct VCOS_TIMER_T diff --git a/package/rpi-userland/rpi-userland-004-include-for-HZ.patch b/package/rpi-userland/rpi-userland-004-include-for-HZ.patch new file mode 100644 index 0000000..484aebe --- /dev/null +++ b/package/rpi-userland/rpi-userland-004-include-for-HZ.patch @@ -0,0 +1,19 @@ +There is no guarantee that defines HZ. And in musl libc, it +doesn't. Since this is a Linux-specific constant, include the Linux-specific +header for it. + +Note that HZ as defined by the system headers is the default value of HZ (100), +which might differ from the actual value of HZ in the kernel config. Ideally +userland would not use HZ at all and do all timing in milliseconds instead. + +--- userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe.org/interface/vcos/pthreads/vcos_pthreads.c 2014-08-05 19:43:53.000000000 +0200 ++++ rpi-userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe/interface/vcos/pthreads/vcos_pthreads.c 2014-09-11 21:49:48.497827644 +0200 +@@ -33,7 +33,7 @@ + #include + #include + #include +-#include ++#include + + /* Cygwin doesn't always have prctl.h and it doesn't have PR_SET_NAME */ + #if defined( __linux__ ) diff --git a/package/rpi-userland/rpi-userland-005-do-not-check-__USE_FILE_OFFSET64.patch b/package/rpi-userland/rpi-userland-005-do-not-check-__USE_FILE_OFFSET64.patch new file mode 100644 index 0000000..6a1ab47 --- /dev/null +++ b/package/rpi-userland/rpi-userland-005-do-not-check-__USE_FILE_OFFSET64.patch @@ -0,0 +1,16 @@ +This looks like a sanity check that 64-bit file offset definitions were indeed +provided by the included headers. But __USE_FILE_OFFSET64 is an internal +define of glibc, so don't perform this check when compiling with a different +libc. + +--- userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe.org/interface/vmcs_host/linux/vcfilesys.c 2014-08-05 19:43:53.000000000 +0200 ++++ rpi-userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe/interface/vmcs_host/linux/vcfilesys.c 2014-09-11 22:01:51.016328294 +0200 +@@ -49,7 +49,7 @@ + #include + #include + +-#if !defined(ANDROID) && !defined( __USE_FILE_OFFSET64 ) ++#if defined(__GLIBC__) && !defined( __USE_FILE_OFFSET64 ) + #error "__USE_FILE_OFFSET64 isn't defined" + #endif + diff --git a/package/rpi-userland/rpi-userland-006-mode_t.patch b/package/rpi-userland/rpi-userland-006-mode_t.patch new file mode 100644 index 0000000..6045ade --- /dev/null +++ b/package/rpi-userland/rpi-userland-006-mode_t.patch @@ -0,0 +1,13 @@ +The type of "st_mode" in "struct stat" is just "mode_t", not "__mode_t". + +--- userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe.org/interface/vmcs_host/linux/vcfilesys.c 2014-08-05 19:43:53.000000000 +0200 ++++ rpi-userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe/interface/vmcs_host/linux/vcfilesys.c 2014-09-12 00:28:46.553861915 +0200 +@@ -916,7 +916,7 @@ + + if (pathbuf) + { +- __mode_t mode = 0; ++ mode_t mode = 0; + struct stat sb; + + backslash_to_slash(pathbuf);