commit: 87e78614530996f51240fb976347ae75b3d26917 Author: Aisha Tammy <gentoo <AT> aisha <DOT> cc> AuthorDate: Tue Dec 28 18:36:37 2021 +0000 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org> CommitDate: Tue Dec 28 18:36:37 2021 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=87e78614
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 <AT> aisha.cc> net-libs/dpdk/dpdk-21.11.ebuild | 5 ++- net-libs/dpdk/files/dpdk-21.11-static_linker.patch | 45 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/net-libs/dpdk/dpdk-21.11.ebuild b/net-libs/dpdk/dpdk-21.11.ebuild index 97b9e66ff..c2affead6 100644 --- a/net-libs/dpdk/dpdk-21.11.ebuild +++ b/net-libs/dpdk/dpdk-21.11.ebuild @@ -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 diff --git a/net-libs/dpdk/files/dpdk-21.11-static_linker.patch b/net-libs/dpdk/files/dpdk-21.11-static_linker.patch new file mode 100644 index 000000000..5e0a8e9e7 --- /dev/null +++ b/net-libs/dpdk/files/dpdk-21.11-static_linker.patch @@ -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:
