Skip to contentSkip to conversation

bus/dpaa: fix build

PATCH In review Thomas Monjalon 2 participants 3 messages Jun 20, 2018 – Jun 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus/dpaa: fix build

The DPAA bus driver is defining some macros without prefix. So it can conflict with other libraries like libbsd:

drivers/bus/dpaa/include/compat.h:53:
error: "__packed" redefined
/usr/include/bsd/sys/cdefs.h:120:
note: this is the location of the previous definition

Fixes 39f373cf015a ("bus/dpaa: add compatibility and helper macros")
---
 drivers/bus/dpaa/include/compat.h | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/bus/dpaa/include/compat.h +6 -0
index e4b570214..92241d231 100644
@@ -48,9 +48,15 @@
  */
 
 /* Required compiler attributes */
+#ifndef __maybe_unused
 #define __maybe_unused	__rte_unused
+#endif
+#ifndef __always_unused
 #define __always_unused	__rte_unused
+#endif
+#ifndef __packed
 #define __packed	__rte_packed
+#endif
 #define noinline	__attribute__((noinline))
 
 #define L1_CACHE_BYTES 64
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 30 lines · Thomas Monjalon

The DPAA bus driver is defining some macros without prefix. So it can conflict with other libraries like libbsd:

drivers/bus/dpaa/include/compat.h:53:
error: "__packed" redefined
/usr/include/bsd/sys/cdefs.h:120:
note: this is the location of the previous definition

Fixes 39f373cf015a ("bus/dpaa: add compatibility and helper macros")
---
  drivers/bus/dpaa/include/compat.h | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/bus/dpaa/include/compat.h +1 -0
index e4b570214..92241d231 100644
@@ -48,9 +48,15 @@
   */
 
  /* Required compiler attributes */
+#ifndef __maybe_unused
  #define __maybe_unused	__rte_unused

drivers/bus/dpaa/include/compat.h line 62

Quoted 10 lines
drivers/bus/dpaa/include/compat.h +5 -0
+#endif
+#ifndef __always_unused
  #define __always_unused	__rte_unused
+#endif
+#ifndef __packed
  #define __packed	__rte_packed
+#endif
  #define noinline	__attribute__((noinline))
 
  #define L1_CACHE_BYTES 64

A similar patch was also issued by Jerin a few weeks back:
http://patches.dpdk.org/patch/40597/

There may be conflict while merging.

Whether you take that, or this (preferred):

#2 lore raw

21/06/2018 09:58, Shreyansh Jain:

Quoted 39 lines · Thomas Monjalon
Quoted 38 lines

The DPAA bus driver is defining some macros without prefix. So it can conflict with other libraries like libbsd:

drivers/bus/dpaa/include/compat.h:53:
error: "__packed" redefined
/usr/include/bsd/sys/cdefs.h:120:
note: this is the location of the previous definition

Fixes 39f373cf015a ("bus/dpaa: add compatibility and helper macros")
---
  drivers/bus/dpaa/include/compat.h | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/bus/dpaa/include/compat.h +6 -0
index e4b570214..92241d231 100644
@@ -48,9 +48,15 @@
   */
 
  /* Required compiler attributes */
+#ifndef __maybe_unused
  #define __maybe_unused	__rte_unused
+#endif
+#ifndef __always_unused
  #define __always_unused	__rte_unused
+#endif
+#ifndef __packed
  #define __packed	__rte_packed
+#endif
  #define noinline	__attribute__((noinline))
 
Quoted 5 lines

drivers/bus/dpaa/include/compat.h line 62

Quoted 2 lines
drivers/bus/dpaa/include/compat.h +0 -0
  #define L1_CACHE_BYTES 64

A similar patch was also issued by Jerin a few weeks back:
http://patches.dpdk.org/patch/40597/

I missed it.

Quoted 5 lines

There may be conflict while merging.

Whether you take that, or this (preferred):

This one is more complete.
Applied