All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1817525] [NEW] qemu fails to compile on gcc 9 "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]"
@ 2019-02-25  9:16 Satheesh Rajendran
  2019-02-25  9:35 ` [Qemu-devel] [Bug 1817525] " Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Satheesh Rajendran @ 2019-02-25  9:16 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

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 <thuth@redhat.com>
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 <ehabkost@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <1550748288-30598-1-git-send-email-thuth@redhat.com>
    Reviewed-by: Cédric Le Goater <clg@kaod.org>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

Host 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

** Affects: qemu
     Importance: Undecided
         Status: New


** Tags: compilation gcc9 ppc64le

** Description changed:

  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
+  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];
-       |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   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];
-       |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   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 <thuth@redhat.com>
  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 <ehabkost@redhat.com>
-     Signed-off-by: Thomas Huth <thuth@redhat.com>
-     Message-Id: <1550748288-30598-1-git-send-email-thuth@redhat.com>
-     Reviewed-by: Cédric Le Goater <clg@kaod.org>
-     Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+     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.
  
- Note: Same commit on a different ppc64le host with gcc(8.1.1 20180712) compile without any issue.
+     Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
+     Signed-off-by: Thomas Huth <thuth@redhat.com>
+     Message-Id: <1550748288-30598-1-git-send-email-thuth@redhat.com>
+     Reviewed-by: Cédric Le Goater <clg@kaod.org>
+     Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  
- Env:
+ Note: Same commit on a different ppc64le host with gcc(8.1.1 20180712)
+ compile without any issue.
+ 
+ Host 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

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1817525

Title:
  qemu fails to compile on gcc 9 "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]"

Status in QEMU:
  New

Bug description:
  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 <thuth@redhat.com>
  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 <ehabkost@redhat.com>
      Signed-off-by: Thomas Huth <thuth@redhat.com>
      Message-Id: <1550748288-30598-1-git-send-email-thuth@redhat.com>
      Reviewed-by: Cédric Le Goater <clg@kaod.org>
      Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

  Host 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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1817525/+subscriptions

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [Bug 1817525] Re: qemu fails to compile on gcc 9 "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]"
  2019-02-25  9:16 [Qemu-devel] [Bug 1817525] [NEW] qemu fails to compile on gcc 9 "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]" Satheesh Rajendran
@ 2019-02-25  9:35 ` Peter Maydell
  2019-02-28 14:24 ` Thomas Huth
  2019-04-24  5:25 ` Thomas Huth
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2019-02-25  9:35 UTC (permalink / raw)
  To: qemu-devel

The fields of the struct are naturally aligned, so this should be easy
enough to fix just by dropping QEMU_PACKED (we already have a compile-
time assert that the doorbells field is at the expected address).

NB: I notice also the struct is marked 'volatile' -- this is a bit of a
red flag that the code may not really be doing the right thing here.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1817525

Title:
  qemu fails to compile on gcc 9 "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]"

Status in QEMU:
  New

Bug description:
  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 <thuth@redhat.com>
  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 <ehabkost@redhat.com>
      Signed-off-by: Thomas Huth <thuth@redhat.com>
      Message-Id: <1550748288-30598-1-git-send-email-thuth@redhat.com>
      Reviewed-by: Cédric Le Goater <clg@kaod.org>
      Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

  Host 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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1817525/+subscriptions

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [Bug 1817525] Re: qemu fails to compile on gcc 9 "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]"
  2019-02-25  9:16 [Qemu-devel] [Bug 1817525] [NEW] qemu fails to compile on gcc 9 "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]" Satheesh Rajendran
  2019-02-25  9:35 ` [Qemu-devel] [Bug 1817525] " Peter Maydell
@ 2019-02-28 14:24 ` Thomas Huth
  2019-04-24  5:25 ` Thomas Huth
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2019-02-28 14:24 UTC (permalink / raw)
  To: qemu-devel

Fix has been merged:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=83c68e149a9365a3db6de

** Changed in: qemu
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1817525

Title:
  qemu fails to compile on gcc 9 "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]"

Status in QEMU:
  Fix Committed

Bug description:
  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 <thuth@redhat.com>
  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 <ehabkost@redhat.com>
      Signed-off-by: Thomas Huth <thuth@redhat.com>
      Message-Id: <1550748288-30598-1-git-send-email-thuth@redhat.com>
      Reviewed-by: Cédric Le Goater <clg@kaod.org>
      Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

  Host 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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1817525/+subscriptions

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [Bug 1817525] Re: qemu fails to compile on gcc 9 "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]"
  2019-02-25  9:16 [Qemu-devel] [Bug 1817525] [NEW] qemu fails to compile on gcc 9 "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]" Satheesh Rajendran
  2019-02-25  9:35 ` [Qemu-devel] [Bug 1817525] " Peter Maydell
  2019-02-28 14:24 ` Thomas Huth
@ 2019-04-24  5:25 ` Thomas Huth
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2019-04-24  5:25 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1817525

Title:
  qemu fails to compile on gcc 9 "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]"

Status in QEMU:
  Fix Released

Bug description:
  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 <thuth@redhat.com>
  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 <ehabkost@redhat.com>
      Signed-off-by: Thomas Huth <thuth@redhat.com>
      Message-Id: <1550748288-30598-1-git-send-email-thuth@redhat.com>
      Reviewed-by: Cédric Le Goater <clg@kaod.org>
      Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

  Host 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

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1817525/+subscriptions

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-24  5:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25  9:16 [Qemu-devel] [Bug 1817525] [NEW] qemu fails to compile on gcc 9 "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]" Satheesh Rajendran
2019-02-25  9:35 ` [Qemu-devel] [Bug 1817525] " Peter Maydell
2019-02-28 14:24 ` Thomas Huth
2019-04-24  5:25 ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.