Skip to contentSkip to conversation

fix test of some build options

PATCH Applied Thomas Monjalon 2 participants 7 messages Feb 12, 2019 – Feb 24, 2019

lore
Share & tools
lore
#0 lore raw

cover fix test of some build options

When using the "make" system which allows a huge number of build combinations, some options were not tested with the script test-build.sh.

Thomas Monjalon (4):
mk: fix build of shared library with libbsd
devtools: add libelf dependency to build test
devtools: test build of zlib PMD
devtools: fix test of some build options

 devtools/test-build.sh           | 12 +++++++++---
 mk/exec-env/linuxapp/rte.vars.mk |  6 ++++++
 mk/rte.app.mk                    |  3 ---
 mk/rte.lib.mk                    |  2 ++
 4 files changed, 17 insertions(+), 6 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/4 mk: fix build of shared library with libbsd

When building DPDK with "make" and options
CONFIG_RTE_USE_LIBBSD=y
and
CONFIG_RTE_BUILD_SHARED_LIB=y
libbsd was not linked, resulting in compilation errors:
undefined reference to `strlcpy'

The link option -lbsd is added in a common place for both Linux apps and libs.
It is used in app linkage via EXECENV_LDLIBS,
and in lib linkage via the added variable EXECENV_LDLIBS-y.

Fixes 5364de644a4b ("eal: support strlcpy function")
---
 mk/exec-env/linuxapp/rte.vars.mk | 6 ++++++
 mk/rte.app.mk                    | 3 ---
 mk/rte.lib.mk                    | 2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)
mk/exec-env/linuxapp/rte.vars.mk +6 -0
index 3129edc8c..57ee82150 100644
@@ -24,6 +24,8 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
 EXECENV_LDLIBS += -lgcc_s
 endif
 
+EXECENV_LDLIBS-$(CONFIG_RTE_USE_LIBBSD) += -lbsd
+
 # force applications to link with gcc/icc instead of using ld
 LINK_USING_CC := 1
 
@@ -32,4 +34,8 @@ EXECENV_LDFLAGS += -export-dynamic
 # Add library to the group to resolve symbols
 EXECENV_LDLIBS  += -ldl
 
+# EXECENV_LDLIBS-y applies to lib.so and app linking
+# while EXECENV_LDLIBS applies only to app linking.
+EXECENV_LDLIBS += $(EXECENV_LDLIBS-y)
+
 export EXECENV_CFLAGS EXECENV_LDFLAGS EXECENV_ASFLAGS EXECENV_LDLIBS
mk/rte.app.mk +0 -3
index 8a4f0f4e5..d0ab942d5 100644
@@ -309,9 +309,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL)            += -lrt
 ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP)$(CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES),yy)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL)            += -lnuma
 endif
-ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP)$(CONFIG_RTE_USE_LIBBSD),yy)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL)            += -lbsd
-endif
 _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lm
 _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lrt
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MEMBER)         += -lm
mk/rte.lib.mk +2 -0
index c696a2174..4df8849a0 100644
@@ -35,6 +35,8 @@ PREINSTALL = $(SYMLINK-FILES-y)
 _INSTALL = $(INSTALL-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
 _CLEAN = doclean
 
+LDLIBS += $(EXECENV_LDLIBS-y)
+
 .PHONY: all
 all: install
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/4 devtools: add libelf dependency to build test

In reply to Thomas Monjalon

The option CONFIG_RTE_LIBRTE_BPF_ELF was never enabled with test-build.sh.
It is fixed with the environment variable DPDK_DEP_ELF.

Fixes 5dba93ae5f2d ("bpf: add ability to load eBPF program from ELF object file")
---
 devtools/test-build.sh | 4 ++++
 1 file changed, 4 insertions(+)
devtools/test-build.sh +4 -0
index 42f4ad003..ace52a776 100755
@@ -9,6 +9,7 @@ default_path=$PATH
 # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
 # - DPDK_DEP_ARCHIVE
 # - DPDK_DEP_CFLAGS
+# - DPDK_DEP_ELF (y/[n])
 # - DPDK_DEP_ISAL (y/[n])
 # - DPDK_DEP_JSON (y/[n])
 # - DPDK_DEP_LDFLAGS
@@ -96,6 +97,7 @@ reset_env ()
 	unset CROSS
 	unset DPDK_DEP_ARCHIVE
 	unset DPDK_DEP_CFLAGS
+	unset DPDK_DEP_ELF
 	unset DPDK_DEP_ISAL
 	unset DPDK_DEP_JSON
 	unset DPDK_DEP_LDFLAGS
@@ -186,6 +188,8 @@ config () # <directory> <target> <options>
 		sed -ri          's,(MVPP2_PMD=)n,\1y,' $1/.config
 		test -z "$LIBMUSDK_PATH" || \
 		sed -ri         's,(MVNETA_PMD=)n,\1y,' $1/.config
+		test "$DPDK_DEP_ELF" != y || \
+		sed -ri            's,(BPF_ELF=)n,\1y,' $1/.config
 		test -z "$DPDK_DEP_JSON" || \
 		sed -ri          's,(TELEMETRY=)n,\1y,' $1/.config
 		build_config_hook $1 $2 $3
Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/4 devtools: test build of zlib PMD

In reply to Thomas Monjalon

The PMD zlib was not enabled in devtools/test-build.sh. It is fixed by using the environment variable DPDK_DEP_ZLIB.

Fixes 0c4e4c16b004 ("compress/zlib: introduce zlib PMD")
---
 devtools/test-build.sh | 2 ++
 1 file changed, 2 insertions(+)
devtools/test-build.sh +2 -0
index ace52a776..0511ae6d0 100755
@@ -158,6 +158,8 @@ config () # <directory> <target> <options>
 		test "$DPDK_DEP_ZLIB" != y || \
 		sed -ri          's,(BNX2X_PMD=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ZLIB" != y || \
+		sed -ri           's,(PMD_ZLIB=)n,\1y,' $1/.config
+		test "$DPDK_DEP_ZLIB" != y || \
 		sed -ri   's,(COMPRESSDEV_TEST=)n,\1y,' $1/.config
 		test "$DPDK_DEP_PCAP" != y || \
 		sed -ri               's,(PCAP=)n,\1y,' $1/.config
Signature · 1 line
2.20.1
#4 lore raw

PATCH 4/4 devtools: fix test of some build options

In reply to Thomas Monjalon

CONFIG_RTE_LIBRTE_PMD_ISAL was not tested because of a typo.

CONFIG_RTE_LIBRTE_PMD_QAT_SYM was not tested since it has been introduced and made CONFIG_RTE_LIBRTE_PMD_QAT enabled by default.

While at it, DPDK_DEP_JSON is now checked for "y", as other DPDK_DEP_* variables, instead of non-empty.

Fixes 3c32e89f68e1 ("compress/isal: add skeleton ISA-L compression PMD")
Fixes 7a34c2155716 ("compress/qat: add empty driver")
---
 devtools/test-build.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
devtools/test-build.sh +3 -3
index 0511ae6d0..d37b121ca 100755
@@ -150,7 +150,7 @@ config () # <directory> <target> <options>
 		test "$DPDK_DEP_ARCHIVE" != y || \
 		sed -ri       's,(RESOURCE_TAR=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ISAL" != y || \
-		sed -ri           's,(ISAL_PMD=)n,\1y,' $1/.config
+		sed -ri           's,(PMD_ISAL=)n,\1y,' $1/.config
 		test "$DPDK_DEP_MLX" != y || \
 		sed -ri           's,(MLX._PMD=)n,\1y,' $1/.config
 		test "$DPDK_DEP_SZE" != y || \
@@ -180,7 +180,7 @@ config () # <directory> <target> <options>
 		test "$DPDK_DEP_SSL" != y || \
 		sed -ri        's,(PMD_OPENSSL=)n,\1y,' $1/.config
 		test "$DPDK_DEP_SSL" != y || \
-		sed -ri            's,(PMD_QAT=)n,\1y,' $1/.config
+		sed -ri            's,(QAT_SYM=)n,\1y,' $1/.config
 		test -z "$FLEXRAN_SDK" || \
 		sed -ri     's,(BBDEV_TURBO_SW=)n,\1y,' $1/.config
 		sed -ri           's,(SCHED_.*=)n,\1y,' $1/.config
@@ -192,7 +192,7 @@ config () # <directory> <target> <options>
 		sed -ri         's,(MVNETA_PMD=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ELF" != y || \
 		sed -ri            's,(BPF_ELF=)n,\1y,' $1/.config
-		test -z "$DPDK_DEP_JSON" || \
+		test "$DPDK_DEP_JSON" != y || \
 		sed -ri          's,(TELEMETRY=)n,\1y,' $1/.config
 		build_config_hook $1 $2 $3
 
Signature · 1 line
2.20.1
Acked-by on v1 4/4
#5 lore raw

Re: [PATCH 4/4] devtools: fix test of some build options

Quoted 17 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Tuesday, February 12, 2019 11:05 PM
Cc: [email protected]; Daly, Lee <[email protected]>; Trahe, Fiona <[email protected]>; [email protected]
Subject: [PATCH 4/4] devtools: fix test of some build options

CONFIG_RTE_LIBRTE_PMD_ISAL was not tested because of a typo.

CONFIG_RTE_LIBRTE_PMD_QAT_SYM was not tested since it has been introduced and made CONFIG_RTE_LIBRTE_PMD_QAT enabled by default.

While at it, DPDK_DEP_JSON is now checked for "y", as other DPDK_DEP_* variables, instead of non-empty.

Quoted 7 lines
Fixes 3c32e89f68e1 ("compress/isal: add skeleton ISA-L compression PMD")
Fixes 7a34c2155716 ("compress/qat: add empty driver")
author Applied
#6 lore raw
In reply to Thomas Monjalon

13/02/2019 00:05, Thomas Monjalon:

Quoted 10 lines

When using the "make" system which allows a huge number of build combinations, some options were not tested with the script test-build.sh.

Thomas Monjalon (4):
mk: fix build of shared library with libbsd
devtools: add libelf dependency to build test
devtools: test build of zlib PMD
devtools: fix test of some build options

Applied