Comment 0 for bug 1817525

Revision history for this message
Satheesh Rajendran (sathnaga) wrote :

Issue:
Qemu compilation fails with below error on ppc64le host with gcc 9, repo(https://github.com/dgibson/qemu.git), branch(ppc-for-4.0), Commit (0483e90393bac8546a1fbc95ab912a1e78e92b00)

 CHK version_gen.h
  CC block/nvme.o
block/nvme.c: In function ‘nvme_create_queue_pair’:
block/nvme.c:209:22: error: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
  209 | q->sq.doorbell = &s->regs->doorbells[idx * 2 * s->doorbell_scale];
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/nvme.c:216:22: error: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
  216 | q->cq.doorbell = &s->regs->doorbells[idx * 2 * s->doorbell_scale + 1];
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [/usr/share/avocado-plugins-vt/build/qemu/rules.mak:69: block/nvme.o] Error 1

$git commit:
commit 0483e90393bac8546a1fbc95ab912a1e78e92b00 (HEAD -> ppc-for-4.0)
Author: Thomas Huth <email address hidden>
Date: Thu Feb 21 12:24:48 2019 +0100

    hw/ppc: Use object_initialize_child for correct reference counting

    Both functions, object_initialize() and object_property_add_child() increase
    the reference counter of the new object, so one of the references has to be
    dropped afterwards to get the reference counting right. Otherwise the child
    object will not be properly cleaned up when the parent gets destroyed.
    Thus let's use now object_initialize_child() instead to get the reference
    counting here right.

    Suggested-by: Eduardo Habkost <email address hidden>
    Signed-off-by: Thomas Huth <email address hidden>
    Message-Id: <email address hidden>
    Reviewed-by: Cédric Le Goater <email address hidden>
    Signed-off-by: David Gibson <email address hidden>

Note: Same commit on a different ppc64le host with gcc(8.1.1 20180712) compile without any issue.

Env:

Power8

#lscpu
Architecture: ppc64le
Byte Order: Little Endian
CPU(s): 160
On-line CPU(s) list: 0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152
Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79,81-87,89-95,97-103,105-111,113-119,121-127,129-135,137-143,145-151,153-159
Thread(s) per core: 1
Core(s) per socket: 5
Socket(s): 4
NUMA node(s): 4
Model: 2.1 (pvr 004b 0201)
Model name: POWER8E (raw), altivec supported
CPU max MHz: 3690.0000
CPU min MHz: 2061.0000
L1d cache: 64K
L1i cache: 32K
L2 cache: 512K
L3 cache: 8192K
NUMA node0 CPU(s): 0,8,16,24,32
NUMA node1 CPU(s): 40,48,56,64,72
NUMA node16 CPU(s): 80,88,96,104,112
NUMA node17 CPU(s): 120,128,136,144,152

# gcc --version
gcc (GCC) 9.0.1 20190209 (Red Hat 9.0.1-0.4)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# uname -r
5.0.0-rc7-ge50585e89