dpdk/0043-remove-symbol-for-examples-and-app.patch
yinbin6 be4cf3d28f change dpdk-* in dpdk-tools from dynamic build to static build
(cherry picked from commit e9485986a97b66670666ff44fa3bfdf6f006919e)
2024-05-17 11:04:32 +08:00

43 lines
1.6 KiB
Diff

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