1 |
commit: 41a325ea429a98833868c9370f5ee2c7af540477 |
2 |
Author: John Helmert III <ajak <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 11 03:46:10 2021 +0000 |
4 |
Commit: John Helmert III <ajak <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 11 03:47:42 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41a325ea |
7 |
|
8 |
app-emulation/qemu: fix build failure when libbpf is present |
9 |
|
10 |
Closes: https://bugs.gentoo.org/814458 |
11 |
Signed-off-by: John Helmert III <ajak <AT> gentoo.org> |
12 |
|
13 |
.../qemu/files/qemu-6.1.0-automagic-libbpf.patch | 21 +++++++++++++++++++++ |
14 |
app-emulation/qemu/metadata.xml | 1 + |
15 |
app-emulation/qemu/qemu-6.1.0.ebuild | 5 ++++- |
16 |
3 files changed, 26 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/app-emulation/qemu/files/qemu-6.1.0-automagic-libbpf.patch b/app-emulation/qemu/files/qemu-6.1.0-automagic-libbpf.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..d067650dc8f |
21 |
--- /dev/null |
22 |
+++ b/app-emulation/qemu/files/qemu-6.1.0-automagic-libbpf.patch |
23 |
@@ -0,0 +1,21 @@ |
24 |
+commit 080832e4f4801a28bd1170c49e61f6a0f5f05d03 |
25 |
+Author: Paolo Bonzini <pbonzini@××××××.com> |
26 |
+Date: Tue Sep 7 12:45:12 2021 +0200 |
27 |
+ |
28 |
+ ebpf: only include in system emulators |
29 |
+ |
30 |
+ eBPF files are being included in user emulators, which is useless and |
31 |
+ also breaks compilation because ebpf/trace-events is only processed |
32 |
+ if a system emulator is included in the build. |
33 |
+ |
34 |
+ Resolves: https://gitlab.com/qemu-project/qemu/-/issues/566 |
35 |
+ Signed-off-by: Paolo Bonzini <pbonzini@××××××.com> |
36 |
+ Signed-off-by: Jason Wang <jasowang@××××××.com> |
37 |
+ |
38 |
+diff --git a/ebpf/meson.build b/ebpf/meson.build |
39 |
+index 9cd0635370..2dd0fd8948 100644 |
40 |
+--- a/ebpf/meson.build |
41 |
++++ b/ebpf/meson.build |
42 |
+@@ -1 +1 @@ |
43 |
+-common_ss.add(when: libbpf, if_true: files('ebpf_rss.c'), if_false: files('ebpf_rss-stub.c')) |
44 |
++softmmu_ss.add(when: libbpf, if_true: files('ebpf_rss.c'), if_false: files('ebpf_rss-stub.c')) |
45 |
|
46 |
diff --git a/app-emulation/qemu/metadata.xml b/app-emulation/qemu/metadata.xml |
47 |
index 6cc5daac8dc..094f223846c 100644 |
48 |
--- a/app-emulation/qemu/metadata.xml |
49 |
+++ b/app-emulation/qemu/metadata.xml |
50 |
@@ -17,6 +17,7 @@ |
51 |
<flag name="accessibility">Adds support for braille displays using brltty</flag> |
52 |
<flag name="aio">Enables support for Linux's Async IO</flag> |
53 |
<flag name="alsa">Enable alsa output for sound emulation</flag> |
54 |
+ <flag name="bpf">Enable eBPF support for RSS implementation.</flag> |
55 |
<flag name="capstone">Enable disassembly support with <pkg>dev-libs/capstone</pkg></flag> |
56 |
<flag name="curl">Support ISOs / -cdrom directives via HTTP or HTTPS.</flag> |
57 |
<flag name="fdt">Enables firmware device tree support</flag> |
58 |
|
59 |
diff --git a/app-emulation/qemu/qemu-6.1.0.ebuild b/app-emulation/qemu/qemu-6.1.0.ebuild |
60 |
index 8365c047729..15cd2a1d294 100644 |
61 |
--- a/app-emulation/qemu/qemu-6.1.0.ebuild |
62 |
+++ b/app-emulation/qemu/qemu-6.1.0.ebuild |
63 |
@@ -32,7 +32,7 @@ HOMEPAGE="https://www.qemu.org https://www.linux-kvm.org" |
64 |
LICENSE="GPL-2 LGPL-2 BSD-2" |
65 |
SLOT="0" |
66 |
|
67 |
-IUSE="accessibility +aio alsa bzip2 capstone +caps +curl debug +doc |
68 |
+IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc |
69 |
+fdt fuse glusterfs gnutls gtk infiniband iscsi io-uring |
70 |
jack jemalloc +jpeg kernel_linux |
71 |
kernel_FreeBSD lzo multipath |
72 |
@@ -142,6 +142,7 @@ SOFTMMU_TOOLS_DEPEND=" |
73 |
) |
74 |
aio? ( dev-libs/libaio[static-libs(+)] ) |
75 |
alsa? ( >=media-libs/alsa-lib-1.0.13 ) |
76 |
+ bpf? ( dev-libs/libbpf:= ) |
77 |
bzip2? ( app-arch/bzip2[static-libs(+)] ) |
78 |
capstone? ( dev-libs/capstone:= ) |
79 |
caps? ( sys-libs/libcap-ng[static-libs(+)] ) |
80 |
@@ -276,6 +277,7 @@ PATCHES=( |
81 |
"${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch |
82 |
"${FILESDIR}"/${PN}-6.0.0-make.patch |
83 |
"${FILESDIR}"/${PN}-6.1.0-strings.patch |
84 |
+ "${FILESDIR}"/${P}-automagic-libbpf.patch |
85 |
) |
86 |
|
87 |
QA_PREBUILT=" |
88 |
@@ -501,6 +503,7 @@ qemu_src_configure() { |
89 |
conf_opts+=( |
90 |
$(conf_notuser accessibility brlapi) |
91 |
$(conf_notuser aio linux-aio) |
92 |
+ $(conf_softmmu bpf) |
93 |
$(conf_notuser bzip2) |
94 |
$(conf_notuser capstone) |
95 |
$(conf_notuser caps cap-ng) |