]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix open-vm-tools build on Fedora using gcc 6.
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:55 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:55 +0000 (11:22 -0700)
There were two problems:

1. VMW_BIT_MASK in x86cpuid.h generated an error when trying to
   set all 32 bits.  This was due to using 33 bits in an intermediate
   calculation.

   The fix is to keep the calculation within 32 bits.

2. static const VMCI_HANDLE was defined in vmci_defs.h, but not used
   in one place that included the header.

   The fix is to add -Wno-unused-const-variable to CFLAGS to disable
   the new warning.

open-vm-tools/configure.ac
open-vm-tools/lib/include/x86cpuid.h

index 0431f4eb3dce46836b145dd98733d351494cf934..4817928deae9160043b04011a77fffcd14ebe734 100644 (file)
@@ -1036,7 +1036,8 @@ CFLAGS="$CFLAGS -Werror"
 # Glib2 keep changing mutex APIs so we also need to disable 'deprecated'
 # warnings for now (-Wno-deprecated-declarations).
 for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \
-    -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations; do
+    -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations \
+    -Wno-unused-const-variable; do
     AC_MSG_CHECKING([for GCC flag $TEST_CFLAG])
     ORIGINAL_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $TEST_CFLAG"
index 02c1b3ff416cf3fa24d3c080d1dec2d43e8a511f..89c5f76a8f8b7943db26d7cca5a10c6aa121c095 100644 (file)
@@ -1054,11 +1054,9 @@ FIELD(81E,  0, ECX,  8,  3, NODES_PER_PKG,                         NA,  FALSE)
  *
  * e.g. - CPUID_VIRT_BITS_MASK  = 0xff00
  *      - CPUID_VIRT_BITS_SHIFT = 8
- *
- * Note: The MASK definitions must use some gymnastics to get
- * around a warning when shifting left by 32.
  */
-#define VMW_BIT_MASK(shift)  (((1 << (shift - 1)) << 1) - 1)
+#define VMW_BIT_MASK(shift)  (0xffffffffu >> (32 - shift))
+
 
 #define FIELD(lvl, ecxIn, reg, bitpos, size, name, s, c3)      \
    CPUID_##name##_SHIFT        = bitpos,                       \