From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 89E1E1B1E9 for ; Mon, 14 Jan 2019 17:14:50 +0100 (CET) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190114161449euoutp0254f72fb11b7ce8c16788203990a17535~5wx-1oRsO2058420584euoutp02t for ; Mon, 14 Jan 2019 16:14:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190114161449euoutp0254f72fb11b7ce8c16788203990a17535~5wx-1oRsO2058420584euoutp02t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1547482489; bh=Omb064pKlX8sr+9d1SB/gGPgleKs6G+s943ZVxqsUI4=; h=From:To:Cc:Subject:Date:References:From; b=YAcjQcRdHZ9tphtChQ/U9A4fQ2algNbxK/VzVn0dc88LuuCVAwrrgkvPXtwzy4YHr OzuJQHb7CTFJ4aR1p5p/pQc65V02x5AVpksrTNvchvHUOkdWIvRWHMxQ0eYbldiO7f TlgKDmgUMFaqjD1eJ7m3nMESD+8MrMLnUVsNYtew= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190114161448eucas1p1a129f0c17b8a5fe8cc2579edd7a54f84~5wx-Wt8_Z1217212172eucas1p1S; Mon, 14 Jan 2019 16:14:48 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 15.67.04806.875BC3C5; Mon, 14 Jan 2019 16:14:48 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190114161447eucas1p1c1d73ede17b706e69a4db491f8c94578~5wx_sMlpQ0069800698eucas1p1W; Mon, 14 Jan 2019 16:14:47 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190114161447eusmtrp12af22abb3bbe60c4056086e8a2b46260~5wx_dyBiW0686806868eusmtrp17; Mon, 14 Jan 2019 16:14:47 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-00-5c3cb578b451 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id BD.A5.04284.775BC3C5; Mon, 14 Jan 2019 16:14:47 +0000 (GMT) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190114161447eusmtip25fa8a97c66af8ae5997d386983b44900~5wx_BlxCg0192301923eusmtip2Y; Mon, 14 Jan 2019 16:14:47 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org, Thomas Monjalon Cc: Pavan Nikhilesh , Ilya Maximets , stable@dpdk.org Date: Mon, 14 Jan 2019 19:14:42 +0300 Message-Id: <20190114161442.8277-1-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPIsWRmVeSWpSXmKPExsWy7djP87oVW21iDO5c4bN492k7k8WV9p/s Fsd7PrJY/Ov4w27x6cEJFgdWj18LlrJ6TF54kdnj2M1p7B59W1YxBrBEcdmkpOZklqUW6dsl cGX8u7WBreCXcEVz0z22Bsb7Al2MnBwSAiYSq+62sHYxcnEICaxglHix/gYzhPOFUWLP7qVs EM5nRonmq99Zuhg5wFoWb5KBiC9nlJh3qB2q6AejxO6nU1hA5rIJ6EicWn2EEcQWETCXmDih kxXEZhbIlFj3cxsbiC0s4CKx+9xuMJtFQFVi5/lnYDW8AlYST65vZYO4T15i9YYDYCdJCBxg k5j85htUwkXi3f5zjBC2sMSr41vYIWwZidOTe1gg7HqJ+y0vGSGaOxglph/6xwSRsJfY8voc O8g7zAKaEut36U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rFxRZX1R+Iz7swmbrrB3Su5b9mNq+/d3Ro9SnYMOvruk z8ozj89RT+dd4a6XNWdYF+VfvlI9XSHpXenuo7PPNJ3fc87ghs5MbrGW+9kKFzuyvnfO3TWx W8bIp7ojgu3G83SRPMsvx+848a8zE+t5psRSnJFoqMVcVJwIACM9nYdJAgAA X-CMS-MailID: 20190114161447eucas1p1c1d73ede17b706e69a4db491f8c94578 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190114161447eucas1p1c1d73ede17b706e69a4db491f8c94578 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190114161447eucas1p1c1d73ede17b706e69a4db491f8c94578 References: Subject: [dpdk-dev] [PATCH] eal: fix build of external apps with clang on armv8 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: Mon, 14 Jan 2019 16:14:50 -0000 In case DPDK built using GCC, RTE_TOOLCHAIN_CLANG is not defined. But 'rte_atomic.h' is a generic header that included to the external apps like OVS while building with DPDK. As a result, clang build of OVS fails on ARMv8 if DPDK built using gcc: 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 We need to check for current compiler, not the compiler used for DPDK build. Fixes: 7bdccb93078e ("eal: fix ARM build with clang") Cc: stable@dpdk.org Signed-off-by: Ilya Maximets --- 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 b99ba4688..d0c464fb1 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_ARCH_ARM64) && defined(__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_ARCH_ARM64) && defined(__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_ARCH_ARM64) && defined(__clang__) return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST); #else return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST); -- 2.17.1