From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id AB3E25F17; Tue, 15 Jan 2019 11:32:51 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0D9BC15AD; Tue, 15 Jan 2019 02:32:51 -0800 (PST) Received: from net-arm-c2400.shanghai.arm.com (net-arm-c2400.shanghai.arm.com [10.169.41.165]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 645D23F70D; Tue, 15 Jan 2019 02:32:49 -0800 (PST) From: gavin hu To: dev@dpdk.org Cc: nd@arm.com, thomas@monjalon.net, jerinj@marvell.com, hemant.agrawal@nxp.com, Honnappa.Nagarahalli@arm.com, gavin.hu@arm.com, olivier.matz@6wind.com, bruce.richardson@intel.com, stable@dpdk.org Date: Tue, 15 Jan 2019 18:32:31 +0800 Message-Id: <1547548354-44671-2-git-send-email-gavin.hu@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547548354-44671-1-git-send-email-gavin.hu@arm.com> References: <1547548354-44671-1-git-send-email-gavin.hu@arm.com> In-Reply-To: <20181220104246.5590-1-gavin.hu@arm.com> References: <20181220104246.5590-1-gavin.hu@arm.com> Subject: [dpdk-dev] [PATCH v5 1/4] eal: fix clang compilation error on x86 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: , X-List-Received-Date: Tue, 15 Jan 2019 10:32:52 -0000 From: Gavin Hu When CONFIG_RTE_FORCE_INTRINSICS is enabled for x86, the clang compilation error was: include/generic/rte_atomic.h:215:9: error: implicit declaration of function '__atomic_exchange_2' is invalid in C99 include/generic/rte_atomic.h:494:9: error: implicit declaration of function '__atomic_exchange_4' is invalid in C99 include/generic/rte_atomic.h:772:9: error: implicit declaration of function '__atomic_exchange_8' is invalid in C99 Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8). For more information, please refer to: http://mails.dpdk.org/archives/dev/2018-April/096776.html Fixes: 7bdccb93078e ("eal: fix ARM build with clang") Cc: stable@dpdk.org Signed-off-by: Gavin Hu Acked-by: Jerin Jacob --- lib/librte_eal/common/include/generic/rte_atomic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/include/generic/rte_atomic.h b/lib/librte_eal/common/include/generic/rte_atomic.h index b99ba46..ed5b125 100644 --- a/lib/librte_eal/common/include/generic/rte_atomic.h +++ b/lib/librte_eal/common/include/generic/rte_atomic.h @@ -212,7 +212,7 @@ rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val); static inline uint16_t rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val) { -#if defined(RTE_ARCH_ARM64) && defined(RTE_TOOLCHAIN_CLANG) +#if defined(RTE_TOOLCHAIN_CLANG) return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST); #else return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST); @@ -495,7 +495,7 @@ rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val); static inline uint32_t rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val) { -#if defined(RTE_ARCH_ARM64) && defined(RTE_TOOLCHAIN_CLANG) +#if defined(RTE_TOOLCHAIN_CLANG) return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST); #else return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST); @@ -777,7 +777,7 @@ rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val); static inline uint64_t rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val) { -#if defined(RTE_ARCH_ARM64) && defined(RTE_TOOLCHAIN_CLANG) +#if defined(RTE_TOOLCHAIN_CLANG) return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST); #else return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST); -- 2.7.4