Skip to contentSkip to conversation

4815185902 seems to break build for me

Qemu-devel BALATON Zoltan 2 participants 3 messages Jul 19, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

I see this error during build now:

CC audio/alsaaudio.o
In file included from ~/src/qemu/include/qom/cpu.h:24:0,

                 from ./trace/control-internal.h:15,
                 from ./trace/control.h:281,
                 from ./trace/generated-tracers.h:8,
                 from ~/src/qemu/include/trace.h:4,
                 from audio/alsaaudio.c:29:

~/src/qemu/include/disas/bfd.h:480:0: error: "ATTRIBUTE_UNUSED" redefined [-Werror]
#define ATTRIBUTE_UNUSED __attribute__((unused))
^
In file included from /usr/include/alsa/asoundlib.h:49:0,
from audio/alsaaudio.c:25:
/usr/include/alsa/global.h:51:0: note: this is the location of the previous definition
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
^
cc1: all warnings being treated as errors
~/src/qemu/rules.mak:59: recipe for target 'audio/alsaaudio.o' failed
make: *** [audio/alsaaudio.o] Error 1

Bisected to:

4815185902971c41fcdd700fa1fc3e1d9299900f is the first bad commit commit 4815185902971c41fcdd700fa1fc3e1d9299900f

Author: Lluís Vilanova <[email protected]>
Date:   Mon Jul 11 12:53:41 2016 +0200

trace: Add per-vCPU tracing states for events with the 'vcpu' property

Each vCPU gets a 'trace_dstate' bitmap to control the per-vCPU dynamic tracing state of events with the 'vcpu' property.

Any ideas for a fix?

Regards,
BALATON Zoltan

#1 lore raw
Quoted 34 lines · BALATON Zoltan

Hello,

I see this error during build now:

CC audio/alsaaudio.o
In file included from ~/src/qemu/include/qom/cpu.h:24:0,

                 from ./trace/control-internal.h:15,
                 from ./trace/control.h:281,
                 from ./trace/generated-tracers.h:8,
                 from ~/src/qemu/include/trace.h:4,
                 from audio/alsaaudio.c:29:

~/src/qemu/include/disas/bfd.h:480:0: error: "ATTRIBUTE_UNUSED" redefined [-Werror]
#define ATTRIBUTE_UNUSED __attribute__((unused))
^
In file included from /usr/include/alsa/asoundlib.h:49:0,
from audio/alsaaudio.c:25:
/usr/include/alsa/global.h:51:0: note: this is the location of the previous definition
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
^
cc1: all warnings being treated as errors ~/src/qemu/rules.mak:59: recipe for target 'audio/alsaaudio.o' failed
make: *** [audio/alsaaudio.o] Error 1

Bisected to:

4815185902971c41fcdd700fa1fc3e1d9299900f is the first bad commit commit 4815185902971c41fcdd700fa1fc3e1d9299900f

Author: Lluís Vilanova <[email protected]>
Date:   Mon Jul 11 12:53:41 2016 +0200

trace: Add per-vCPU tracing states for events with the 'vcpu' property

Quoted 7 lines

Each vCPU gets a 'trace_dstate' bitmap to control the per-vCPU dynamic tracing state of events with the 'vcpu' property.

Any ideas for a fix?

That's kind of unpleasant namespace pollution by the alsa headers, but I guess we have to live with it.

The simplest fix would be to add #ifndef ATTRIBUTE_UNUSED...#endif around the define in bfd.h, and drop the unnecessary duplicate define from disas/arm.c.

thanks
-- PMM

#2 lore raw
Quoted 3 lines · Peter Maydell

The simplest fix would be to add #ifndef ATTRIBUTE_UNUSED...#endif around the define in bfd.h, and drop the unnecessary duplicate define from disas/arm.c.

A more invasive fix would be to convert all the uses of ATTRIBUTE_UNUSED to G_GNUC_UNUSED (provided by glib and already used in a few files).

I guess I marginally prefer the simple fix.

thanks
-- PMM