From patchwork Tue Aug 13 11:28:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Ehrhardt X-Patchwork-Id: 57656 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E80791BE89; Tue, 13 Aug 2019 13:28:51 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id D1A051BE83 for ; Tue, 13 Aug 2019 13:28:50 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hxUyw-0005xN-EG; Tue, 13 Aug 2019 11:28:50 +0000 From: Christian Ehrhardt To: dev Cc: Luca Boccassi , Thomas Monjalon , Frank Heimes , Christian Ehrhardt Date: Tue, 13 Aug 2019 13:28:43 +0200 Message-Id: <20190813112843.27072-2-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190813112843.27072-1-christian.ehrhardt@canonical.com> References: <20190813112843.27072-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/1] net/mlx4: fix build on PPC64 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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: https://git.dpdk.org/dpdk/commit/?id=725f5dd0bfb50192a2d2341d4cc69084c2c4e03d Change-Id: Iceb058c07086def4176c5ab199ca4dd5018d0340 Signed-off-by: Christian Ehrhardt Tested-by: David Christensen Acked-by: Matan Azrad --- drivers/net/mlx4/mlx4_utils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h index a49190252..74b9d2ecd 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 +#endif + extern int mlx4_logtype; #ifndef NDEBUG