net-libs/dpdk: add static linker patch

closes: https://bugs.gentoo.org/830145
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Aisha Tammy <gentoo@aisha.cc>
This commit is contained in:
Aisha Tammy
2021-12-28 18:36:37 +00:00
parent 58492a40c1
commit 87e7861453
2 changed files with 49 additions and 1 deletions

View File

@@ -4,7 +4,7 @@
EAPI=7
PYTHON_COMPAT=( python3_{8..10} )
inherit python-single-r1 meson
inherit toolchain-funcs python-single-r1 meson
DESCRIPTION="Data Plane Development Kit libraries for fast userspace networking"
HOMEPAGE="https://dpdk.org/"
@@ -44,12 +44,15 @@ BDEPEND="
dev-lang/nasm
"
PATCHES=( "${FILESDIR}/dpdk-21.11-static_linker.patch" )
src_configure() {
python-single-r1_pkg_setup
local emesonargs=(
-Denable_kmods=false
-Dmachine=default
-Dplatform=generic
-Dstatic_linker=$(tc-getAR)
$(meson_use test tests)
)
meson_src_configure

View File

@@ -0,0 +1,45 @@
allow setting static linker
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 22ea0ba..1da02ad 100644--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -24,14 +24,19 @@ binutils_avx512_check = (py3 + files('binutils-avx512-check.py') +
# select library and object file format
pmdinfo = py3 + files('gen-pmdinfo-cfile.py') + [meson.current_build_dir()]
pmdinfogen = py3 + files('pmdinfogen.py')
+ar = ''
+if cc.get_id() == 'gcc' or host_machine.system() != 'windows'
+ ar = 'ar'
+else
+ ar = 'llvm-ar'
+endif
+if get_option('static_linker') != ''
+ ar = get_option('static_linker')
+endif
if host_machine.system() == 'windows'
- if cc.get_id() == 'gcc'
- pmdinfo += 'ar'
- else
- pmdinfo += 'llvm-ar'
- endif
+ pmdinfo += ar
pmdinfogen += 'coff'
else
- pmdinfo += 'ar'
+ pmdinfo += ar
pmdinfogen += 'elf'
endif
diff --git a/meson_options.txt b/meson_options.txt
index 7c220ad..c5c09b4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,6 +26,8 @@ option('flexran_sdk', type: 'string', value: '', description:
'Path to FlexRAN SDK optional Libraries for BBDEV device')
option('ibverbs_link', type: 'combo', choices : ['static', 'shared', 'dlopen'], value: 'shared', description:
'Linkage method (static/shared/dlopen) for Mellanox PMDs with ibverbs dependencies.')
+option('static_linker', type: 'string', value: '', description:
+ 'Linker to use for creating static libraries.')
option('include_subdir_arch', type: 'string', value: '', description:
'subdirectory where to install arch-dependent headers')
option('kernel_dir', type: 'string', value: '', description: