summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/105/graphic/1824528
blob: 723fc285a7b3ad3b13c63458b64467b84b3baa07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
graphic: 0.971
socket: 0.954
network: 0.941
mistranslation: 0.921
device: 0.919
other: 0.912
semantic: 0.901
instruction: 0.900
vnc: 0.900
KVM: 0.895
assembly: 0.875
boot: 0.785

qemu fails to compile on gcc 9 `error: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Werror=address-of-packed-member]`

Qemu compilation fails with below error on ppc64le host with gcc 9(9.0.1 20190328)
repo: https://github.com/qemu/qemu.git
branch: master
commit e1be98540ee672ef93292b65a986055512237c35


  CC      net/dump.o
hw/usb/dev-mtp.c: In function ‘usb_mtp_write_metadata’:
hw/usb/dev-mtp.c:1708:36: error: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
 1708 |                             dataset->filename);
      |                             ~~~~~~~^~~~~~~~~~
cc1: all warnings being treated as errors
  CC      net/eth.o
make: *** [/home/kvmci/qemu-main/rules.mak:69: hw/usb/dev-mtp.o] Error 1
make: *** Waiting for unfinished jobs....
  CC      net/announce.o

Tried to patch as below and it compiles fine, not sure if this is right fix though,


# git diff
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index ebf210f..7d512e5 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -231,7 +231,7 @@ typedef struct {
     char date_modified[0]; /*unused*/
     char keywords[0]; /*unused*/
     /* string and other data follows */
-} QEMU_PACKED ObjectInfo;
+} ObjectInfo;
 
 #define TYPE_USB_MTP "usb-mtp"
 #define USB_MTP(obj) OBJECT_CHECK(MTPState, (obj), TYPE_USB_MTP)


This struct represents the MTP protocol wire format so *must* be marked packed.

There unfortunately quite a few flaws in this MTP code area, so fixing the gcc warning is not straightforward.

https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg07763.html

As a workaround, the simplest thing is to configure with --disable-werror, which will reduce these from errors to warnings. (This is the default if you're building from one of our release tarballs, but for builds from git we default to making all warnings into errors so we catch and fix them quickly.)


Sure, Thanks, using the workaround to proceed.

Good if each commit goes through a automated build test across different platforms vs gcc versions.

Regards,
-Satheesh.

Fixed in

https://lists.gnu.org/archive/html/qemu-devel/2019-04/msg02524.html

The fixes for this issue in dev-mtp.c are now in QEMU git master and will be in the 4.1 release.