diff options
author | Mark Asselstine <mark.asselstine@windriver.com> | 2017-08-23 14:08:05 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-08-24 09:58:54 -0400 |
commit | 19f0c979abbc72a300c0b1cb92f9328f96728f5a (patch) | |
tree | ca085eb814db71b40e0eb57a2ebccce64b5f8399 | |
parent | c41b0107f0bf1aebf3def177fd3a8d8e9130e0af (diff) | |
download | meta-cloud-services-19f0c979abbc72a300c0b1cb92f9328f96728f5a.tar.gz |
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: {
| ^~~~
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r-- | recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch | 59 | ||||
-rw-r--r-- | recipes-support/spice/spice_git.bb | 1 |
2 files changed, 60 insertions, 0 deletions
diff --git a/recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch b/recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch new file mode 100644 index 0000000..7fcafdc --- /dev/null +++ b/recipes-support/spice/files/Fix-build-issues-with-gcc-7.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From 9f001b6818ac4baa1df010ccf4200ca56bfb11b2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Asselstine <mark.asselstine@windriver.com> | ||
3 | Date: Wed, 23 Aug 2017 13:47:29 -0400 | ||
4 | Subject: [PATCH] Fix build issues with gcc 7 | ||
5 | |||
6 | gcc 7 checks for when a switch statement doesn't break between | ||
7 | cases. When a break is not found you will see | ||
8 | |||
9 | | ../../git/server/reds.c: In function 'vdi_port_read_one_msg_from_device': | ||
10 | | ../../git/server/reds.c:797:31: error: this statement may fall through [-Werror=implicit-fallthrough=] | ||
11 | | state->read_state = VDI_PORT_READ_STATE_GET_BUFF; | ||
12 | | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
13 | | ../../git/server/reds.c:798:9: note: here | ||
14 | | case VDI_PORT_READ_STATE_GET_BUFF: { | ||
15 | | ^~~~ | ||
16 | |||
17 | The 'fallthrough' comment will let gcc know this is done on purpose. | ||
18 | |||
19 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
20 | --- | ||
21 | server/inputs_channel.c | 1 + | ||
22 | server/reds.c | 2 ++ | ||
23 | 2 files changed, 3 insertions(+) | ||
24 | |||
25 | diff --git a/server/inputs_channel.c b/server/inputs_channel.c | ||
26 | index 931dac1..534ab66 100644 | ||
27 | --- a/server/inputs_channel.c | ||
28 | +++ b/server/inputs_channel.c | ||
29 | @@ -321,6 +321,7 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui | ||
30 | activate_modifiers_watch(); | ||
31 | } | ||
32 | } | ||
33 | + /* fallthrough */ | ||
34 | case SPICE_MSGC_INPUTS_KEY_UP: { | ||
35 | SpiceMsgcKeyDown *key_down = (SpiceMsgcKeyDown *)buf; | ||
36 | for (i = 0; i < 4; i++) { | ||
37 | diff --git a/server/reds.c b/server/reds.c | ||
38 | index 30d0652..8c80eb6 100644 | ||
39 | --- a/server/reds.c | ||
40 | +++ b/server/reds.c | ||
41 | @@ -795,6 +795,7 @@ static SpiceCharDeviceMsgToClient *vdi_port_read_one_msg_from_device(SpiceCharDe | ||
42 | } | ||
43 | state->message_recive_len = state->vdi_chunk_header.size; | ||
44 | state->read_state = VDI_PORT_READ_STATE_GET_BUFF; | ||
45 | + /* fallthrough */ | ||
46 | case VDI_PORT_READ_STATE_GET_BUFF: { | ||
47 | if (!(state->current_read_buf = vdi_port_read_buf_get())) { | ||
48 | return NULL; | ||
49 | @@ -806,6 +807,7 @@ static SpiceCharDeviceMsgToClient *vdi_port_read_one_msg_from_device(SpiceCharDe | ||
50 | state->message_recive_len -= state->recive_len; | ||
51 | state->read_state = VDI_PORT_READ_STATE_READ_DATA; | ||
52 | } | ||
53 | + /* fallthrough */ | ||
54 | case VDI_PORT_READ_STATE_READ_DATA: | ||
55 | n = sif->read(vdagent, state->recive_pos, state->recive_len); | ||
56 | if (!n) { | ||
57 | -- | ||
58 | 2.7.4 | ||
59 | |||
diff --git a/recipes-support/spice/spice_git.bb b/recipes-support/spice/spice_git.bb index cfb75d7..04e7a25 100644 --- a/recipes-support/spice/spice_git.bb +++ b/recipes-support/spice/spice_git.bb | |||
@@ -37,6 +37,7 @@ SRC_URI += " \ | |||
37 | file://build-allow-separated-src-and-build-dirs.patch \ | 37 | file://build-allow-separated-src-and-build-dirs.patch \ |
38 | file://0001-red_parse_qxl-Fix-BITMAP_FMT_IS_RGB-defined-but-not-.patch \ | 38 | file://0001-red_parse_qxl-Fix-BITMAP_FMT_IS_RGB-defined-but-not-.patch \ |
39 | file://0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch \ | 39 | file://0001-Use-PRI-macros-in-printf-to-keep-compatibility-betwe.patch \ |
40 | file://Fix-build-issues-with-gcc-7.patch \ | ||
40 | " | 41 | " |
41 | 42 | ||
42 | S = "${WORKDIR}/git" | 43 | S = "${WORKDIR}/git" |