libsdl2: disable check gcc -Wdeclaration-after-statement for ppc
PATCH 1/1 libsdl2: disable check gcc -Wdeclaration-after-statement for ppc
From: Kai Kang <[email protected]>
Disable check gcc option -Wdeclaration-after-statement for powerpc and powerpc64 which causes compile failures:
| CC build/SDL_blit_N.lo | .../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c: In function 'calc_swizzle32': | .../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c:127:5: error: ISO C90 forbids | mixed declarations and code [-Werror=declaration-after-statement] | const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00, | ^~~~~
--- ...able-check-gcc-Wdeclaration-after-statement.patch | 20 ++++++++++++++++++++ meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc-Wdeclaration-after-statement.patch
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc-Wdeclaration-after-statement.patch new file +20 -0
@@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [disable feature] + +Disable check gcc option -Wdeclaration-after-statement for powerpc and +powerpc64 which causes compile failures. + +Signed-off-by: Kai Kang <[email protected]> +--- +diff --git a/configure.in b/configure.in +index e2ddc9c..73b10f5 100644 +--- a/configure.in ++++ b/configure.in +@@ -2950,7 +2950,7 @@ case "$host" in + *-*-minix*) ARCH=minix ;; + esac + CheckVisibilityHidden +- CheckDeclarationAfterStatement ++# CheckDeclarationAfterStatement + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio
meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb +2 -0
@@ -20,6 +20,8 @@ SRC_URI = " \ file://0001-prepend-our-sysroot-path-so-that-make-finds-our-wayl.patch \ file://0002-Avoid-finding-build-host-s-wayland-scanner.patch \ " +SRC_URI_append_powerpc = " file://disable-check-gcc-Wdeclaration-after-statement.patch" +SRC_URI_append_powerpc64 = " file://disable-check-gcc-Wdeclaration-after-statement.patch" S = "${WORKDIR}/SDL2-${PV}"
Signature · 1 line
2.10.1
Quoted 35 lines · On Mon, 2017-04-10 at 11:14 +0800, [email protected] wrote:
From: Kai Kang <[email protected]>
Disable check gcc option -Wdeclaration-after-statement for powerpc and
powerpc64 which causes compile failures:Quoted 10 lines
CC build/SDL_blit_N.lo .../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-
2.0.5/src/video/SDL_blit_N.c: In function 'calc_swizzle32':
.../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c:127:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const vector unsigned char plus = VECUINT8_LITERAL(0x00,0x00,0x00,0x00,
^~~~~Signed-off-by Kai Kang <[email protected]>---
...able-check-gcc-Wdeclaration-after-statement.patch | 20
++++++++++++++++++++
meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb | 2 ++2 files changed, 22 insertions(+)create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/disable- check-gcc-Wdeclaration-after-statement.patch
(quoted diff) +0
-0Wdeclaration-after-statement.patch b/meta/recipes- graphics/libsdl2/libsdl2/disable-check-gcc-Wdeclaration-after- statement.patch
new file mode 100644
index 0000000..ad48af7meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +0
-0Wdeclaration-after-statement.patch
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- line 1
Quoted 1 line
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +1
-0@@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [disable feature]
Given upstream explicitly enable this warning and the issue looks to be in their code, surely upstream would want to fix this.
Also, would it not be easier to patch the code and fix this than disabling the warning?
Cheers,
Richard
Quoted 39 lines
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +1
-0+Disable check gcc option -Wdeclaration-after-statement for powerpcand
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +17
-0+powerpc64 which causes compile failures. + +Signed-off-by: Kai Kang <[email protected]> +--- +diff --git a/configure.in b/configure.in +index e2ddc9c..73b10f5 100644 +--- a/configure.in ++++ b/configure.in +@@ -2950,7 +2950,7 @@ case "$host" in + *-*-minix*) ARCH=minix ;; + esac + CheckVisibilityHidden +- CheckDeclarationAfterStatement ++# CheckDeclarationAfterStatement + CheckDummyVideo + CheckDiskAudio + CheckDummyAudiometa/recipes-graphics/libsdl2/libsdl2_2.0.5.bb +0
-0@@ -20,6 +20,8 @@ SRC_URI = " \file://0001-prepend-our-sysroot-path-so-that-make-finds-our- wayl.patch \
file://0002-Avoid-finding-build-host-s-wayland-scanner.patch \
"
+SRC_URI_append_powerpc = " file://disable-check-gcc-Wdeclaration- after-statement.patch"
+SRC_URI_append_powerpc64 = " file://disable-check-gcc-Wdeclaration- after-statement.patch"
S = "${WORKDIR}/SDL2-${PV}"
--
2.10.1
Quoted 41 lines · Richard Purdie
Quoted 35 lines · On Mon, 2017-04-10 at 11:14 +0800, [email protected] wrote:
From: Kai Kang <[email protected]>
Disable check gcc option -Wdeclaration-after-statement for powerpc and
powerpc64 which causes compile failures:Quoted 10 lines
CC build/SDL_blit_N.lo
.../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c: In function 'calc_swizzle32':
.../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c:127:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00, ^~~~~Signed-off-by Kai Kang <[email protected]>--- ...able-check-gcc-Wdeclaration-after-statement.patch | 20 ++++++++++++++++++++ meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc-Wdeclaration-after-statement.patch
(quoted diff) +0
-0Wdeclaration-after-statement.patch b/meta/recipes- graphics/libsdl2/libsdl2/disable-check-gcc-Wdeclaration-after- statement.patch
new file mode 100644
index 0000000..ad48af7meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +0
-0Wdeclaration-after-statement.patch
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- line 1
Quoted 1 line
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +1
-0@@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [disable feature]Given upstream explicitly enable this warning and the issue looks to be in their code, surely upstream would want to fix this.
Quoted 2 lines
Also, would it not be easier to patch the code and fix this than disabling the warning?
yes, I think it should be fixed in code unless we know that this warning is being wrongly generated for ppc64
Quoted 45 lines
Cheers,
Richard
Quoted 39 lines
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +1
-0+Disable check gcc option -Wdeclaration-after-statement for powerpcand
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +17
-0+powerpc64 which causes compile failures. + +Signed-off-by: Kai Kang <[email protected]> +--- +diff --git a/configure.in b/configure.in +index e2ddc9c..73b10f5 100644 +--- a/configure.in ++++ b/configure.in +@@ -2950,7 +2950,7 @@ case "$host" in + *-*-minix*) ARCH=minix ;; + esac + CheckVisibilityHidden +- CheckDeclarationAfterStatement ++# CheckDeclarationAfterStatement + CheckDummyVideo + CheckDiskAudio + CheckDummyAudiometa/recipes-graphics/libsdl2/libsdl2_2.0.5.bb +1
-0@@ -20,6 +20,8 @@ SRC_URI = " \ file://0001-prepend-our-sysroot-path-so-that-make-finds-our- wayl.patch \ file://0002-Avoid-finding-build-host-s-wayland-scanner.patch \ " +SRC_URI_append_powerpc = " file://disable-check-gcc-Wdeclaration-after-statement.patch"
+SRC_URI_append_powerpc64 = " file://disable-check-gcc-Wdeclaration- after-statement.patch"S = "${WORKDIR}/SDL2-${PV}"
Signature · 1 line
2.10.1
Quoted 41 lines · Khem Raj
Quoted 39 lines · Richard Purdie
Quoted 34 lines · On Mon, 2017-04-10 at 11:14 +0800, [email protected] wrote:
From: Kai Kang <[email protected]>
Disable check gcc option -Wdeclaration-after-statement for powerpc and
powerpc64 which causes compile failures:Quoted 9 lines
CC build/SDL_blit_N.lo
.../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c: In function 'calc_swizzle32':
.../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c:127:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00, ^~~~~Signed-off-by Kai Kang <[email protected]>--- ...able-check-gcc-Wdeclaration-after-statement.patch | 20 ++++++++++++++++++++ meta/recipes-graphics/libsdl2/libsdl2_2.0.5.bb | 2 ++ 2 files changed, 22 insertions(+)create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/disable-
check-gcc-Wdeclaration-after-statement.patch(quoted diff) +0
-0Wdeclaration-after-statement.patch b/meta/recipes- graphics/libsdl2/libsdl2/disable-check-gcc-Wdeclaration-after- statement.patch
new file mode 100644
index 0000000..ad48af7meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +0
-0Wdeclaration-after-statement.patch
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- line 1
Quoted 1 line
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +1
-0@@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [disable feature]Given upstream explicitly enable this warning and the issue looks to be in their code, surely upstream would want to fix this.
Quoted 4 lines
Quoted 2 lines
Also, would it not be easier to patch the code and fix this than disabling the warning?
yes, I think it should be fixed in code unless we know that this warning is being wrongly generated for ppc64
I suppose this a gcc bug about powerpc/ppc64. gcc 6 uses default '-std=gnu11' to compile but it stills fails with 'ISO C90 forbids...'. Compare to x86, it also compiles with -Wdeclaration-after-statement and -Werror=declaration-after-statement too but succeeds.
Regards,
Kai
Quoted 45 lines
Quoted 45 lines
Cheers,
Richard
Quoted 39 lines
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +1
-0+Disable check gcc option -Wdeclaration-after-statement for powerpcand
meta/recipes-graphics/libsdl2/libsdl2/disable-check-gcc- new file +17
-0+powerpc64 which causes compile failures. + +Signed-off-by: Kai Kang <[email protected]> +--- +diff --git a/configure.in b/configure.in +index e2ddc9c..73b10f5 100644 +--- a/configure.in ++++ b/configure.in +@@ -2950,7 +2950,7 @@ case "$host" in + *-*-minix*) ARCH=minix ;; + esac + CheckVisibilityHidden +- CheckDeclarationAfterStatement ++# CheckDeclarationAfterStatement + CheckDummyVideo + CheckDiskAudio + CheckDummyAudiometa/recipes-graphics/libsdl2/libsdl2_2.0.5.bb +1
-0@@ -20,6 +20,8 @@ SRC_URI = " \ file://0001-prepend-our-sysroot-path-so-that-make-finds-our- wayl.patch \ file://0002-Avoid-finding-build-host-s-wayland-scanner.patch \ " +SRC_URI_append_powerpc = " file://disable-check-gcc-Wdeclaration-after-statement.patch"
+SRC_URI_append_powerpc64 = " file://disable-check-gcc-Wdeclaration- after-statement.patch"S = "${WORKDIR}/SDL2-${PV}"Signature · 1 line
2.10.1
Signature · 2 lines
Regards, Neil | Kai Kang
Quoted 10 lines · On 10 April 2017 at 04:14, <[email protected]> wrote:
| CC build/SDL_blit_N.lo
|.../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c:
In function 'calc_swizzle32':
| .../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c:127:5: error: ISO C90 forbids
| mixed declarations and code [-Werror=declaration-after-statement]
| const vector unsigned char plus = VECUINT8_LITERAL(0x00,0x00,0x00,0x00,
| ^~~~~
Upstream has already fixed this: http://hg.libsdl.org/SDL/rev/5184186d4366.
Ross
Quoted 16 lines · Ross
On 10 April 2017 at 04:14, <[email protected] <mailto:[email protected]>> wrote:
| CC build/SDL_blit_N.lo | .../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c: In function 'calc_swizzle32': | .../tmp/work/ppc7400-wrs-linux/libsdl2/2.0.5-r0/SDL2-2.0.5/src/video/SDL_blit_N.c:127:5: error: ISO C90 forbids | mixed declarations and code [-Werror=declaration-after-statement] | const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00, | ^~~~~
Quoted 1 line
Upstream has already fixed this: http://hg.libsdl.org/SDL/rev/5184186d4366.
Thanks, Ross. I'll send a review request for it.
--Kai
Quoted 2 lines
Ross
Signature · 2 lines
Regards, Neil | Kai Kang