eal: fix build on armv7

Message ID 20200423142436.12810-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series eal: fix build on armv7 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/Intel-compilation fail apply issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/iol-testing success Testing PASS

Commit Message

David Marchand April 23, 2020, 2:24 p.m. UTC
  Caught by OBS on armv7:

In file included from .../lib/librte_eal/include/rte_string_fns.h:21,
                 from .../lib/librte_kvargs/rte_kvargs.c:9:
.../lib/librte_eal/include/rte_common.h:67:37: error: expected '=', ',',
 ';', 'asm' or '__attribute__' before '__rte_aligned'
   67 | typedef uint64_t unaligned_uint64_t __rte_aligned(1);
      |                                     ^~~~~~~~~~~~~
.../lib/librte_eal/include/rte_common.h:68:37: error: expected '=', ',',
 ';', 'asm' or '__attribute__' before '__rte_aligned'
   68 | typedef uint32_t unaligned_uint32_t __rte_aligned(1);
      |                                     ^~~~~~~~~~~~~
.../lib/librte_eal/include/rte_common.h:69:37: error: expected '=', ',',
 ';', 'asm' or '__attribute__' before '__rte_aligned'
   69 | typedef uint16_t unaligned_uint16_t __rte_aligned(1);
      |                                     ^~~~~~~~~~~~~
make[3]: *** [.../mk/internal/rte.compile-pre.mk:116: rte_kvargs.o] Error 1

Fixes: f35e5b3e07b2 ("replace alignment attributes")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/include/rte_common.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Thomas Monjalon April 23, 2020, 3:36 p.m. UTC | #1
23/04/2020 16:24, David Marchand:
> Caught by OBS on armv7:
> 
> In file included from .../lib/librte_eal/include/rte_string_fns.h:21,
>                  from .../lib/librte_kvargs/rte_kvargs.c:9:
> .../lib/librte_eal/include/rte_common.h:67:37: error: expected '=', ',',
>  ';', 'asm' or '__attribute__' before '__rte_aligned'
>    67 | typedef uint64_t unaligned_uint64_t __rte_aligned(1);
>       |                                     ^~~~~~~~~~~~~
> .../lib/librte_eal/include/rte_common.h:68:37: error: expected '=', ',',
>  ';', 'asm' or '__attribute__' before '__rte_aligned'
>    68 | typedef uint32_t unaligned_uint32_t __rte_aligned(1);
>       |                                     ^~~~~~~~~~~~~
> .../lib/librte_eal/include/rte_common.h:69:37: error: expected '=', ',',
>  ';', 'asm' or '__attribute__' before '__rte_aligned'
>    69 | typedef uint16_t unaligned_uint16_t __rte_aligned(1);
>       |                                     ^~~~~~~~~~~~~
> make[3]: *** [.../mk/internal/rte.compile-pre.mk:116: rte_kvargs.o] Error 1
> 
> Fixes: f35e5b3e07b2 ("replace alignment attributes")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

It deserves few words explanation about RTE_ARCH_STRICT_ALIGN.

Acked-by: Thomas Monjalon <thomas@monjalon.net>
  
David Marchand April 24, 2020, 5:35 p.m. UTC | #2
On Thu, Apr 23, 2020 at 4:25 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> Caught by OBS on armv7:
>
> In file included from .../lib/librte_eal/include/rte_string_fns.h:21,
>                  from .../lib/librte_kvargs/rte_kvargs.c:9:
> .../lib/librte_eal/include/rte_common.h:67:37: error: expected '=', ',',
>  ';', 'asm' or '__attribute__' before '__rte_aligned'
>    67 | typedef uint64_t unaligned_uint64_t __rte_aligned(1);
>       |                                     ^~~~~~~~~~~~~
> .../lib/librte_eal/include/rte_common.h:68:37: error: expected '=', ',',
>  ';', 'asm' or '__attribute__' before '__rte_aligned'
>    68 | typedef uint32_t unaligned_uint32_t __rte_aligned(1);
>       |                                     ^~~~~~~~~~~~~
> .../lib/librte_eal/include/rte_common.h:69:37: error: expected '=', ',',
>  ';', 'asm' or '__attribute__' before '__rte_aligned'
>    69 | typedef uint16_t unaligned_uint16_t __rte_aligned(1);
>       |                                     ^~~~~~~~~~~~~
> make[3]: *** [.../mk/internal/rte.compile-pre.mk:116: rte_kvargs.o] Error 1
>
> Fixes: f35e5b3e07b2 ("replace alignment attributes")
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>

Applied with mention of RTE_ARCH_STRICT_ALIGN in commitlog.
  

Patch

diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h
index 733447b736..668e8b0af8 100644
--- a/lib/librte_eal/include/rte_common.h
+++ b/lib/librte_eal/include/rte_common.h
@@ -63,6 +63,11 @@  extern "C" {
 		__GNUC_PATCHLEVEL__)
 #endif
 
+/**
+ * Force alignment
+ */
+#define __rte_aligned(a) __attribute__((__aligned__(a)))
+
 #ifdef RTE_ARCH_STRICT_ALIGN
 typedef uint64_t unaligned_uint64_t __rte_aligned(1);
 typedef uint32_t unaligned_uint32_t __rte_aligned(1);
@@ -73,11 +78,6 @@  typedef uint32_t unaligned_uint32_t;
 typedef uint16_t unaligned_uint16_t;
 #endif
 
-/**
- * Force alignment
- */
-#define __rte_aligned(a) __attribute__((__aligned__(a)))
-
 /**
  * Force a structure to be packed
  */