Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:master commit in: net-libs/dpdk/, net-libs/dpdk/files/
Date: Thu, 30 Dec 2021 14:34:39
Message-Id: 1640716597.87e78614530996f51240fb976347ae75b3d26917.flow@gentoo
1 commit: 87e78614530996f51240fb976347ae75b3d26917
2 Author: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
3 AuthorDate: Tue Dec 28 18:36:37 2021 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 28 18:36:37 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=87e78614
7
8 net-libs/dpdk: add static linker patch
9
10 closes: https://bugs.gentoo.org/830145
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>
13
14 net-libs/dpdk/dpdk-21.11.ebuild | 5 ++-
15 net-libs/dpdk/files/dpdk-21.11-static_linker.patch | 45 ++++++++++++++++++++++
16 2 files changed, 49 insertions(+), 1 deletion(-)
17
18 diff --git a/net-libs/dpdk/dpdk-21.11.ebuild b/net-libs/dpdk/dpdk-21.11.ebuild
19 index 97b9e66ff..c2affead6 100644
20 --- a/net-libs/dpdk/dpdk-21.11.ebuild
21 +++ b/net-libs/dpdk/dpdk-21.11.ebuild
22 @@ -4,7 +4,7 @@
23 EAPI=7
24
25 PYTHON_COMPAT=( python3_{8..10} )
26 -inherit python-single-r1 meson
27 +inherit toolchain-funcs python-single-r1 meson
28
29 DESCRIPTION="Data Plane Development Kit libraries for fast userspace networking"
30 HOMEPAGE="https://dpdk.org/"
31 @@ -44,12 +44,15 @@ BDEPEND="
32 dev-lang/nasm
33 "
34
35 +PATCHES=( "${FILESDIR}/dpdk-21.11-static_linker.patch" )
36 +
37 src_configure() {
38 python-single-r1_pkg_setup
39 local emesonargs=(
40 -Denable_kmods=false
41 -Dmachine=default
42 -Dplatform=generic
43 + -Dstatic_linker=$(tc-getAR)
44 $(meson_use test tests)
45 )
46 meson_src_configure
47
48 diff --git a/net-libs/dpdk/files/dpdk-21.11-static_linker.patch b/net-libs/dpdk/files/dpdk-21.11-static_linker.patch
49 new file mode 100644
50 index 000000000..5e0a8e9e7
51 --- /dev/null
52 +++ b/net-libs/dpdk/files/dpdk-21.11-static_linker.patch
53 @@ -0,0 +1,45 @@
54 +allow setting static linker
55 +
56 +diff --git a/buildtools/meson.build b/buildtools/meson.build
57 +index 22ea0ba..1da02ad 100644--- a/buildtools/meson.build
58 ++++ b/buildtools/meson.build
59 +@@ -24,14 +24,19 @@ binutils_avx512_check = (py3 + files('binutils-avx512-check.py') +
60 + # select library and object file format
61 + pmdinfo = py3 + files('gen-pmdinfo-cfile.py') + [meson.current_build_dir()]
62 + pmdinfogen = py3 + files('pmdinfogen.py')
63 ++ar = ''
64 ++if cc.get_id() == 'gcc' or host_machine.system() != 'windows'
65 ++ ar = 'ar'
66 ++else
67 ++ ar = 'llvm-ar'
68 ++endif
69 ++if get_option('static_linker') != ''
70 ++ ar = get_option('static_linker')
71 ++endif
72 + if host_machine.system() == 'windows'
73 +- if cc.get_id() == 'gcc'
74 +- pmdinfo += 'ar'
75 +- else
76 +- pmdinfo += 'llvm-ar'
77 +- endif
78 ++ pmdinfo += ar
79 + pmdinfogen += 'coff'
80 + else
81 +- pmdinfo += 'ar'
82 ++ pmdinfo += ar
83 + pmdinfogen += 'elf'
84 + endif
85 +
86 +diff --git a/meson_options.txt b/meson_options.txt
87 +index 7c220ad..c5c09b4 100644
88 +--- a/meson_options.txt
89 ++++ b/meson_options.txt
90 +@@ -26,6 +26,8 @@ option('flexran_sdk', type: 'string', value: '', description:
91 + 'Path to FlexRAN SDK optional Libraries for BBDEV device')
92 + option('ibverbs_link', type: 'combo', choices : ['static', 'shared', 'dlopen'], value: 'shared', description:
93 + 'Linkage method (static/shared/dlopen) for Mellanox PMDs with ibverbs dependencies.')
94 ++option('static_linker', type: 'string', value: '', description:
95 ++ 'Linker to use for creating static libraries.')
96 + option('include_subdir_arch', type: 'string', value: '', description:
97 + 'subdirectory where to install arch-dependent headers')
98 + option('kernel_dir', type: 'string', value: '', description: