!585 [sync] PR-584: change dpdk-* in dpdk-tools from dynamic build to static build

From: @openeuler-sync-bot 
Reviewed-by: @jiangheng12 
Signed-off-by: @jiangheng12
This commit is contained in:
openeuler-ci-bot 2024-05-17 07:32:37 +00:00 committed by Gitee
commit 8007ffc41b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 50 additions and 7 deletions

View File

@ -0,0 +1,42 @@
From 2587ee2d2c1a7720282d1b290a511cacffad1075 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
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

View File

@ -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 <yinbin8@huawei.com> - 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 <huangdengui@huawei.com> - 23.11-17
Sync some patchs from upstreaming for hns3 pmd and modifications
are as follow: