]> xenbits.xensource.com Git - libvirt.git/commit
Fix make check with gcc version 5
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 12 Jan 2016 15:47:13 +0000 (16:47 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 18 Jan 2016 14:19:21 +0000 (15:19 +0100)
commit4b47f9b82c19b229fe18552127b233141e2c6063
treeb483c8a141476f11ab74899f8418db5031916a60
parenta5a383adc17f708204fdaeb3dead2a4f3cebf4fd
Fix make check with gcc version 5

When building with gcc-5 (particularly gcc-5.3.0 now) and having pdwtags
installed (package dwarves) make check fails with the following error:

  $ make lock_protocol-struct
  GEN      lock_protocol-struct
  --- lock_protocol-structs 2016-01-13 15:04:59.318809607 +0100
  +++ lock_protocol-struct-t3 2016-01-13 15:05:17.703501234 +0100
  @@ -26,10 +26,6 @@
           virLockSpaceProtocolNonNullString name;
           u_int                      flags;
   };
  -enum virLockSpaceProtocolAcquireResourceFlags {
  -        VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED = 1,
  -        VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE = 2,
  -};
   struct virLockSpaceProtocolAcquireResourceArgs {
           virLockSpaceProtocolNonNullString path;
           virLockSpaceProtocolNonNullString name;
  Makefile:10415: recipe for target 'lock_protocol-struct' failed
  make: *** [lock_protocol-struct] Error 1

That happens because without any specific options gcc doesn't keep enum
information in the resulting binary object.  I managed to isolate the
parameters of gcc that caused this issue to disappear, however I
remember that they influenced the resulting binaries quite a bit and
were definitely not something we would want to add as mandatory to the
build process.

So to deal with this cleanly, let's take that enum and separate it out
to its own header file.  Since it is only used in the lockd driver and
the protocol, lock_driver_lockd.h feels like a suitable name.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/Makefile.am
src/lock_protocol-structs
src/locking/lock_driver_lockd.c
src/locking/lock_driver_lockd.h [new file with mode: 0644]
src/locking/lock_protocol.x