From 6ef84139893ac1d056b0ad7a55e45bba0b15c01e Mon Sep 17 00:00:00 2001 From: yinbin6 Date: Mon, 13 May 2024 15:34:24 +0800 Subject: [PATCH] change dpdk-* in dpdk-tools from dynamic build to static build (cherry picked from commit e9485986a97b66670666ff44fa3bfdf6f006919e) --- 0043-remove-symbol-for-examples-and-app.patch | 42 +++++++++++++++++++ dpdk.spec | 15 +++---- 2 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 0043-remove-symbol-for-examples-and-app.patch diff --git a/0043-remove-symbol-for-examples-and-app.patch b/0043-remove-symbol-for-examples-and-app.patch new file mode 100644 index 0000000..e55640e --- /dev/null +++ b/0043-remove-symbol-for-examples-and-app.patch @@ -0,0 +1,42 @@ +From 2587ee2d2c1a7720282d1b290a511cacffad1075 Mon Sep 17 00:00:00 2001 +From: jiangheng +Date: Mon, 13 May 2024 15:24:06 +0800 +Subject: [PATCH] remove symbol for examples and app + +The examples and app use static build to link all pmd drivers by default. +In this way, you do not need to add -d parameter to specify dynamic library. +But the size of debuginfo is too large(2GB), therefore, remove app and examples symbols. + +--- + app/meson.build | 2 +- + examples/meson.build | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/app/meson.build b/app/meson.build +index e22bbb2..32eea18 100644 +--- a/app/meson.build ++++ b/app/meson.build +@@ -45,7 +45,7 @@ endif + default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API'] + default_cflags += ['-fPIE', '-pie', '-fPIC', '-fstack-protector-strong', '-D_FORTIFY_SOURCE=2', '-O2', '-Wall'] + default_cflags += ['-Wl,-z,relro,-z,now,-z,noexecstack', '-Wtrampolines'] +-default_ldflags = [] ++default_ldflags = ['-s'] + if get_option('default_library') == 'static' and not is_windows + default_ldflags += ['-Wl,--export-dynamic'] + endif +diff --git a/examples/meson.build b/examples/meson.build +index 51c975d..bfc7113 100644 +--- a/examples/meson.build ++++ b/examples/meson.build +@@ -86,6 +86,7 @@ default_ldflags = dpdk_extra_ldflags + if get_option('default_library') == 'static' and not is_windows + default_ldflags += ['-Wl,--export-dynamic'] + endif ++default_ldflags += ['-s'] + default_cflags += ['-fPIE', '-pie', '-fPIC', '-fstack-protector-strong', '-D_FORTIFY_SOURCE=2', '-O2', '-Wall'] + default_cflags += ['-Wl,-z,relro,-z,now,-z,noexecstack', '-Wtrampolines'] + +-- +2.27.0 + diff --git a/dpdk.spec b/dpdk.spec index 78a0070..74704f6 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -10,7 +10,7 @@ Name: dpdk Version: 23.11 -Release: 17 +Release: 18 URL: http://dpdk.org Source: https://fast.dpdk.org/rel/dpdk-%{version}.tar.xz @@ -66,6 +66,8 @@ Patch6040: 0040-net-hns3-fix-variable-overflow.patch Patch6041: 0041-net-hns3-disable-SCTP-verification-tag-for-RSS-hash-input.patch Patch6042: 0042-dma-hisilicon-remove-support-for-HIP09-platform.patch +Patch9037: 0043-remove-symbol-for-examples-and-app.patch + BuildRequires: meson BuildRequires: python3-pyelftools BuildRequires: diffutils @@ -178,12 +180,7 @@ CFLAGS="$(echo %{optflags} -fcommon)" \ -Ddrivers_install_subdir=dpdk-pmds \ -Denable_docs=false \ -Dmachine=generic \ - -Dexamples=l3fwd-power,ethtool,l3fwd,dma,ptpclient \ -%if %{with shared} - --default-library=shared -%else - --default-library=static -%endif + -Dexamples=l3fwd-power,ethtool,l3fwd,dma,ptpclient %meson_build @@ -266,6 +263,10 @@ strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/igb_uio.ko %endif %changelog +* Mon May 13 2024 yinbin - 23.11-18 +- change dpdk-* in dpdk-tools from dynamic build to static build +- add -s flag to remove symbols of dpdk-* in dpdk-tools + * Fri May 10 2024 huangdengdui - 23.11-17 Sync some patchs from upstreaming for hns3 pmd and modifications are as follow: -- Gitee