• M
    Fix make check with gcc version 5 · 4b47f9b8
    Martin Kletzander 提交于
    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: NMartin Kletzander <mkletzan@redhat.com>
    4b47f9b8
lock_driver_lockd.c 24.1 KB