From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 4708CA0562;
	Fri, 19 Mar 2021 15:58:46 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B636B140F32;
	Fri, 19 Mar 2021 15:57:54 +0100 (CET)
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com
 [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 0F25D140F2F;
 Fri, 19 Mar 2021 15:57:53 +0100 (CET)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 798A55C0115;
 Fri, 19 Mar 2021 10:57:52 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute4.internal (MEProxy); Fri, 19 Mar 2021 10:57:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding; s=fm3; bh=FhzSHxhRXO4zT
 LQjbwLPnyIKRZ/STCpQMmoUzfae2z4=; b=WY8+0QiCMeI2j/h023MmR0ndUmxG6
 UvdLwhBdeQlqAQhncnevQ4xxK22qjqf1X591LUxc46h3Yp4m86rtBkUYZ5yXU4ko
 +TVqV/kzsuXRqxXKIx1nfYHtv2eQ0Ux2rZMqLh2gG4rHsQiF32DIW2q6Kwsfdv1q
 XAo79lxu3AvnQEzo5g68BsFGTJ9TRUWU2ZPh55U18RrMNFFa9vmdMiWgBl3AYbC2
 w8kh+Z2lys/GTyupdnafNwoTRoBJSN1OwJhvbGkm6XK9yg8Q7kLvdKwCJ+Stzbvy
 t4gSprGbIHn2xhiS77HC6spqE7qoO1tJmq6GDRpud3AOl8GBZv1iteBvA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:date:from
 :in-reply-to:message-id:mime-version:references:subject:to
 :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm2; bh=FhzSHxhRXO4zTLQjbwLPnyIKRZ/STCpQMmoUzfae2z4=; b=pMWt1rYo
 ShHJ1i5tszcruFUoTwcd4CM/eh2c0H5DzNBPwSrzRUiVzkZ/vpCs8i63r65C9my0
 NnuqZCn4P+D5K6ThV7SnImyF0uun47sUQtTWfQgmvRH8sxgoCwfsqVLN7j+aOB+a
 GC7XiYN2003hSyVMFomhwZESuHUoyGJZ20pPUNqNoUSPX87HTUJsuQ1O0PEeXMll
 dnEr6UOzhUsdwehLJhxZ2JWXJfcjj4qajGumaOaLie7lGGHxgK591wguIF5JS+q7
 pg+/xfsJ1gnnYSUeO8ZaQ6E+uNXAUCOsOBkGSpykXvbSa3g1CmD3KGB+CGqsfXVM
 eg9jwne+Vbfizg==
X-ME-Sender: <xms:8LtUYNapbyrWIsuZsrN-6TWUNNmQpKNLq3OAppKI4bGkF1gPKQ0m2Q>
 <xme:8LtUYEUV3_HIux8Vm7z-cGAygnIZrSV3RculxMGBJvfXYjJJvprcwlTH-F7K9Eloq
 -xm3bV_LNN-FiTygw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjedvucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg
 uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf
 hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl
 ohhnrdhnvght
X-ME-Proxy: <xmx:8LtUYM0B2Xuv0IZhkIN_iTK4ogkQIvCVndv9DJjVeAdfWzszOeN8vw>
 <xmx:8LtUYDbfquPaCAAap2wE5EaK2tajnQLXbiWABFZ0x17nfylNzm_QyA>
 <xmx:8LtUYHqXEh0vqhqajk6wCG_20Lj7BTW3gKjmolHTkZ_qbCJxMEZ6sg>
 <xmx:8LtUYHtNM9nX3WY1-fiyAZXOVq6hzx39MXl-OmWEuGo73zOWE0G1FA>
Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 69C8324006E;
 Fri, 19 Mar 2021 10:57:51 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: ncopa@alpinelinux.org, stable@dpdk.org,
 Hemant Agrawal <hemant.agrawal@nxp.com>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
 David Marchand <david.marchand@redhat.com>,
 Sachin Saxena <sachin.saxena@oss.nxp.com>,
 Akhil Goyal <akhil.goyal@nxp.com>, Horia Geanta Neag <horia.geanta@nxp.com>
Date: Fri, 19 Mar 2021 15:57:20 +0100
Message-Id: <20210319145730.3555384-8-thomas@monjalon.net>
X-Mailer: git-send-email 2.30.1
In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net>
References: <20190313170657.16688-1-ncopa@alpinelinux.org>
 <20210319145730.3555384-1-thomas@monjalon.net>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v7 07/17] common/dpaax/caamflib: fix build with
 musl
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

From: Natanael Copa <ncopa@alpinelinux.org>

The swab16/swab32/swab64 are Linux specific and not GNU libc specific.
Keep the check for __GLIBC__ just in case other GNU systems depends on
this (Hurd or GNU/kFreeBSD).

This fixes a build error with musl libc.

Fixes: 04711d41a872 ("crypto/dpaa2_sec: add run-time assembler for descriptor")
Cc: stable@dpdk.org

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
---
 drivers/common/dpaax/caamflib/compat.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h
index 36ee4b5335..c1a693498d 100644
--- a/drivers/common/dpaax/caamflib/compat.h
+++ b/drivers/common/dpaax/caamflib/compat.h
@@ -11,7 +11,7 @@
 #include <stdint.h>
 #include <errno.h>
 
-#ifdef __GLIBC__
+#ifdef RTE_EXEC_ENV_LINUX
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -24,7 +24,7 @@
 #error "Undefined endianness"
 #endif
 
-#else
+#else /* !RTE_EXEC_ENV_LINUX */
 #error Environment not supported!
 #endif
 
@@ -40,7 +40,7 @@
 #define __maybe_unused __rte_unused
 #endif
 
-#if defined(__GLIBC__) && !defined(pr_debug)
+#if !defined(pr_debug)
 #if !defined(SUPPRESS_PRINTS) && defined(RTA_DEBUG)
 #define pr_debug(fmt, ...) \
 	RTE_LOG(DEBUG, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
@@ -49,7 +49,7 @@
 #endif
 #endif /* pr_debug */
 
-#if defined(__GLIBC__) && !defined(pr_err)
+#if !defined(pr_err)
 #if !defined(SUPPRESS_PRINTS)
 #define pr_err(fmt, ...) \
 	RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
@@ -58,7 +58,7 @@
 #endif
 #endif /* pr_err */
 
-#if defined(__GLIBC__) && !defined(pr_warn)
+#if !defined(pr_warn)
 #if !defined(SUPPRESS_PRINTS)
 #define pr_warn(fmt, ...) \
 	RTE_LOG(WARNING, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
@@ -101,7 +101,7 @@
 #endif
 
 /* Use Linux naming convention */
-#ifdef __GLIBC__
+#if defined(RTE_EXEC_ENV_LINUX) || defined(__GLIBC__)
 	#define swab16(x) rte_bswap16(x)
 	#define swab32(x) rte_bswap32(x)
 	#define swab64(x) rte_bswap64(x)
-- 
2.30.1