diff options
authorChristian Ehrhardt <>2019-08-13 13:28:43 +0200
committerFerruh Yigit <>2019-09-03 11:53:34 +0200
commitceadf1a405d9951c6d15ed27e010f5b1a80dbdf5 (patch)
parent5fdd61136babc3ec4a371ed09372c551da3e79b3 (diff)
net/mlx4: fix build on ppc64
The AltiVec header file breaks boolean type: error: incompatible types when initializing type '__vector _bool int' {aka '_vector(4) __bool int'} using type 'int' If __APPLE_ALTIVEC__ is defined, then bool type is redefined and conflicts with stdbool.h. There is no good solution to fix it for the whole project without breaking something else, so a workaround is inserted in mlx5 PMD. This workaround is not compatible with C++ but there is no C++ in DPDK. Related to: 725f5dd0bfb5 ("net/mlx5: fix build on PPC64") Cc: Signed-off-by: Christian Ehrhardt <> Tested-by: David Christensen <> Acked-by: Matan Azrad <>
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h
index a491902..74b9d2e 100644
--- a/drivers/net/mlx4/mlx4_utils.h
+++ b/drivers/net/mlx4/mlx4_utils.h
@@ -15,6 +15,16 @@
#include "mlx4.h"
+ * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11.
+ * Otherwise there would be a type conflict between stdbool and altivec.
+ */
+#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__)
+#undef bool
+/* redefine as in stdbool.h */
+#define bool _Bool
extern int mlx4_logtype;
#ifndef NDEBUG