rpi-userland: Add patches to fix compilation with musl libc
PATCH 1/1 rpi-userland: Add patches to fix compilation with musl libc
--- .../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
package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch new file +22 -0
@@ -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
package/rpi-userland/rpi-userland-004-include-for-HZ.patch new file +19 -0
@@ -0,0 +1,19 @@ +There is no guarantee that <sys/param.h> 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 <stdlib.h> + #include <stdio.h> + #include <sys/time.h> +-#include <sys/param.h> ++#include <linux/param.h> + + /* Cygwin doesn't always have prctl.h and it doesn't have PR_SET_NAME */ + #if defined( __linux__ )
package/rpi-userland/rpi-userland-005-do-not-check-__USE_FILE_OFFSET64.patch new file +16 -0
@@ -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 <ctype.h> + #include <limits.h> + +-#if !defined(ANDROID) && !defined( __USE_FILE_OFFSET64 ) ++#if defined(__GLIBC__) && !defined( __USE_FILE_OFFSET64 ) + #error "__USE_FILE_OFFSET64 isn't defined" + #endif +
package/rpi-userland/rpi-userland-006-mode_t.patch new file +13 -0
@@ -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);
Signature · 1 line
1.8.4.5
PATCH 1/1 rpi-userland: Add patches to fix compilation with musl libc
Dear Maarten ter Huurne,
Quoted 11 lines · Maarten ter Huurne
Signed-off-by Maarten ter Huurne <[email protected]>--- .../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
Thanks. The naming of the patch files as well as the descriptions are good, but each patch is missing a SoB line, which we require. See
http://buildroot.org/downloads/manual/manual.html#_format_and_licensing_of_the_package_patches.
Quoted 18 lines
package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch new file +12
-0@@ -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
package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch line 22
Quoted 10 lines
package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch new file +10
-0++++ 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
I'm just not entirely convinced by this one: it should be the job of the rpi-userland build system to check for timer_t, and define HAVE_TIMER_T accordingly. It's definitely not the job of each and every application to set that macro, but really rpi-userland's build system.
Also, could you submit those patches upstream? We don't like much to carry a lot of patches in Buildroot, so the more patches can be merged upstream, the better.
Thanks a lot!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 rpi-userland: Add patches to fix compilation with musl libc
Quoted 4 lines · On Friday 12 September 2014 09:32:53 Thomas Petazzoni wrote:
Thanks. The naming of the patch files as well as the descriptions are good, but each patch is missing a SoB line, which we require. See
http://buildroot.org/downloads/manual/manual.html#_format_and_licensing_of_the_package_patches.
I'll add those and resubmit.
Quoted 31 lines
Quoted 31 lines
diff --git
a/package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patchb/package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patchnew file mode 100644
index 0000000..e51a93f
---/dev/null
+++b/package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch(quoted diff) +1
-0@@ -0,0 +1,22 @@ +I don't know which platform is missing the timer_t definition, but itwould +be better to check for that platform specifically instead of explicitly +excluding platforms that do have it.
(quoted diff) +2
-0+ +This fixes compilation with musl libc, which does define timer_t butdoes +not define
__timer_t.package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch new file +3
-0+ +Note that _HAVE_TIMER_T suggests it would prevent breakage, but it is +unrealistic to expect every application to set that macro. Not even allCMake +files in the userland package itself set it...
+
+---
userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe.org/interface/vcos/pthreads/vcos_platform.h2014-08-05 19:43:53.000000000 +0200 ++++
rpi-userland-f9e6f9f3def8dc18dc0092cd695ccf53b8ba3efe/interface/vcos/pthreads/vcos_platform.h2014-09-11 21:04:36.418943953 +0200 +@@ -120,7
+120,7 @@package/rpi-userland/rpi-userland-003-disable-timer_t-typedef.patch new file +5
-0+ + #define VCOS_ONCE_INIT PTHREAD_ONCE_INIT + +-#if defined(__arm__) && !defined(_HAVE_TIMER_T) && !defined(ANDROID) ++#if 0
Quoted 8 lines
Quoted 3 lines
+ typedef
__timer_ttimer_t;
+ #endif
+ typedef structVCOS_TIMER_TI'm just not entirely convinced by this one: it should be the job of the rpi-userland build system to check for
timer_t, and defineHAVE_TIMER_Taccordingly. It's definitely not the job of each and every application to set that macro, but really rpi-userland's build system.
That's what you'd expect from the HAVE_* name, but there isn't a timer_h check in the rpi-userland build system. There is a hardcoded "CFLAGS+=- D_HAVE_TIMER_T" for a single application inside rpi-userland, the other applications don't define it.
The reason I wrote "every application" is that this header can be indirectly included by applications using EGL:
$ output/host/usr/bin/pkg-config --cflags egl -I/home/mth/pi/buildroot/output/host/usr/arm-pingux-linux- musleabihf/sysroot/usr/include/ -I/home/mth/pi/buildroot/output/host/usr/arm-pingux-linux- musleabihf/sysroot/usr/include/interface/vcos/pthreads/ -I/home/mth/pi/buildroot/output/host/usr/arm-pingux-linux- musleabihf/sysroot/usr/include/interface/vmcs_host/linux/
In theory -D_HAVE_TIMER_H could be added to Cflags in egl.pc, but that might interfere with application packages. At least in the context of Buildroot, where none of the supported libcs require this typedef, disabling this check is the safest approach, in my opinion.
Also I wonder if there really is a platform on which this typedef helps: it would only help on a platform that does implement POSIX timers (it's an optional feature), but for some reason doesn't define timer_t. It just doesn't sound very likely...
Looking at the header again, I see it doesn't actually use timer_t anywhere. In fact, nowhere in the entire rpi_userland package is timer_t used. So the whole check + typedef can just be removed.
Quoted 3 lines
Also, could you submit those patches upstream? We don't like much to carry a lot of patches in Buildroot, so the more patches can be merged upstream, the better.
https://github.com/raspberrypi/userland/issues/202
https://github.com/raspberrypi/userland/pull/201
Bye,
Maarten
PATCH 1/1 rpi-userland: Add patches to fix compilation with musl libc
Dear Maarten ter Huurne,
Quoted 21 lines · Maarten ter Huurne
That's what you'd expect from the HAVE_* name, but there isn't a
timer_hcheck in the rpi-userland build system. There is a hardcoded "CFLAGS+=-D_HAVE_TIMER_T" for a single application inside rpi-userland, the other applications don't define it.The reason I wrote "every application" is that this header can be indirectly included by applications using EGL:
$ output/host/usr/bin/pkg-config --cflags egl -I/home/mth/pi/buildroot/output/host/usr/arm-pingux-linux- musleabihf/sysroot/usr/include/ -I/home/mth/pi/buildroot/output/host/usr/arm-pingux-linux- musleabihf/sysroot/usr/include/interface/vcos/pthreads/ -I/home/mth/pi/buildroot/output/host/usr/arm-pingux-linux- musleabihf/sysroot/usr/include/interface/vmcs_host/linux/In theory -D_HAVE_TIMER_H could be added to Cflags in egl.pc, but that might interfere with application packages. At least in the context of Buildroot, where none of the supported libcs require this typedef, disabling this check is the safest approach, in my opinion.
Quoted 8 lines
Also I wonder if there really is a platform on which this typedef helps: it would only help on a platform that does implement POSIX timers (it's an optional feature), but for some reason doesn't define
timer_t. It just doesn't sound very likely...Looking at the header again, I see it doesn't actually use
timer_tanywhere. In fact, nowhere in the entirerpi_userlandpackage istimer_tused. So the whole check + typedef can just be removed.
Ok, thanks a lot for the explanation. Then just remove the definition, and submit the patch upstream.
Quoted 7 lines
Quoted 4 lines
Also, could you submit those patches upstream? We don't like much to carry a lot of patches in Buildroot, so the more patches can be merged upstream, the better.
https://github.com/raspberrypi/userland/issues/202
https://github.com/raspberrypi/userland/pull/201
Great!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 rpi-userland: Add patches to fix compilation with musl libc
Also submitted upstream:
https://github.com/raspberrypi/userland/pull/201
--- .../rpi-userland-003-remove-timer_t-typedef.patch | 58 ++++++++++++++++++++++ .../rpi-userland-004-include-for-HZ.patch | 35 +++++++++++++ ...land-005-do-not-check-__USE_FILE_OFFSET64.patch | 32 ++++++++++++ package/rpi-userland/rpi-userland-006-mode_t.patch | 28 +++++++++++ 4 files changed, 153 insertions(+) create mode 100644 package/rpi-userland/rpi-userland-003-remove-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
package/rpi-userland/rpi-userland-003-remove-timer_t-typedef.patch new file +58 -0
@@ -0,0 +1,58 @@ +From c8a01064bdd1fc923b1da1a72f1fca5bb20130b6 Mon Sep 17 00:00:00 2001 +From: Maarten ter Huurne <[email protected]> +Date: Fri, 12 Sep 2014 18:28:51 +0200 +Subject: [PATCH] vcos: Remove timer_t fallback definition + +The timer_t type is not used anywhere in the code. The fallback typedef +can break builds though on systems where timer_t exists but is not an +alias for __timer_t, such as systems using the musl libc. + +Signed-off-by: Maarten ter Huurne <[email protected]> +--- + host_applications/linux/apps/hello_pi/CMakeLists.txt | 2 +- + host_applications/linux/apps/hello_pi/libs/vgfont/Makefile | 1 - + interface/vcos/pthreads/vcos_platform.h | 3 --- + 3 files changed, 1 insertion(+), 5 deletions(-) + +diff --git a/host_applications/linux/apps/hello_pi/CMakeLists.txt b/host_applications/linux/apps/hello_pi/CMakeLists.txt +index efb0bf4..d9b0eaf 100644 +--- a/host_applications/linux/apps/hello_pi/CMakeLists.txt ++++ b/host_applications/linux/apps/hello_pi/CMakeLists.txt +@@ -24,7 +24,7 @@ add_subdirectory(hello_teapot) + + if(BUILD_FONT) + set(VGFONT_SRCS libs/vgfont/font.c libs/vgfont/vgft.c libs/vgfont/graphics.c) +-set_source_files_properties(${VGFONT_SRCS} PROPERTIES COMPILE_DEFINITIONS "_HAVE_TIMER_T") ++set_source_files_properties(${VGFONT_SRCS} PROPERTIES COMPILE_DEFINITIONS) + add_library(vgfont ${VGFONT_SRCS}) + + add_subdirectory(hello_font) +diff --git a/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile b/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile +index d04fb08..1e2a22b 100755 +--- a/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile ++++ b/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile +@@ -2,7 +2,6 @@ OBJS=font.o vgft.o graphics.o + LIB=libvgfont.a + + INCLUDES+=-I$(SDKSTAGE)/usr/include/freetype2 -I$(SDKSTAGE)/usr/include -I$(SDKSTAGE)/usr/include/arm-linux-gnueabi +-CFLAGS+=-D_HAVE_TIMER_T + + include ../../Makefile.include + +diff --git a/interface/vcos/pthreads/vcos_platform.h b/interface/vcos/pthreads/vcos_platform.h +index 468098b..2095e25 100755 +--- a/interface/vcos/pthreads/vcos_platform.h ++++ b/interface/vcos/pthreads/vcos_platform.h +@@ -120,9 +120,6 @@ typedef struct + + #define VCOS_ONCE_INIT PTHREAD_ONCE_INIT + +-#if defined(__arm__) && !defined(_HAVE_TIMER_T) && !defined(ANDROID) +-typedef __timer_t timer_t; +-#endif + typedef struct VCOS_TIMER_T + { + pthread_t thread; /**< id of the timer thread */ +-- +1.8.4.5 +
package/rpi-userland/rpi-userland-004-include-for-HZ.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 16ff117cc92067990ccedeba1f59797aa10669b2 Mon Sep 17 00:00:00 2001 +From: Maarten ter Huurne <[email protected]> +Date: Fri, 12 Sep 2014 04:24:30 +0200 +Subject: [PATCH] vcos: Fixed include for "HZ" + +There is no guarantee that <sys/param.h> 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. + +Signed-off-by: Maarten ter Huurne <[email protected]> +--- + interface/vcos/pthreads/vcos_pthreads.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/interface/vcos/pthreads/vcos_pthreads.c b/interface/vcos/pthreads/vcos_pthreads.c +index 668f647..fdc8bc4 100644 +--- a/interface/vcos/pthreads/vcos_pthreads.c ++++ b/interface/vcos/pthreads/vcos_pthreads.c +@@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include <stdlib.h> + #include <stdio.h> + #include <sys/time.h> +-#include <sys/param.h> ++#include <linux/param.h> + + /* Cygwin doesn't always have prctl.h and it doesn't have PR_SET_NAME */ + #if defined( __linux__ ) +-- +1.8.4.5 +
package/rpi-userland/rpi-userland-005-do-not-check-__USE_FILE_OFFSET64.patch new file +32 -0
@@ -0,0 +1,32 @@ +From a54f5fd6fab5a968636e8efc12820a65c58d00e0 Mon Sep 17 00:00:00 2001 +From: Maarten ter Huurne <[email protected]> +Date: Fri, 12 Sep 2014 04:27:06 +0200 +Subject: [PATCH] vmcs_host: Only check __USE_FILE_OFFSET64 when compiling + against glibc + +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. + +Signed-off-by: Maarten ter Huurne <[email protected]> +--- + interface/vmcs_host/linux/vcfilesys.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/interface/vmcs_host/linux/vcfilesys.c b/interface/vmcs_host/linux/vcfilesys.c +index ab65e3e..5f31f6c 100644 +--- a/interface/vmcs_host/linux/vcfilesys.c ++++ b/interface/vmcs_host/linux/vcfilesys.c +@@ -49,7 +49,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include <ctype.h> + #include <limits.h> + +-#if !defined(ANDROID) && !defined( __USE_FILE_OFFSET64 ) ++#if defined(__GLIBC__) && !defined( __USE_FILE_OFFSET64 ) + #error "__USE_FILE_OFFSET64 isn't defined" + #endif + +-- +1.8.4.5 +
package/rpi-userland/rpi-userland-006-mode_t.patch new file +28 -0
@@ -0,0 +1,28 @@ +From 8cdd8539d1074ab70bf904986fc38761320de563 Mon Sep 17 00:00:00 2001 +From: Maarten ter Huurne <[email protected]> +Date: Fri, 12 Sep 2014 04:28:41 +0200 +Subject: [PATCH] vmcs_host: Correct type name for file mode + +The type of "st_mode" in "struct stat" is "mode_t", not "__mode_t". + +Signed-off-by: Maarten ter Huurne <[email protected]> +--- + interface/vmcs_host/linux/vcfilesys.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/interface/vmcs_host/linux/vcfilesys.c b/interface/vmcs_host/linux/vcfilesys.c +index 5f31f6c..53c7486 100644 +--- a/interface/vmcs_host/linux/vcfilesys.c ++++ b/interface/vmcs_host/linux/vcfilesys.c +@@ -916,7 +916,7 @@ int vc_hostfs_set_attr(const char *path, fattributes_t attr) + + if (pathbuf) + { +- __mode_t mode = 0; ++ mode_t mode = 0; + struct stat sb; + + backslash_to_slash(pathbuf); +-- +1.8.4.5 +
Signature · 1 line
1.8.4.5
PATCH v3 1/1 rpi-userland: bump revision for musl compile fixes
---
The second version of this patch was missing the "v2" label; this is the third version.
The changes from v2, plus an additional change I made later were merged upstream. This patch bumps the git revision to the merge commit.
rpi-userland-002-remove-faulty-assert.patch had to be updated to match other changes in the code that are pulled in by the version bump. I checked that the updated patch compiles fine, but I have no idea whether it is still needed to fix or work around a runtime problem.
.../rpi-userland-002-remove-faulty-assert.patch | 25 ++++++++++++---------- package/rpi-userland/rpi-userland.mk | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-)
package/rpi-userland/rpi-userland-002-remove-faulty-assert.patch +14 -11
@@ -3,19 +3,22 @@ interface: remove faulty assert() to make weston happy at runtime This was removed after a discussion on IRC with the weston guys ('daniels' on irc.freenode.net/#wayland). +Rebased on 4333d6d by Maarten ter Huurne <[email protected]>. + Signed-off-by: "Yann E. MORIN" <[email protected]> --- Upstream status: no, will be pushed by weston guys later. If not, I'll do it. -diff -durN rpi-userland-77d32cd.orig/interface/vmcs_host/vc_vchi_dispmanx.c rpi-userland-77d32cd/interface/vmcs_host/vc_vchi_dispmanx.c ---- rpi-userland-77d32cd.orig/interface/vmcs_host/vc_vchi_dispmanx.c 2013-10-04 17:43:44.000000000 +0200 -+++ rpi-userland-77d32cd/interface/vmcs_host/vc_vchi_dispmanx.c 2013-10-08 22:28:51.611433539 +0200 -@@ -1187,7 +1187,6 @@ - continue; - - if(dispmanx_client.update_callback ) { -- vcos_assert( dispmanx_client.pending_update_handle == (DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1]); - dispmanx_client.update_callback((DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1], dispmanx_client.update_callback_param); - } - } +diff --git a/interface/vmcs_host/vc_vchi_dispmanx.c b/interface/vmcs_host/vc_vchi_dispmanx.c +index 85b373c..59a01f8 100755 +--- a/interface/vmcs_host/vc_vchi_dispmanx.c ++++ b/interface/vmcs_host/vc_vchi_dispmanx.c +@@ -1296,7 +1296,6 @@ static void *dispmanx_notify_func( void *arg ) { + // Decrement the use count - the corresponding "use" is in vc_dispmanx_update_submit. + vchi_service_release(dispmanx_client.notify_handle[0]); + if (dispmanx_client.update_callback ) { +- vcos_assert( dispmanx_client.pending_update_handle == handle); + dispmanx_client.update_callback(handle, dispmanx_client.update_callback_param); + } + } else {
package/rpi-userland/rpi-userland.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -RPI_USERLAND_VERSION = ffcc4bd7c4875b71376c4240116e251652c9bec0 +RPI_USERLAND_VERSION = 4333d6d023a1f0dcc763d0706a1fe6523f9b6005 RPI_USERLAND_SITE = $(call github,raspberrypi,userland,$(RPI_USERLAND_VERSION)) RPI_USERLAND_LICENSE = BSD-3c RPI_USERLAND_LICENSE_FILES = LICENCE
Signature · 1 line
1.8.4.5
PATCH v3 1/1 rpi-userland: bump revision for musl compile fixes
Maarten, All,
On 2014-10-17 17:57 +0200, Maarten ter Huurne spake thusly:
Quoted 5 lines
Signed-off-by Maarten ter Huurne <[email protected]>---
The second version of this patch was missing the "v2" label; this is the third version.
Quoted 7 lines
The changes from v2, plus an additional change I made later were merged upstream. This patch bumps the git revision to the merge commit.
rpi-userland-002-remove-faulty-assert.patch had to be updated to match other changes in the code that are pulled in by the version bump. I checked that the updated patch compiles fine, but I have no idea whether it is still needed to fix or work around a runtime problem.
I have a way to test it, so I'll report whether it is still needed. Basically, running weston was segfaulting always, at the very start. So I'll try to reproduce; if it still segfaults without the patch, we'll keep it, otherwise we'll drop it.
From what I read in the new code, it seems the assert makes much more sense now than it did before...
I'll mark http://patchwork.ozlabs.org/patch/388745/ as superseded.
Thanks for the detailed explanations, that helped me catch it! :-) I'll report back later tonight, so I hold my ack until then.
Regards,
Yann E. MORIN.
Quoted 58 lines
.../rpi-userland-002-remove-faulty-assert.patch | 25 ++++++++++++---------- package/rpi-userland/rpi-userland.mk | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-)package/rpi-userland/rpi-userland-002-remove-faulty-assert.patch +14
-11@@ -3,19 +3,22 @@ interface: remove faulty assert() to make weston happy at runtime This was removed after a discussion on IRC with the weston guys ('daniels' on irc.freenode.net/#wayland). +Rebased on 4333d6d by Maarten ter Huurne <[email protected]>. + Signed-off-by: "Yann E. MORIN" <[email protected]> --- Upstream status: no, will be pushed by weston guys later. If not, I'll do it. -diff -durN rpi-userland-77d32cd.orig/interface/vmcs_host/vc_vchi_dispmanx.c rpi-userland-77d32cd/interface/vmcs_host/vc_vchi_dispmanx.c ---- rpi-userland-77d32cd.orig/interface/vmcs_host/vc_vchi_dispmanx.c 2013-10-04 17:43:44.000000000 +0200 -+++ rpi-userland-77d32cd/interface/vmcs_host/vc_vchi_dispmanx.c 2013-10-08 22:28:51.611433539 +0200 -@@ -1187,7 +1187,6 @@ - continue; - - if(dispmanx_client.update_callback ) { -- vcos_assert( dispmanx_client.pending_update_handle == (DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1]); - dispmanx_client.update_callback((DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1], dispmanx_client.update_callback_param); - } - } +diff --git a/interface/vmcs_host/vc_vchi_dispmanx.c b/interface/vmcs_host/vc_vchi_dispmanx.c +index 85b373c..59a01f8 100755 +--- a/interface/vmcs_host/vc_vchi_dispmanx.c ++++ b/interface/vmcs_host/vc_vchi_dispmanx.c +@@ -1296,7 +1296,6 @@ static void *dispmanx_notify_func( void *arg ) { + // Decrement the use count - the corresponding "use" is in vc_dispmanx_update_submit. + vchi_service_release(dispmanx_client.notify_handle[0]); + if (dispmanx_client.update_callback ) { +- vcos_assert( dispmanx_client.pending_update_handle == handle); + dispmanx_client.update_callback(handle, dispmanx_client.update_callback_param); + } + } else {package/rpi-userland/rpi-userland.mk +1
-1@@ -4,7 +4,7 @@ # ################################################################################ -RPI_USERLAND_VERSION = ffcc4bd7c4875b71376c4240116e251652c9bec0 +RPI_USERLAND_VERSION = 4333d6d023a1f0dcc763d0706a1fe6523f9b6005 RPI_USERLAND_SITE = $(call github,raspberrypi,userland,$(RPI_USERLAND_VERSION)) RPI_USERLAND_LICENSE = BSD-3c RPI_USERLAND_LICENSE_FILES = LICENCESignature · 1 line
1.8.4.5
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 1/1 rpi-userland: bump revision for musl compile fixes
In reply to Maarten ter HuurneMarten, All,
On 2014-10-17 17:57 +0200, Maarten ter Huurne spake thusly:
Quoted 5 lines
Signed-off-by Maarten ter Huurne <[email protected]>---
The second version of this patch was missing the "v2" label; this is the third version.
Quoted 7 lines
The changes from v2, plus an additional change I made later were merged upstream. This patch bumps the git revision to the merge commit.
rpi-userland-002-remove-faulty-assert.patch had to be updated to match other changes in the code that are pulled in by the version bump. I checked that the updated patch compiles fine, but I have no idea whether it is still needed to fix or work around a runtime problem.
So, I have tested this bump: weston on the rpi no longer works, with or without the asser patch.
So, I NAK this bump for now.
I'll see to bisect rpi-userland to see where it breaks.
Regards,
Yann E. MORIN.
Quoted 58 lines
.../rpi-userland-002-remove-faulty-assert.patch | 25 ++++++++++++---------- package/rpi-userland/rpi-userland.mk | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-)package/rpi-userland/rpi-userland-002-remove-faulty-assert.patch +14
-11@@ -3,19 +3,22 @@ interface: remove faulty assert() to make weston happy at runtime This was removed after a discussion on IRC with the weston guys ('daniels' on irc.freenode.net/#wayland). +Rebased on 4333d6d by Maarten ter Huurne <[email protected]>. + Signed-off-by: "Yann E. MORIN" <[email protected]> --- Upstream status: no, will be pushed by weston guys later. If not, I'll do it. -diff -durN rpi-userland-77d32cd.orig/interface/vmcs_host/vc_vchi_dispmanx.c rpi-userland-77d32cd/interface/vmcs_host/vc_vchi_dispmanx.c ---- rpi-userland-77d32cd.orig/interface/vmcs_host/vc_vchi_dispmanx.c 2013-10-04 17:43:44.000000000 +0200 -+++ rpi-userland-77d32cd/interface/vmcs_host/vc_vchi_dispmanx.c 2013-10-08 22:28:51.611433539 +0200 -@@ -1187,7 +1187,6 @@ - continue; - - if(dispmanx_client.update_callback ) { -- vcos_assert( dispmanx_client.pending_update_handle == (DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1]); - dispmanx_client.update_callback((DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1], dispmanx_client.update_callback_param); - } - } +diff --git a/interface/vmcs_host/vc_vchi_dispmanx.c b/interface/vmcs_host/vc_vchi_dispmanx.c +index 85b373c..59a01f8 100755 +--- a/interface/vmcs_host/vc_vchi_dispmanx.c ++++ b/interface/vmcs_host/vc_vchi_dispmanx.c +@@ -1296,7 +1296,6 @@ static void *dispmanx_notify_func( void *arg ) { + // Decrement the use count - the corresponding "use" is in vc_dispmanx_update_submit. + vchi_service_release(dispmanx_client.notify_handle[0]); + if (dispmanx_client.update_callback ) { +- vcos_assert( dispmanx_client.pending_update_handle == handle); + dispmanx_client.update_callback(handle, dispmanx_client.update_callback_param); + } + } else {package/rpi-userland/rpi-userland.mk +1
-1@@ -4,7 +4,7 @@ # ################################################################################ -RPI_USERLAND_VERSION = ffcc4bd7c4875b71376c4240116e251652c9bec0 +RPI_USERLAND_VERSION = 4333d6d023a1f0dcc763d0706a1fe6523f9b6005 RPI_USERLAND_SITE = $(call github,raspberrypi,userland,$(RPI_USERLAND_VERSION)) RPI_USERLAND_LICENSE = BSD-3c RPI_USERLAND_LICENSE_FILES = LICENCESignature · 1 line
1.8.4.5
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 1/1 rpi-userland: bump revision for musl compile fixes
Maarten, All,
On 2014-10-18 13:05 +0200, Yann E. MORIN spake thusly:
Quoted 14 lines
On 2014-10-17 17:57 +0200, Maarten ter Huurne spake thusly:
Quoted 5 lines
Signed-off-by Maarten ter Huurne <[email protected]>---
The second version of this patch was missing the "v2" label; this is the third version.Quoted 7 lines
The changes from v2, plus an additional change I made later were merged upstream. This patch bumps the git revision to the merge commit.
rpi-userland-002-remove-faulty-assert.patch had to be updated to match other changes in the code that are pulled in by the version bump. I checked that the updated patch compiles fine, but I have no idea whether it is still needed to fix or work around a runtime problem.
Quoted 6 lines
So, I have tested this bump: weston on the rpi no longer works, with or without the asser patch.
So, I NAK this bump for now.
I'll see to bisect rpi-userland to see where it breaks.
The culprit is:
66338d3 vc_dispmanx: Fix vsync service use counting
Unfortunately, weston has yet no fix for that, and I could not spot any fix for rpi-userland either... :-/
So, still NAK for this bump. We can still bump it up to ba753c1 as this still works, but is not enough to get the musl fixes.
Maybe we could just hide it for musl for now?
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 1/1 rpi-userland: bump revision for musl compile fixes
Quoted 23 lines · On Saturday 18 October 2014 13:34:46 Yann E. MORIN wrote:
Maarten, All,
On 2014-10-18 13:05 +0200, Yann E. MORIN spake thusly:
Quoted 20 lines
On 2014-10-17 17:57 +0200, Maarten ter Huurne spake thusly:
Quoted 5 lines
Signed-off-by Maarten ter Huurne <[email protected]>---
The second version of this patch was missing the "v2" label; this is the third version.Quoted 8 lines
The changes from v2, plus an additional change I made later were merged
upstream. This patch bumps the git revision to the merge commit.rpi-userland-002-remove-faulty-assert.patch had to be updated to match other changes in the code that are pulled in by the version bump. I checked that the updated patch compiles fine, but I have no idea whether it is still needed to fix or work around a runtime problem.
So, I have tested this bump: weston on the rpi no longer works, with or without the asser patch.
So, I NAK this bump for now.
Quoted 7 lines
Quoted 1 line
I'll see to bisect rpi-userland to see where it breaks.
The culprit is:
66338d3vc_dispmanx: Fix vsync service use countingUnfortunately, weston has yet no fix for that, and I could not spot any fix for rpi-userland either... :-/
That commit is less than a week old; rpi-userland might not be aware of the problem. Will you or the Weston devs file a bug for it or alert the author?
By the way, 66338d3 is the commit that gives a NULL handle a special meaning. If the assert no longer triggers, perhaps the assert used to trigger on the handle being NULL by accident?
Quoted 4 lines
So, still NAK for this bump. We can still bump it up to ba753c1 as this still works, but is not enough to get the musl fixes.
Maybe we could just hide it for musl for now?
I think it would be a pity to hide it when we have a fix for the musl compile problem.
The only differences between the the proposed bump (4333d6d) and the last working version (ba753c1) are the commit that breaks Weston (66338d3) and the musl compile fixes. So I could create a v4 patch which bumps the version to 4333d6d and contains a patch to revert 66338d3.
Alternatively, I could create a v4 patch which bumps the version to ba753c1 and adds the musl compile fixes as separate patches. While the number of patches would be greater (5 vs 1), the number of changed lines would be smaller, since most of the compile fixes change one line each.
Or I could create a v4 patch which bumps the version to ba753c1 and adds the musl compile fixes as a single patch. Since we know they have been accepted upstream in the same merge commit (4333d6d), we can drop all of them at the same time once we can safely bump beyond that merge commit.
At the moment I prefer bumping to ba753c1 + squashed musl compile fixes, but I'd like a second opinion.
Bye,
Maarten
PATCH v3 1/1 rpi-userland: bump revision for musl compile fixes
Maarten, All,
On 2014-10-18 14:15 +0200, Maarten ter Huurne spake thusly:
Quoted 26 lines · On Saturday 18 October 2014 13:34:46 Yann E. MORIN wrote:
Quoted 25 lines
Maarten, All,
On 2014-10-18 13:05 +0200, Yann E. MORIN spake thusly:
Quoted 21 lines
On 2014-10-17 17:57 +0200, Maarten ter Huurne spake thusly:
Quoted 5 lines
Signed-off-by Maarten ter Huurne <[email protected]>---
The second version of this patch was missing the "v2" label; this is the third version.Quoted 8 lines
The changes from v2, plus an additional change I made later were merged
upstream. This patch bumps the git revision to the merge commit.rpi-userland-002-remove-faulty-assert.patch had to be updated to match other changes in the code that are pulled in by the version bump. I checked that the updated patch compiles fine, but I have no idea whether it is still needed to fix or work around a runtime problem.
So, I have tested this bump: weston on the rpi no longer works, with or without the asser patch.
So, I NAK this bump for now.
I'll see to bisect rpi-userland to see where it breaks.
Quoted 8 lines
Quoted 5 lines
The culprit is:
66338d3vc_dispmanx: Fix vsync service use countingUnfortunately, weston has yet no fix for that, and I could not spot any fix for rpi-userland either... :-/
That commit is less than a week old; rpi-userland might not be aware of the problem. Will you or the Weston devs file a bug for it or alert the author?
I've asked on #wayland to see if they are aware of the issue. I'll probably fill a bug in either project depending on how the wayland guys reply.
Quoted 3 lines
By the way, 66338d3 is the commit that gives a NULL handle a special meaning. If the assert no longer triggers, perhaps the assert used to trigger on the handle being NULL by accident?
Yes, the assert fired because of a NULL pointer dereference (IIRC).
Quoted 18 lines
Quoted 4 lines
So, still NAK for this bump. We can still bump it up to ba753c1 as this still works, but is not enough to get the musl fixes.
Maybe we could just hide it for musl for now?
I think it would be a pity to hide it when we have a fix for the musl compile problem.
The only differences between the the proposed bump (4333d6d) and the last working version (ba753c1) are the commit that breaks Weston (66338d3) and the musl compile fixes. So I could create a v4 patch which bumps the version to 4333d6d and contains a patch to revert 66338d3.
Alternatively, I could create a v4 patch which bumps the version to ba753c1 and adds the musl compile fixes as separate patches. While the number of patches would be greater (5 vs 1), the number of changed lines would be smaller, since most of the compile fixes change one line each.
Quoted 7 lines
Or I could create a v4 patch which bumps the version to ba753c1 and adds the musl compile fixes as a single patch. Since we know they have been accepted upstream in the same merge commit (4333d6d), we can drop all of them at the same time once we can safely bump beyond that merge commit.
At the moment I prefer bumping to ba753c1 + squashed musl compile fixes, but I'd like a second opinion.
Well, I do not want to have weston break. weston is, as far as I can see, the only package in Buildroot that can make use of rpi-userland. Breaking it is out of the equation.
If the backport on-top of ba753c1 is easy, then that's OK for me. The patches are upstream, so it's OK to bundle them until either rpi-userland or/and weston upstream fix the issue.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 1/1 rpi-userland: bump revision for musl compile fixes
Quoted 32 lines · On Saturday 18 October 2014 15:02:48 Yann E. MORIN wrote:
Maarten, All,
On 2014-10-18 14:15 +0200, Maarten ter Huurne spake thusly:
Quoted 29 lines · On Saturday 18 October 2014 13:34:46 Yann E. MORIN wrote:
Quoted 5 lines
So, still NAK for this bump. We can still bump it up to ba753c1 as this
still works, but is not enough to get the musl fixes.Maybe we could just hide it for musl for now?
I think it would be a pity to hide it when we have a fix for the musl compile problem.
The only differences between the the proposed bump (4333d6d) and the last
working version (ba753c1) are the commit that breaks Weston (66338d3) and
the musl compile fixes. So I could create a v4 patch which bumps the version to 4333d6d and contains a patch to revert 66338d3.Alternatively, I could create a v4 patch which bumps the version to ba753c1 and adds the musl compile fixes as separate patches. While the number of patches would be greater (5 vs 1), the number of changed lines would be smaller, since most of the compile fixes change one line each.
Or I could create a v4 patch which bumps the version to ba753c1 and adds the musl compile fixes as a single patch. Since we know they have been accepted upstream in the same merge commit (4333d6d), we can drop all of them at the same time once we can safely bump beyond that merge commit.
Quoted 6 lines
Quoted 2 lines
At the moment I prefer bumping to ba753c1 + squashed musl compile fixes, but I'd like a second opinion.
Well, I do not want to have weston break. weston is, as far as I can see, the only package in Buildroot that can make use of rpi-userland. Breaking it is out of the equation.
rpi-userland provides GL ES (BR2_PACKAGE_HAS_LIBGLES) among other features, so there are several more packages that depend on it. I needed it as a dependency for SDL2 (not in Buildroot yet).
But I agree that breaking one package to fix another is not progress.
Quoted 3 lines
If the backport on-top of ba753c1 is easy, then that's OK for me. The patches are upstream, so it's OK to bundle them until either rpi-userland or/and weston upstream fix the issue.
I have a git clone of rpi-userland set up already to be able to submit the patches upstream, so creating a combined patch is not much work. I'll do that.
Bye,
Maarten
PATCH v3 1/1 rpi-userland: bump revision for musl compile fixes
Maarten, All,
On 2014-10-18 18:46 +0200, Maarten ter Huurne spake thusly:
Quoted 7 lines · On Saturday 18 October 2014 15:02:48 Yann E. MORIN wrote:
Quoted 3 lines
Well, I do not want to have weston break. weston is, as far as I can see, the only package in Buildroot that can make use of rpi-userland. Breaking it is out of the equation.
rpi-userland provides GL ES (
BR2_PACKAGE_HAS_LIBGLES) among other features, so there are several more packages that depend on it.
Right, I forgot about that...
[--SNIP--[
Quoted 3 lines
I have a git clone of rpi-userland set up already to be able to submit the patches upstream, so creating a combined patch is not much work. I'll do that.
So, I take it you have a fix for this issue?
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 1/1 rpi-userland: bump revision for musl compile fixes
Quoted 6 lines · On Saturday 18 October 2014 19:16:05 Yann E. MORIN wrote:
On 2014-10-18 18:46 +0200, Maarten ter Huurne spake thusly:
Quoted 3 lines
I have a git clone of rpi-userland set up already to be able to submit the patches upstream, so creating a combined patch is not much work. I'll do that.
So, I take it you have a fix for this issue?
I have a fix for the musl compile problems, not for the Weston problem.
Bye,
Maarten
PATCH v4 1/1 rpi-userland: bump revision and add patch to fix compile with musl
In reply to Maarten ter Huurne--- .../rpi-userland-003-fix-musl-compile.patch | 113 +++++++++++++++++++++ package/rpi-userland/rpi-userland.mk | 2 +- 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 package/rpi-userland/rpi-userland-003-fix-musl-compile.patch
package/rpi-userland/rpi-userland-003-fix-musl-compile.patch new file +113 -0
@@ -0,0 +1,113 @@ +From 198d93fab0659f7a548329d742de8b3e27cfd977 Mon Sep 17 00:00:00 2001 +From: Maarten ter Huurne <[email protected]> +Date: Fri, 12 Sep 2014 18:28:51 +0200 +Subject: [PATCH] Combined musl compile fixes + +The individual patches and their descriptions can be found here: +https://github.com/raspberrypi/userland/pull/201 + +Upstream status: accepted (4333d6d) +However, bumping to that revision is currently not an option since that +also pulls in 66338d3 which breaks Weston: +http://lists.busybox.net/pipermail/buildroot/2014-October/109309.html + +Signed-off-by: Maarten ter Huurne <[email protected]> +--- + containers/CMakeLists.txt | 2 +- + host_applications/linux/apps/hello_pi/CMakeLists.txt | 2 +- + host_applications/linux/apps/hello_pi/libs/vgfont/Makefile | 1 - + interface/vcos/pthreads/vcos_platform.h | 3 --- + interface/vcos/pthreads/vcos_pthreads.c | 2 +- + interface/vmcs_host/linux/vcfilesys.c | 4 ++-- + 6 files changed, 5 insertions(+), 9 deletions(-) + +diff --git a/containers/CMakeLists.txt b/containers/CMakeLists.txt +index 721f74f..a29a885 100644 +--- a/containers/CMakeLists.txt ++++ b/containers/CMakeLists.txt +@@ -13,7 +13,7 @@ add_definitions(-DDL_PATH_PREFIX="${VMCS_PLUGIN_DIR}/") + + SET( GCC_COMPILER_FLAGS -Wall -g -O2 -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wcast-qual -Wwrite-strings -Wundef ) + SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wextra )#-Wno-missing-field-initializers ) +-SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -D__STDC_VERSION__=199901L ) ++SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -std=c99 -D_POSIX_C_SOURCE=199309L ) + SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wno-missing-field-initializers ) + SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wno-unused-value ) + +diff --git a/host_applications/linux/apps/hello_pi/CMakeLists.txt b/host_applications/linux/apps/hello_pi/CMakeLists.txt +index ab4dae3..f2c6aef 100644 +--- a/host_applications/linux/apps/hello_pi/CMakeLists.txt ++++ b/host_applications/linux/apps/hello_pi/CMakeLists.txt +@@ -24,7 +24,7 @@ add_subdirectory(hello_teapot) + + if(BUILD_FONT) + set(VGFONT_SRCS libs/vgfont/font.c libs/vgfont/vgft.c libs/vgfont/graphics.c) +-set_source_files_properties(${VGFONT_SRCS} PROPERTIES COMPILE_DEFINITIONS "_HAVE_TIMER_T") ++set_source_files_properties(${VGFONT_SRCS} PROPERTIES COMPILE_DEFINITIONS) + add_library(vgfont ${VGFONT_SRCS}) + + add_subdirectory(hello_font) +diff --git a/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile b/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile +index d04fb08..1e2a22b 100755 +--- a/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile ++++ b/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile +@@ -2,7 +2,6 @@ OBJS=font.o vgft.o graphics.o + LIB=libvgfont.a + + INCLUDES+=-I$(SDKSTAGE)/usr/include/freetype2 -I$(SDKSTAGE)/usr/include -I$(SDKSTAGE)/usr/include/arm-linux-gnueabi +-CFLAGS+=-D_HAVE_TIMER_T + + include ../../Makefile.include + +diff --git a/interface/vcos/pthreads/vcos_platform.h b/interface/vcos/pthreads/vcos_platform.h +index 468098b..2095e25 100755 +--- a/interface/vcos/pthreads/vcos_platform.h ++++ b/interface/vcos/pthreads/vcos_platform.h +@@ -120,9 +120,6 @@ typedef struct + + #define VCOS_ONCE_INIT PTHREAD_ONCE_INIT + +-#if defined(__arm__) && !defined(_HAVE_TIMER_T) && !defined(ANDROID) +-typedef __timer_t timer_t; +-#endif + typedef struct VCOS_TIMER_T + { + pthread_t thread; /**< id of the timer thread */ +diff --git a/interface/vcos/pthreads/vcos_pthreads.c b/interface/vcos/pthreads/vcos_pthreads.c +index 668f647..fdc8bc4 100644 +--- a/interface/vcos/pthreads/vcos_pthreads.c ++++ b/interface/vcos/pthreads/vcos_pthreads.c +@@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include <stdlib.h> + #include <stdio.h> + #include <sys/time.h> +-#include <sys/param.h> ++#include <linux/param.h> + + /* Cygwin doesn't always have prctl.h and it doesn't have PR_SET_NAME */ + #if defined( __linux__ ) +diff --git a/interface/vmcs_host/linux/vcfilesys.c b/interface/vmcs_host/linux/vcfilesys.c +index ab65e3e..53c7486 100644 +--- a/interface/vmcs_host/linux/vcfilesys.c ++++ b/interface/vmcs_host/linux/vcfilesys.c +@@ -49,7 +49,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include <ctype.h> + #include <limits.h> + +-#if !defined(ANDROID) && !defined( __USE_FILE_OFFSET64 ) ++#if defined(__GLIBC__) && !defined( __USE_FILE_OFFSET64 ) + #error "__USE_FILE_OFFSET64 isn't defined" + #endif + +@@ -916,7 +916,7 @@ int vc_hostfs_set_attr(const char *path, fattributes_t attr) + + if (pathbuf) + { +- __mode_t mode = 0; ++ mode_t mode = 0; + struct stat sb; + + backslash_to_slash(pathbuf); +-- +1.8.4.5 +
package/rpi-userland/rpi-userland.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -RPI_USERLAND_VERSION = ffcc4bd7c4875b71376c4240116e251652c9bec0 +RPI_USERLAND_VERSION = ba753c1a7f68d7a2e00edaf03364eef001e233ef RPI_USERLAND_SITE = $(call github,raspberrypi,userland,$(RPI_USERLAND_VERSION)) RPI_USERLAND_LICENSE = BSD-3c RPI_USERLAND_LICENSE_FILES = LICENCE
Signature · 1 line
1.8.4.5
PATCH v4 1/1 rpi-userland: bump revision and add patch to fix compile with musl
Maarten, All,
On 2014-10-18 19:58 +0200, Maarten ter Huurne spake thusly:
Quoted 1 line
Signed-off-by Maarten ter Huurne <[email protected]>
I would have liked that the explanation from the patch be repeated in the commit log, something like:
We can not bump to the latest cset, because it breaks weston. So we add a patch to backport upstream fixes for musl:
http://lists.busybox.net/pipermail/buildroot/2014-October/109309.html
https://github.com/raspberrypi/userland/pull/201
Otherwise:
Regards,
Yann E. MORIN.
Quoted 141 lines
--- .../rpi-userland-003-fix-musl-compile.patch | 113 +++++++++++++++++++++ package/rpi-userland/rpi-userland.mk | 2 +- 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 package/rpi-userland/rpi-userland-003-fix-musl-compile.patchpackage/rpi-userland/rpi-userland-003-fix-musl-compile.patch new file +113
-0@@ -0,0 +1,113 @@ +From 198d93fab0659f7a548329d742de8b3e27cfd977 Mon Sep 17 00:00:00 2001 +From: Maarten ter Huurne <[email protected]> +Date: Fri, 12 Sep 2014 18:28:51 +0200 +Subject: [PATCH] Combined musl compile fixes + +The individual patches and their descriptions can be found here: +https://github.com/raspberrypi/userland/pull/201 + +Upstream status: accepted (4333d6d) +However, bumping to that revision is currently not an option since that +also pulls in 66338d3 which breaks Weston: +http://lists.busybox.net/pipermail/buildroot/2014-October/109309.html + +Signed-off-by: Maarten ter Huurne <[email protected]> +--- + containers/CMakeLists.txt | 2 +- + host_applications/linux/apps/hello_pi/CMakeLists.txt | 2 +- + host_applications/linux/apps/hello_pi/libs/vgfont/Makefile | 1 - + interface/vcos/pthreads/vcos_platform.h | 3 --- + interface/vcos/pthreads/vcos_pthreads.c | 2 +- + interface/vmcs_host/linux/vcfilesys.c | 4 ++-- + 6 files changed, 5 insertions(+), 9 deletions(-) + +diff --git a/containers/CMakeLists.txt b/containers/CMakeLists.txt +index 721f74f..a29a885 100644 +--- a/containers/CMakeLists.txt ++++ b/containers/CMakeLists.txt +@@ -13,7 +13,7 @@ add_definitions(-DDL_PATH_PREFIX="${VMCS_PLUGIN_DIR}/") + + SET( GCC_COMPILER_FLAGS -Wall -g -O2 -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wcast-qual -Wwrite-strings -Wundef ) + SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wextra )#-Wno-missing-field-initializers ) +-SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -D__STDC_VERSION__=199901L ) ++SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -std=c99 -D_POSIX_C_SOURCE=199309L ) + SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wno-missing-field-initializers ) + SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wno-unused-value ) + +diff --git a/host_applications/linux/apps/hello_pi/CMakeLists.txt b/host_applications/linux/apps/hello_pi/CMakeLists.txt +index ab4dae3..f2c6aef 100644 +--- a/host_applications/linux/apps/hello_pi/CMakeLists.txt ++++ b/host_applications/linux/apps/hello_pi/CMakeLists.txt +@@ -24,7 +24,7 @@ add_subdirectory(hello_teapot) + + if(BUILD_FONT) + set(VGFONT_SRCS libs/vgfont/font.c libs/vgfont/vgft.c libs/vgfont/graphics.c) +-set_source_files_properties(${VGFONT_SRCS} PROPERTIES COMPILE_DEFINITIONS "_HAVE_TIMER_T") ++set_source_files_properties(${VGFONT_SRCS} PROPERTIES COMPILE_DEFINITIONS) + add_library(vgfont ${VGFONT_SRCS}) + + add_subdirectory(hello_font) +diff --git a/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile b/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile +index d04fb08..1e2a22b 100755 +--- a/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile ++++ b/host_applications/linux/apps/hello_pi/libs/vgfont/Makefile +@@ -2,7 +2,6 @@ OBJS=font.o vgft.o graphics.o + LIB=libvgfont.a + + INCLUDES+=-I$(SDKSTAGE)/usr/include/freetype2 -I$(SDKSTAGE)/usr/include -I$(SDKSTAGE)/usr/include/arm-linux-gnueabi +-CFLAGS+=-D_HAVE_TIMER_T + + include ../../Makefile.include + +diff --git a/interface/vcos/pthreads/vcos_platform.h b/interface/vcos/pthreads/vcos_platform.h +index 468098b..2095e25 100755 +--- a/interface/vcos/pthreads/vcos_platform.h ++++ b/interface/vcos/pthreads/vcos_platform.h +@@ -120,9 +120,6 @@ typedef struct + + #define VCOS_ONCE_INIT PTHREAD_ONCE_INIT + +-#if defined(__arm__) && !defined(_HAVE_TIMER_T) && !defined(ANDROID) +-typedef __timer_t timer_t; +-#endif + typedef struct VCOS_TIMER_T + { + pthread_t thread; /**< id of the timer thread */ +diff --git a/interface/vcos/pthreads/vcos_pthreads.c b/interface/vcos/pthreads/vcos_pthreads.c +index 668f647..fdc8bc4 100644 +--- a/interface/vcos/pthreads/vcos_pthreads.c ++++ b/interface/vcos/pthreads/vcos_pthreads.c +@@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include <stdlib.h> + #include <stdio.h> + #include <sys/time.h> +-#include <sys/param.h> ++#include <linux/param.h> + + /* Cygwin doesn't always have prctl.h and it doesn't have PR_SET_NAME */ + #if defined( __linux__ ) +diff --git a/interface/vmcs_host/linux/vcfilesys.c b/interface/vmcs_host/linux/vcfilesys.c +index ab65e3e..53c7486 100644 +--- a/interface/vmcs_host/linux/vcfilesys.c ++++ b/interface/vmcs_host/linux/vcfilesys.c +@@ -49,7 +49,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include <ctype.h> + #include <limits.h> + +-#if !defined(ANDROID) && !defined( __USE_FILE_OFFSET64 ) ++#if defined(__GLIBC__) && !defined( __USE_FILE_OFFSET64 ) + #error "__USE_FILE_OFFSET64 isn't defined" + #endif + +@@ -916,7 +916,7 @@ int vc_hostfs_set_attr(const char *path, fattributes_t attr) + + if (pathbuf) + { +- __mode_t mode = 0; ++ mode_t mode = 0; + struct stat sb; + + backslash_to_slash(pathbuf); +-- +1.8.4.5 +package/rpi-userland/rpi-userland.mk +1
-1@@ -4,7 +4,7 @@ # ################################################################################ -RPI_USERLAND_VERSION = ffcc4bd7c4875b71376c4240116e251652c9bec0 +RPI_USERLAND_VERSION = ba753c1a7f68d7a2e00edaf03364eef001e233ef RPI_USERLAND_SITE = $(call github,raspberrypi,userland,$(RPI_USERLAND_VERSION)) RPI_USERLAND_LICENSE = BSD-3c RPI_USERLAND_LICENSE_FILES = LICENCESignature · 1 line
1.8.4.5
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
Thomas Petazzoni
AppliedPATCH v4 1/1 rpi-userland: bump revision and add patch to fix compile with musl
In reply to Maarten ter HuurneDear Maarten ter Huurne,
Quoted 6 lines · Maarten ter Huurne
Signed-off-by Maarten ter Huurne <[email protected]>--- .../rpi-userland-003-fix-musl-compile.patch | 113 +++++++++++++++++++++ package/rpi-userland/rpi-userland.mk | 2 +- 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 package/rpi-userland/rpi-userland-003-fix-musl-compile.patch
Thanks, applied, after adjusting the commit log as suggested by Yann.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com