* [meta-raspberrypi][PATCH] userland: Fix multiple inline issues while building with gcc 5.x
@ 2015-09-27 13:34 Tom Doehring
2015-09-28 15:13 ` Gary Thomas
2015-10-02 21:29 ` Andrei Gherzan
0 siblings, 2 replies; 4+ messages in thread
From: Tom Doehring @ 2015-09-27 13:34 UTC (permalink / raw)
To: yocto
Building userland source with gcc 5.x causes multiple issues such as:
vcos_thread.h:186:15: warning: inline function 'vcos_thread_get_affinity' declared but never defined
| VCOS_UNSIGNED vcos_thread_get_affinity(VCOS_THREAD_T *thread);
The following patches fixes these issues and allows building userland on the current
poky master branch.
Signed-off-by: Tom Doehring <toolmmy@googlemail.com>
---
.../userland/0001-Use-newer-POSIX-macro.patch | 35 ----------------------
.../userland/0001-fix-gcc-5.x-inlines.patch | 26 ++++++++++++++++
.../userland/userland/0002-fix-musl-build.patch | 22 ++++++++++++++
.../0003-fix-alloc-size-uninitialized.patch | 13 ++++++++
recipes-graphics/userland/userland_git.bb | 13 +++++---
5 files changed, 70 insertions(+), 39 deletions(-)
delete mode 100644 recipes-graphics/userland/userland/0001-Use-newer-POSIX-macro.patch
create mode 100644 recipes-graphics/userland/userland/0001-fix-gcc-5.x-inlines.patch
create mode 100644 recipes-graphics/userland/userland/0002-fix-musl-build.patch
create mode 100644 recipes-graphics/userland/userland/0003-fix-alloc-size-uninitialized.patch
diff --git a/recipes-graphics/userland/userland/0001-Use-newer-POSIX-macro.patch b/recipes-graphics/userland/userland/0001-Use-newer-POSIX-macro.patch
deleted file mode 100644
index 2a092c2..0000000
--- a/recipes-graphics/userland/userland/0001-Use-newer-POSIX-macro.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 12f7718bb0e08e2c06825c7ab7541b3c5bfe74c1 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 9 Aug 2015 08:55:05 -0700
-Subject: [PATCH] Use newer POSIX macro
-
-Define _POSIX_C_SOURCE such that it demands correct
-posix interfaces, netdb.h declares interfaces such as
-getaddrinfo if __USE_POSIX, i.e. POSIX.1:1990 or later.
-However, these interfaces were new in the 2001 edition of POSIX
-therefore ask for Extension from POSIX.1:2001 since we use addrinfo
-structure here.
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Submitted
-
- containers/CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/containers/CMakeLists.txt b/containers/CMakeLists.txt
-index a29a885..5570038 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} -std=c99 -D_POSIX_C_SOURCE=199309L )
-+SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -std=c99 -D_POSIX_C_SOURCE=200112L )
- SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wno-missing-field-initializers )
- SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wno-unused-value )
-
---
-2.1.4
-
diff --git a/recipes-graphics/userland/userland/0001-fix-gcc-5.x-inlines.patch b/recipes-graphics/userland/userland/0001-fix-gcc-5.x-inlines.patch
new file mode 100644
index 0000000..57f3518
--- /dev/null
+++ b/recipes-graphics/userland/userland/0001-fix-gcc-5.x-inlines.patch
@@ -0,0 +1,26 @@
+--- userland-fb11b39d97371c076eef7c85bbcab5733883a41e.orig/interface/vcos/vcos_types.h
++++ userland-fb11b39d97371c076eef7c85bbcab5733883a41e/interface/vcos/vcos_types.h
+@@ -121,10 +121,10 @@
+ #if defined(NDEBUG)
+
+ #ifdef __GNUC__
+-# define VCOS_INLINE_DECL extern __inline__
++# define VCOS_INLINE_DECL extern
+ # define VCOS_INLINE_IMPL static __inline__
+ #else
+-# define VCOS_INLINE_DECL static _VCOS_INLINE /* declare a func */
++# define VCOS_INLINE_DECL extern
+ # define VCOS_INLINE_IMPL static _VCOS_INLINE /* implement a func inline */
+ #endif
+
+--- userland-fb11b39d97371c076eef7c85bbcab5733883a41e.orig/interface/vcos/pthreads/vcos_platform_types.h
++++ userland-fb11b39d97371c076eef7c85bbcab5733883a41e/interface/vcos/pthreads/vcos_platform_types.h
+@@ -61,7 +61,7 @@
+ #define VCOS_ASSERT_MSG(...) ((VCOS_ASSERT_LOGGING && !VCOS_ASSERT_LOGGING_DISABLE) ? vcos_pthreads_logging_assert(__FILE__, __func__, __LINE__, __VA_ARGS__) : (void)0)
+
+ #define VCOS_INLINE_BODIES
+-#define VCOS_INLINE_DECL extern __inline__
++#define VCOS_INLINE_DECL extern
+ #define VCOS_INLINE_IMPL static __inline__
+
+ #ifdef __cplusplus
diff --git a/recipes-graphics/userland/userland/0002-fix-musl-build.patch b/recipes-graphics/userland/userland/0002-fix-musl-build.patch
new file mode 100644
index 0000000..2fb11e7
--- /dev/null
+++ b/recipes-graphics/userland/userland/0002-fix-musl-build.patch
@@ -0,0 +1,22 @@
+--- userland-d4aa617de3b196399bb8e2ce32e181768cb52179.orig/host_applications/linux/apps/raspicam/RaspiVidYUV.c
++++ userland-d4aa617de3b196399bb8e2ce32e181768cb52179/host_applications/linux/apps/raspicam/RaspiVidYUV.c
+@@ -106,8 +106,6 @@
+ /// Run/record forever
+ #define WAIT_METHOD_FOREVER 4
+
+-extern FILE *stderr, *stdout;
+-
+ int mmal_status_to_int(MMAL_STATUS_T status);
+ static void signal_handler(int signal_number);
+
+--- userland-d4aa617de3b196399bb8e2ce32e181768cb52179.orig/host_applications/linux/libs/debug_sym/debug_sym.c
++++ userland-d4aa617de3b196399bb8e2ce32e181768cb52179/host_applications/linux/libs/debug_sym/debug_sym.c
+@@ -67,6 +67,8 @@
+ # else
+ # define PAGE_SIZE 4096
+ # endif
++#endif
++#ifndef PAGE_MASK
+ #define PAGE_MASK (~(PAGE_SIZE - 1))
+ #endif
+
diff --git a/recipes-graphics/userland/userland/0003-fix-alloc-size-uninitialized.patch b/recipes-graphics/userland/userland/0003-fix-alloc-size-uninitialized.patch
new file mode 100644
index 0000000..7dd6436
--- /dev/null
+++ b/recipes-graphics/userland/userland/0003-fix-alloc-size-uninitialized.patch
@@ -0,0 +1,13 @@
+diff --git a/host_applications/linux/apps/smem/smem.c b/host_applications/linux/apps/smem/smem.c
+index f780b79..618580e 100644
+--- a/host_applications/linux/apps/smem/smem.c
++++ b/host_applications/linux/apps/smem/smem.c
+@@ -192,7 +192,7 @@ int main( int argc, char **argv )
+ int opt;
+ int opt_alloc = 0;
+ int opt_status = 0;
+- uint32_t alloc_size;
++ uint32_t alloc_size = 0;
+ int opt_pid = -1;
+ VCSM_STATUS_T status_mode = VCSM_STATUS_NONE;
+
diff --git a/recipes-graphics/userland/userland_git.bb b/recipes-graphics/userland/userland_git.bb
index 2b3286a..e431077 100644
--- a/recipes-graphics/userland/userland_git.bb
+++ b/recipes-graphics/userland/userland_git.bb
@@ -9,15 +9,20 @@ PR = "r5"
PROVIDES = "virtual/libgles2 \
virtual/egl"
+
COMPATIBLE_MACHINE = "raspberrypi"
SRCBRANCH = "master"
SRCFORK = "raspberrypi"
-SRCREV = "c2f27fb8e581f8e5af83bf28422553ade8f7a7c8"
+SRCREV = "cc92dfd6c4e8e2d90c3903dccfe77f7274b8d1b7"
+
+SRC_URI = "\
+ git://github.com/${SRCFORK}/userland.git;protocol=git;branch=${SRCBRANCH} \
+ file://0001-fix-gcc-5.x-inlines.patch \
+ file://0002-fix-musl-build.patch \
+ file://0003-fix-alloc-size-uninitialized.patch \
+ "
-SRC_URI = "git://github.com/${SRCFORK}/userland.git;protocol=git;branch=${SRCBRANCH} \
- file://0001-Use-newer-POSIX-macro.patch \
- "
S = "${WORKDIR}/git"
inherit cmake
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [meta-raspberrypi][PATCH] userland: Fix multiple inline issues while building with gcc 5.x
2015-09-27 13:34 [meta-raspberrypi][PATCH] userland: Fix multiple inline issues while building with gcc 5.x Tom Doehring
@ 2015-09-28 15:13 ` Gary Thomas
2015-09-28 16:04 ` Khem Raj
2015-10-02 21:29 ` Andrei Gherzan
1 sibling, 1 reply; 4+ messages in thread
From: Gary Thomas @ 2015-09-28 15:13 UTC (permalink / raw)
To: yocto
On 2015-09-27 07:34, Tom Doehring wrote:
> Building userland source with gcc 5.x causes multiple issues such as:
>
> vcos_thread.h:186:15: warning: inline function 'vcos_thread_get_affinity' declared but never defined
> | VCOS_UNSIGNED vcos_thread_get_affinity(VCOS_THREAD_T *thread);
>
> The following patches fixes these issues and allows building userland on the current
> poky master branch.
Are these patches compatible with older GCC, or does having them
require using GCC-5?
>
> Signed-off-by: Tom Doehring <toolmmy@googlemail.com>
> ---
> .../userland/0001-Use-newer-POSIX-macro.patch | 35 ----------------------
> .../userland/0001-fix-gcc-5.x-inlines.patch | 26 ++++++++++++++++
> .../userland/userland/0002-fix-musl-build.patch | 22 ++++++++++++++
> .../0003-fix-alloc-size-uninitialized.patch | 13 ++++++++
> recipes-graphics/userland/userland_git.bb | 13 +++++---
> 5 files changed, 70 insertions(+), 39 deletions(-)
> delete mode 100644 recipes-graphics/userland/userland/0001-Use-newer-POSIX-macro.patch
> create mode 100644 recipes-graphics/userland/userland/0001-fix-gcc-5.x-inlines.patch
> create mode 100644 recipes-graphics/userland/userland/0002-fix-musl-build.patch
> create mode 100644 recipes-graphics/userland/userland/0003-fix-alloc-size-uninitialized.patch
>
> diff --git a/recipes-graphics/userland/userland/0001-Use-newer-POSIX-macro.patch b/recipes-graphics/userland/userland/0001-Use-newer-POSIX-macro.patch
> deleted file mode 100644
> index 2a092c2..0000000
> --- a/recipes-graphics/userland/userland/0001-Use-newer-POSIX-macro.patch
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -From 12f7718bb0e08e2c06825c7ab7541b3c5bfe74c1 Mon Sep 17 00:00:00 2001
> -From: Khem Raj <raj.khem@gmail.com>
> -Date: Sun, 9 Aug 2015 08:55:05 -0700
> -Subject: [PATCH] Use newer POSIX macro
> -
> -Define _POSIX_C_SOURCE such that it demands correct
> -posix interfaces, netdb.h declares interfaces such as
> -getaddrinfo if __USE_POSIX, i.e. POSIX.1:1990 or later.
> -However, these interfaces were new in the 2001 edition of POSIX
> -therefore ask for Extension from POSIX.1:2001 since we use addrinfo
> -structure here.
> -
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ----
> -Upstream-Status: Submitted
> -
> - containers/CMakeLists.txt | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/containers/CMakeLists.txt b/containers/CMakeLists.txt
> -index a29a885..5570038 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} -std=c99 -D_POSIX_C_SOURCE=199309L )
> -+SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -std=c99 -D_POSIX_C_SOURCE=200112L )
> - SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wno-missing-field-initializers )
> - SET( GCC_COMPILER_FLAGS ${GCC_COMPILER_FLAGS} -Wno-unused-value )
> -
> ---
> -2.1.4
> -
> diff --git a/recipes-graphics/userland/userland/0001-fix-gcc-5.x-inlines.patch b/recipes-graphics/userland/userland/0001-fix-gcc-5.x-inlines.patch
> new file mode 100644
> index 0000000..57f3518
> --- /dev/null
> +++ b/recipes-graphics/userland/userland/0001-fix-gcc-5.x-inlines.patch
> @@ -0,0 +1,26 @@
> +--- userland-fb11b39d97371c076eef7c85bbcab5733883a41e.orig/interface/vcos/vcos_types.h
> ++++ userland-fb11b39d97371c076eef7c85bbcab5733883a41e/interface/vcos/vcos_types.h
> +@@ -121,10 +121,10 @@
> + #if defined(NDEBUG)
> +
> + #ifdef __GNUC__
> +-# define VCOS_INLINE_DECL extern __inline__
> ++# define VCOS_INLINE_DECL extern
> + # define VCOS_INLINE_IMPL static __inline__
> + #else
> +-# define VCOS_INLINE_DECL static _VCOS_INLINE /* declare a func */
> ++# define VCOS_INLINE_DECL extern
> + # define VCOS_INLINE_IMPL static _VCOS_INLINE /* implement a func inline */
> + #endif
> +
> +--- userland-fb11b39d97371c076eef7c85bbcab5733883a41e.orig/interface/vcos/pthreads/vcos_platform_types.h
> ++++ userland-fb11b39d97371c076eef7c85bbcab5733883a41e/interface/vcos/pthreads/vcos_platform_types.h
> +@@ -61,7 +61,7 @@
> + #define VCOS_ASSERT_MSG(...) ((VCOS_ASSERT_LOGGING && !VCOS_ASSERT_LOGGING_DISABLE) ? vcos_pthreads_logging_assert(__FILE__, __func__, __LINE__, __VA_ARGS__) : (void)0)
> +
> + #define VCOS_INLINE_BODIES
> +-#define VCOS_INLINE_DECL extern __inline__
> ++#define VCOS_INLINE_DECL extern
> + #define VCOS_INLINE_IMPL static __inline__
> +
> + #ifdef __cplusplus
> diff --git a/recipes-graphics/userland/userland/0002-fix-musl-build.patch b/recipes-graphics/userland/userland/0002-fix-musl-build.patch
> new file mode 100644
> index 0000000..2fb11e7
> --- /dev/null
> +++ b/recipes-graphics/userland/userland/0002-fix-musl-build.patch
> @@ -0,0 +1,22 @@
> +--- userland-d4aa617de3b196399bb8e2ce32e181768cb52179.orig/host_applications/linux/apps/raspicam/RaspiVidYUV.c
> ++++ userland-d4aa617de3b196399bb8e2ce32e181768cb52179/host_applications/linux/apps/raspicam/RaspiVidYUV.c
> +@@ -106,8 +106,6 @@
> + /// Run/record forever
> + #define WAIT_METHOD_FOREVER 4
> +
> +-extern FILE *stderr, *stdout;
> +-
> + int mmal_status_to_int(MMAL_STATUS_T status);
> + static void signal_handler(int signal_number);
> +
> +--- userland-d4aa617de3b196399bb8e2ce32e181768cb52179.orig/host_applications/linux/libs/debug_sym/debug_sym.c
> ++++ userland-d4aa617de3b196399bb8e2ce32e181768cb52179/host_applications/linux/libs/debug_sym/debug_sym.c
> +@@ -67,6 +67,8 @@
> + # else
> + # define PAGE_SIZE 4096
> + # endif
> ++#endif
> ++#ifndef PAGE_MASK
> + #define PAGE_MASK (~(PAGE_SIZE - 1))
> + #endif
> +
> diff --git a/recipes-graphics/userland/userland/0003-fix-alloc-size-uninitialized.patch b/recipes-graphics/userland/userland/0003-fix-alloc-size-uninitialized.patch
> new file mode 100644
> index 0000000..7dd6436
> --- /dev/null
> +++ b/recipes-graphics/userland/userland/0003-fix-alloc-size-uninitialized.patch
> @@ -0,0 +1,13 @@
> +diff --git a/host_applications/linux/apps/smem/smem.c b/host_applications/linux/apps/smem/smem.c
> +index f780b79..618580e 100644
> +--- a/host_applications/linux/apps/smem/smem.c
> ++++ b/host_applications/linux/apps/smem/smem.c
> +@@ -192,7 +192,7 @@ int main( int argc, char **argv )
> + int opt;
> + int opt_alloc = 0;
> + int opt_status = 0;
> +- uint32_t alloc_size;
> ++ uint32_t alloc_size = 0;
> + int opt_pid = -1;
> + VCSM_STATUS_T status_mode = VCSM_STATUS_NONE;
> +
> diff --git a/recipes-graphics/userland/userland_git.bb b/recipes-graphics/userland/userland_git.bb
> index 2b3286a..e431077 100644
> --- a/recipes-graphics/userland/userland_git.bb
> +++ b/recipes-graphics/userland/userland_git.bb
> @@ -9,15 +9,20 @@ PR = "r5"
>
> PROVIDES = "virtual/libgles2 \
> virtual/egl"
> +
> COMPATIBLE_MACHINE = "raspberrypi"
>
> SRCBRANCH = "master"
> SRCFORK = "raspberrypi"
> -SRCREV = "c2f27fb8e581f8e5af83bf28422553ade8f7a7c8"
> +SRCREV = "cc92dfd6c4e8e2d90c3903dccfe77f7274b8d1b7"
> +
> +SRC_URI = "\
> + git://github.com/${SRCFORK}/userland.git;protocol=git;branch=${SRCBRANCH} \
> + file://0001-fix-gcc-5.x-inlines.patch \
> + file://0002-fix-musl-build.patch \
> + file://0003-fix-alloc-size-uninitialized.patch \
> + "
>
> -SRC_URI = "git://github.com/${SRCFORK}/userland.git;protocol=git;branch=${SRCBRANCH} \
> - file://0001-Use-newer-POSIX-macro.patch \
> - "
> S = "${WORKDIR}/git"
>
> inherit cmake
>
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [meta-raspberrypi][PATCH] userland: Fix multiple inline issues while building with gcc 5.x
2015-09-27 13:34 [meta-raspberrypi][PATCH] userland: Fix multiple inline issues while building with gcc 5.x Tom Doehring
2015-09-28 15:13 ` Gary Thomas
@ 2015-10-02 21:29 ` Andrei Gherzan
1 sibling, 0 replies; 4+ messages in thread
From: Andrei Gherzan @ 2015-10-02 21:29 UTC (permalink / raw)
To: Tom Doehring; +Cc: yocto
On Sun, Sep 27, 2015 at 03:34:14PM +0200, Tom Doehring wrote:
> Building userland source with gcc 5.x causes multiple issues such as:
>
> vcos_thread.h:186:15: warning: inline function 'vcos_thread_get_affinity' declared but never defined
> | VCOS_UNSIGNED vcos_thread_get_affinity(VCOS_THREAD_T *thread);
>
> The following patches fixes these issues and allows building userland on the current
> poky master branch.
>
> Signed-off-by: Tom Doehring <toolmmy@googlemail.com>
> ---
> .../userland/0001-Use-newer-POSIX-macro.patch | 35 ----------------------
> .../userland/0001-fix-gcc-5.x-inlines.patch | 26 ++++++++++++++++
> .../userland/userland/0002-fix-musl-build.patch | 22 ++++++++++++++
> .../0003-fix-alloc-size-uninitialized.patch | 13 ++++++++
> recipes-graphics/userland/userland_git.bb | 13 +++++---
> 5 files changed, 70 insertions(+), 39 deletions(-)
> delete mode 100644 recipes-graphics/userland/userland/0001-Use-newer-POSIX-macro.patch
> create mode 100644 recipes-graphics/userland/userland/0001-fix-gcc-5.x-inlines.patch
> create mode 100644 recipes-graphics/userland/userland/0002-fix-musl-build.patch
> create mode 100644 recipes-graphics/userland/userland/0003-fix-alloc-size-uninitialized.patch
>
Tested on GCC 5.2.0 and worked fine. Merged to master. Thank you.
--
Andrei Gherzan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-02 21:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-27 13:34 [meta-raspberrypi][PATCH] userland: Fix multiple inline issues while building with gcc 5.x Tom Doehring
2015-09-28 15:13 ` Gary Thomas
2015-09-28 16:04 ` Khem Raj
2015-10-02 21:29 ` Andrei Gherzan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.