[v3,12/15] crypto/dpaa2_sec: build fix for musl libc

Message ID 20190313170657.16688-13-ncopa@alpinelinux.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Build fixes for musl libc |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Natanael Copa March 13, 2019, 5:06 p.m. UTC
  The swab16/swab32/swab64 are Linux specific and nog 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.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 drivers/crypto/dpaa2_sec/hw/compat.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Hemant Agrawal July 10, 2020, 5:11 a.m. UTC | #1
The location of the file has been changed from
drivers/crypto/dpaa2_sec/hw/compat.h
to:
drivers/common/dpaax/caamflib/compat.h

In next version you can add 

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>


-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Natanael Copa
Sent: Wednesday, March 13, 2019 10:37 PM
To: dev@dpdk.org
Cc: Natanael Copa <ncopa@alpinelinux.org>
Subject: [dpdk-dev] [PATCH v3 12/15] crypto/dpaa2_sec: build fix for musl libc

The swab16/swab32/swab64 are Linux specific and nog 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.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 drivers/crypto/dpaa2_sec/hw/compat.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/hw/compat.h b/drivers/crypto/dpaa2_sec/hw/compat.h
index ce946ccb5..1362045ca 100644
--- a/drivers/crypto/dpaa2_sec/hw/compat.h
+++ b/drivers/crypto/dpaa2_sec/hw/compat.h
@@ -11,7 +11,7 @@
 #include <stdint.h>
 #include <errno.h>
 
-#ifdef __GLIBC__
+#ifdef __linux__
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -40,7 +40,7 @@
 #define __maybe_unused __attribute__((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(__linux__) || defined(__GLIBC__)
 	#define swab16(x) rte_bswap16(x)
 	#define swab32(x) rte_bswap32(x)
 	#define swab64(x) rte_bswap64(x)
--
2.21.0
  

Patch

diff --git a/drivers/crypto/dpaa2_sec/hw/compat.h b/drivers/crypto/dpaa2_sec/hw/compat.h
index ce946ccb5..1362045ca 100644
--- a/drivers/crypto/dpaa2_sec/hw/compat.h
+++ b/drivers/crypto/dpaa2_sec/hw/compat.h
@@ -11,7 +11,7 @@ 
 #include <stdint.h>
 #include <errno.h>
 
-#ifdef __GLIBC__
+#ifdef __linux__
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -40,7 +40,7 @@ 
 #define __maybe_unused __attribute__((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(__linux__) || defined(__GLIBC__)
 	#define swab16(x) rte_bswap16(x)
 	#define swab32(x) rte_bswap32(x)
 	#define swab64(x) rte_bswap64(x)