summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2020-09-18 21:47:04 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-09-23 18:04:41 +0000
commit7a7601795171665eb71461c705f3fbb4b6c6f1ad (patch)
treed74d13eedbb93cea84e29f4e1bcb503d519fac29 /build
parent226e8e65bc378ac63af3c88bb51c0c79d5a075d1 (diff)
dpdk: prevent linking dpdk against libbsd
If libbsd is detected by the DPDK build system, DPDK does not provide implementations for strlcpy and dynamically link against the one provided by libbsd. When the DPDK plugin is loaded by VPP, a crash occurs because libbsd is not loaded by VPP. Type: fix Change-Id: Ib691bbe27edcf0f6f0a3d39952e439027cef72cb Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> (cherry picked from commit 1f799bc3cb7a3826395e544cafe587174393e2f0)
Diffstat (limited to 'build')
-rw-r--r--build/external/packages/dpdk.mk17
1 files changed, 16 insertions, 1 deletions
diff --git a/build/external/packages/dpdk.mk b/build/external/packages/dpdk.mk
index ef84383d55a..49761cd56a4 100644
--- a/build/external/packages/dpdk.mk
+++ b/build/external/packages/dpdk.mk
@@ -12,6 +12,7 @@
# limitations under the License.
DPDK_PKTMBUF_HEADROOM ?= 128
+DPDK_USE_LIBBSD ?= n
DPDK_DEBUG ?= n
DPDK_MLX4_PMD ?= n
DPDK_MLX5_PMD ?= n
@@ -118,6 +119,19 @@ echo '$(HASH)define RTE_$(1) $(DPDK_$(1))' \
fi
endef
+define dpdk_config_def
+if [[ "$(DPDK_$(1))" == "y" ]]; then \
+ if ! grep -q "RTE_$(1)" $(dpdk_build_dir)/rte_build_config.h \
+ $(dpdk_src_dir)/config/rte_config.h ; then \
+ echo '$(HASH)define RTE_$(1) 1' \
+ >> $(dpdk_build_dir)/rte_build_config.h ; \
+ fi; \
+elif [[ "$(DPDK_$(1))" == "n" ]]; then \
+ sed -i '/$(HASH)define RTE_$(1) .*/d' $(dpdk_build_dir)/rte_build_config.h \
+ $(dpdk_src_dir)/config/rte_config.h ; \
+fi
+endef
+
DPDK_MESON_ARGS = \
--default-library static \
--libdir lib \
@@ -143,7 +157,8 @@ define dpdk_config_cmds
deactivate && \
echo "DPDK post meson configuration" && \
echo "Altering rte_build_config.h" && \
- $(call dpdk_config,PKTMBUF_HEADROOM)
+ $(call dpdk_config,PKTMBUF_HEADROOM) && \
+ $(call dpdk_config_def,USE_LIBBSD)
endef
define dpdk_build_cmds