telemetry: fix build for armv7

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot warning Travis build: failed
ci/Intel-compilation fail apply issues

Commit Message

David Marchand May 11, 2020, 1:32 p.m. UTC
  telemetry can not depend on EAL anymore but it still wants to get arch
headers.
We directly point at the right source directories by using the same logic
than EAL. However the special case of armv7 has been missed.

Fix this by defaulting ARCH_DIR to RTE_ARCH.

Caught on OBS:
[  162s]   SYMLINK-FILE include/rte_telemetry.h
[  162s]   CC telemetry.o
[  162s]   CC telemetry_data.o
[  162s]   CC telemetry_legacy.o
[  162s] .../lib/librte_telemetry/telemetry.c:15:10: fatal error:
 rte_spinlock.h: No such file or directory
[  162s]  #include <rte_spinlock.h>
[  162s]           ^~~~~~~~~~~~~~~~
[  162s] compilation terminated.

Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_telemetry/Makefile | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Bruce Richardson May 11, 2020, 1:47 p.m. UTC | #1
On Mon, May 11, 2020 at 03:32:12PM +0200, David Marchand wrote:
> telemetry can not depend on EAL anymore but it still wants to get arch
> headers.
> We directly point at the right source directories by using the same logic
> than EAL. However the special case of armv7 has been missed.
> 
No objection to the fix, but why is ARMv7 needing special treatment?
  
David Marchand May 11, 2020, 1:58 p.m. UTC | #2
On Mon, May 11, 2020 at 3:47 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Mon, May 11, 2020 at 03:32:12PM +0200, David Marchand wrote:
> > telemetry can not depend on EAL anymore but it still wants to get arch
> > headers.
> > We directly point at the right source directories by using the same logic
> > than EAL. However the special case of armv7 has been missed.
> >
> No objection to the fix, but why is ARMv7 needing special treatment?

For ARMv7, RTE_ARCH == ARCH_DIR so it is not set in mk/arch/* but a
default value is still set in EAL makefiles.
We could hide this in rte.vars.mk so that other components' makefiles
do not have to care about it but I went with the quicker fix.
  
Bruce Richardson May 11, 2020, 2:23 p.m. UTC | #3
On Mon, May 11, 2020 at 03:58:47PM +0200, David Marchand wrote:
> On Mon, May 11, 2020 at 3:47 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Mon, May 11, 2020 at 03:32:12PM +0200, David Marchand wrote:
> > > telemetry can not depend on EAL anymore but it still wants to get arch
> > > headers.
> > > We directly point at the right source directories by using the same logic
> > > than EAL. However the special case of armv7 has been missed.
> > >
> > No objection to the fix, but why is ARMv7 needing special treatment?
> 
> For ARMv7, RTE_ARCH == ARCH_DIR so it is not set in mk/arch/* but a
> default value is still set in EAL makefiles.
> We could hide this in rte.vars.mk so that other components' makefiles
> do not have to care about it but I went with the quicker fix.
> 
Thanks for the explanation.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
David Marchand May 11, 2020, 3:21 p.m. UTC | #4
On Mon, May 11, 2020 at 3:32 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> telemetry can not depend on EAL anymore but it still wants to get arch
> headers.
> We directly point at the right source directories by using the same logic
> than EAL. However the special case of armv7 has been missed.
>
> Fix this by defaulting ARCH_DIR to RTE_ARCH.
>
> Caught on OBS:
> [  162s]   SYMLINK-FILE include/rte_telemetry.h
> [  162s]   CC telemetry.o
> [  162s]   CC telemetry_data.o
> [  162s]   CC telemetry_legacy.o
> [  162s] .../lib/librte_telemetry/telemetry.c:15:10: fatal error:
>  rte_spinlock.h: No such file or directory
> [  162s]  #include <rte_spinlock.h>
> [  162s]           ^~~~~~~~~~~~~~~~
> [  162s] compilation terminated.
>
> Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied.
  

Patch

diff --git a/lib/librte_telemetry/Makefile b/lib/librte_telemetry/Makefile
index 29115ba792..c62cbd86dc 100644
--- a/lib/librte_telemetry/Makefile
+++ b/lib/librte_telemetry/Makefile
@@ -6,6 +6,8 @@  include $(RTE_SDK)/mk/rte.vars.mk
 # library name
 LIB = librte_telemetry.a
 
+ARCH_DIR ?= $(RTE_ARCH)
+
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
 CFLAGS += -I$(RTE_SDK)/lib/librte_metrics/