spice: fix builds with gcc 7.x
PATCH 1/1 spice: fix builds with gcc 7.x
There is an upstream fix for this issue but it doesn't apply cleanly and is rather simple so rather than backport it and turn it into something unrecognizeable I simply created my own version of it. This fixes builds which fail with:
| ../../git/server/reds.c: In function 'vdi_port_read_one_msg_from_device':
| ../../git/server/reds.c:797:31: error: this statement may fall through [-Werror=implicit-fallthrough=]
| state->read_state = VDI_PORT_READ_STATE_GET_BUFF;
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ../../git/server/reds.c:798:9: note: here
| case VDI_PORT_READ_STATE_GET_BUFF: {
| ^~~~--- .../spice/files/Fix-build-issues-with-gcc-7.patch | 59 ++++++++++++++++++++++ recipes-support/spice/spice_git.bb | 1 + 2 files changed, 60 insertions(+) create mode 100644 recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch
recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch new file +59 -0
@@ -0,0 +1,59 @@ +From 9f001b6818ac4baa1df010ccf4200ca56bfb11b2 Mon Sep 17 00:00:00 2001 +From: Mark Asselstine <[email protected]> +Date: Wed, 23 Aug 2017 13:47:29 -0400 +Subject: [PATCH] Fix build issues with gcc 7 + +gcc 7 checks for when a switch statement doesn't break between +cases. When a break is not found you will see + +| ../../git/server/reds.c: In function 'vdi_port_read_one_msg_from_device': +| ../../git/server/reds.c:797:31: error: this statement may fall through [-Werror=implicit-fallthrough=] +| state->read_state = VDI_PORT_READ_STATE_GET_BUFF; +| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +| ../../git/server/reds.c:798:9: note: here +| case VDI_PORT_READ_STATE_GET_BUFF: { +| ^~~~ + +The 'fallthrough' comment will let gcc know this is done on purpose. + +Signed-off-by: Mark Asselstine <[email protected]> +--- + server/inputs_channel.c | 1 + + server/reds.c | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/server/inputs_channel.c b/server/inputs_channel.c +index 931dac1..534ab66 100644 +--- a/server/inputs_channel.c ++++ b/server/inputs_channel.c +@@ -321,6 +321,7 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui + activate_modifiers_watch(); + } + } ++ /* fallthrough */ + case SPICE_MSGC_INPUTS_KEY_UP: { + SpiceMsgcKeyDown *key_down = (SpiceMsgcKeyDown *)buf; + for (i = 0; i < 4; i++) { +diff --git a/server/reds.c b/server/reds.c +index 30d0652..8c80eb6 100644 +--- a/server/reds.c ++++ b/server/reds.c +@@ -795,6 +795,7 @@ static SpiceCharDeviceMsgToClient *vdi_port_read_one_msg_from_device(SpiceCharDe + } + state->message_recive_len = state->vdi_chunk_header.size; + state->read_state = VDI_PORT_READ_STATE_GET_BUFF; ++ /* fallthrough */ + case VDI_PORT_READ_STATE_GET_BUFF: { + if (!(state->current_read_buf = vdi_port_read_buf_get())) { + return NULL; +@@ -806,6 +807,7 @@ static SpiceCharDeviceMsgToClient *vdi_port_read_one_msg_from_device(SpiceCharDe + state->message_recive_len -= state->recive_len; + state->read_state = VDI_PORT_READ_STATE_READ_DATA; + } ++ /* fallthrough */ + case VDI_PORT_READ_STATE_READ_DATA: + n = sif->read(vdagent, state->recive_pos, state->recive_len); + if (!n) { +-- +2.7.4 +
recipes-support/spice/spice_git.bb +1 -0
@@ -37,6 +37,7 @@ SRC_URI += " \ file://build-allow-separated-src-and-build-dirs.patch \ file://0001-red_parse_qxl-Fix-BITMAP_FMT_IS_RGB-defined-but-not-.patch \ file://0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch \ + file://Fix-build-issues-with-gcc-7.patch \ " S = "${WORKDIR}/git"
Signature · 1 line
2.7.4
merged.
Bruce
Quoted 119 lines · Mark Asselstine
There is an upstream fix for this issue but it doesn't apply cleanly and is rather simple so rather than backport it and turn it into something unrecognizeable I simply created my own version of it. This fixes builds which fail with:
|
../../git/server/reds.c: In function 'vdi_port_read_one_msg_from_device':
|../../git/server/reds.c:797:31: error: this statement may fall through [-Werror=implicit-fallthrough=]| state->read_state = VDI_PORT_READ_STATE_GET_BUFF; | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ../../git/server/reds.c:798:9: note: here | case VDI_PORT_READ_STATE_GET_BUFF: { | ^~~~Signed-off-by Mark Asselstine <[email protected]>--- .../spice/files/Fix-build-issues-with-gcc-7.patch | 59 ++++++++++++++++++++++ recipes-support/spice/spice_git.bb | 1 + 2 files changed, 60 insertions(+) create mode 100644 recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch
recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch new file +9
-0@@ -0,0 +1,59 @@ +From 9f001b6818ac4baa1df010ccf4200ca56bfb11b2 Mon Sep 17 00:00:00 2001 +From: Mark Asselstine <[email protected]> +Date: Wed, 23 Aug 2017 13:47:29 -0400 +Subject: [PATCH] Fix build issues with gcc 7 + +gcc 7 checks for when a switch statement doesn't break between +cases. When a break is not found you will see + +| ../../git/server/reds.c: In function 'vdi_port_read_one_msg_from_device':
+|../../git/server/reds.c:797:31: error: this statement may fall through [-Werror=implicit-fallthrough=]+| state->read_state = VDI_PORT_READ_STATE_GET_BUFF; +| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +| ../../git/server/reds.c:798:9: note: here +| case VDI_PORT_READ_STATE_GET_BUFF: { +| ^~~~recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch new file +14
-0+ +The 'fallthrough' comment will let gcc know this is done on purpose. + +Signed-off-by: Mark Asselstine <[email protected]> +--- + server/inputs_channel.c | 1 + + server/reds.c | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/server/inputs_channel.c b/server/inputs_channel.c +index 931dac1..534ab66 100644 +--- a/server/inputs_channel.c ++++ b/server/inputs_channel.c +@@ -321,6 +321,7 @@ static int inputs_channel_handle_parsed(RedChannelClient*rcc,
uint32_tsize, uirecipes-support/spice/files/Fix-build-issues-with-gcc-7.patch new file +12
-0+ activate_modifiers_watch(); + } + } ++ /* fallthrough */ + case SPICE_MSGC_INPUTS_KEY_UP: { + SpiceMsgcKeyDown *key_down = (SpiceMsgcKeyDown *)buf; + for (i = 0; i < 4; i++) { +diff --git a/server/reds.c b/server/reds.c +index 30d0652..8c80eb6 100644 +--- a/server/reds.c ++++ b/server/reds.c +@@ -795,6 +795,7 @@ static SpiceCharDeviceMsgToClient*vdi_port_read_one_msg_from_device(SpiceCharDe
recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch new file +8
-0+ } + state->message_recive_len = state->vdi_chunk_header.size; + state->read_state = VDI_PORT_READ_STATE_GET_BUFF; ++ /* fallthrough */ + case VDI_PORT_READ_STATE_GET_BUFF: { + if (!(state->current_read_buf = vdi_port_read_buf_get())) { + return NULL; +@@ -806,6 +807,7 @@ static SpiceCharDeviceMsgToClient*vdi_port_read_one_msg_from_device(SpiceCharDe
recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch new file +10
-0+ state->message_recive_len -= state->recive_len; + state->read_state = VDI_PORT_READ_STATE_READ_DATA; + } ++ /* fallthrough */ + case VDI_PORT_READ_STATE_READ_DATA: + n = sif->read(vdagent, state->recive_pos, state->recive_len); + if (!n) { +-- +2.7.4 +recipes-support/spice/ renamed from recipes-support/spice/spice_git.bb +0
-0spice_git.bb
index cfb75d7..04e7a25 100644recipes-support/spice/spice_git.bb +1
-0@@ -37,6 +37,7 @@ SRC_URI += " \ file://build-allow-separated-src-and-build-dirs.patch \ file://0001-red_parse_qxl-Fix-BITMAP_FMT_IS_RGB-defined-but-not-.patch \ file://0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch \ + file://Fix-build-issues-with-gcc-7.patch \ "S = "${WORKDIR}/git"
--
2.7.4--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization
Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"