Skip to contentSkip to conversation

package/libcap-ng: add host variant

PATCH New Romain Naour 2 participants 5 messages May 2, 2020 – May 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/libcap-ng: add host variant

Qemu 5.0.0 recently switched to libcap-ng [1].
Add the host variant for host-qemu package.

[1] https://git.qemu.org/?p=qemu.git;a=commit;h=7e46261368d129c5ee8be927f5bcadc7ecd800d7

---
 package/libcap-ng/libcap-ng.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libcap-ng/libcap-ng.mk +4 -0
index 0f29ef0972..102b472d1a 100644
@@ -15,4 +15,8 @@ LIBCAP_NG_AUTORECONF = YES
 LIBCAP_NG_CONF_ENV = ac_cv_prog_swig_found=no
 LIBCAP_NG_CONF_OPTS = --without-python
 
+HOST_LIBCAP_NG_CONF_ENV = ac_cv_prog_swig_found=no
+HOST_LIBCAP_NG_CONF_OPTS = --without-python
+
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.25.4
#1 lore raw

PATCH 2/2 package/qemu: bump to 5.0.0

Remove upstream patches [1][2].

Switch to libcap-ng for virtio support [3].

Remove bluez option [4].

Disable container build [5] since we don't want to use containers for cross-building.

Disable io_uring [6] since there is no such package in Buildroot (yet).

The ARM Cortex-m7 cpu is now supported [7] a defconfig can be added in follup patch.

[1] https://git.qemu.org/?p=qemu.git;a=commit;h=00b5032eaddb7193f03f0a28b10286244d2e2a7b
[2] https://git.qemu.org/?p=qemu.git;a=commit;h=21bf9b06cb6d07c6cc437dfd47b47b28c2bb79db
[3] https://git.qemu.org/?p=qemu.git;a=commit;h=7e46261368d129c5ee8be927f5bcadc7ecd800d7
[4] https://git.qemu.org/?p=qemu.git;a=commit;h=1d4ffe8dc77cbc9aafe8bcf514ca0e43f85aaae3
[5] https://git.qemu.org/?p=qemu.git;a=commit;h=afc3a8f9f1df09c091f9903eaef82b35c152cacf
[6] https://git.qemu.org/?p=qemu.git;a=commit;h=c10dd8565defdb14695580c9369b20f4544e65a2
[7] https://git.qemu.org/?p=qemu.git;a=commit;h=cf7beda5072e106ddce875c1996446540c5fe239

See:
https://wiki.qemu.org/ChangeLog/5.0
https://www.qemu.org/2020/04/29/qemu-5-0-0/

---
While working on the version bump, I noticed a problem with the csky
host-qemu: http://lists.busybox.net/pipermail/buildroot/2020-May/281885.html

---
 ...fix-crash-when-compiling-with-uClibc.patch | 43 ----------
 ...emi-fix-SYS_OPEN-to-return-nonzero-f.patch | 78 -------------------
 ...age-of-mcontext-structure-on-ARM-uCl.patch | 10 +--
 package/qemu/qemu.hash                        |  2 +-
 package/qemu/qemu.mk                          | 14 ++--
 5 files changed, 15 insertions(+), 132 deletions(-)
 delete mode 100644 package/qemu/4.2.0/0002-util-cacheinfo-fix-crash-when-compiling-with-uClibc.patch
 delete mode 100644 package/qemu/4.2.0/0003-target-arm-arm-semi-fix-SYS_OPEN-to-return-nonzero-f.patch
 rename package/qemu/{4.2.0 => 5.0.0}/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch (85%)
package/qemu/4.2.0/0002-util-cacheinfo-fix-crash-when-compiling-with-uClibc.patch deleted +0 -43
deleted file mode 100644
index d1b9e35709..0000000000
@@ -1,43 +0,0 @@
-From d82b8540ecaf3cb09a033e4971d8645d3343211e Mon Sep 17 00:00:00 2001
-From: Carlos Santos <[email protected]>
-Date: Wed, 16 Oct 2019 22:27:30 -0300
-Subject: [PATCH] util/cacheinfo: fix crash when compiling with uClibc
-
-uClibc defines _SC_LEVEL1_ICACHE_LINESIZE and _SC_LEVEL1_DCACHE_LINESIZE
-but the corresponding sysconf calls returns -1, which is a valid result,
-meaning that the limit is indeterminate.
-
-Handle this situation using the fallback values instead of crashing due
-to an assertion failure.
-
-Signed-off-by: Carlos Santos <[email protected]>
----
- util/cacheinfo.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/util/cacheinfo.c b/util/cacheinfo.c
-index ea6f3e99bf..d94dc6adc8 100644
---- a/util/cacheinfo.c
-+++ b/util/cacheinfo.c
-@@ -93,10 +93,16 @@ static void sys_cache_info(int *isize, int *dsize)
- static void sys_cache_info(int *isize, int *dsize)
- {
- # ifdef _SC_LEVEL1_ICACHE_LINESIZE
--    *isize = sysconf(_SC_LEVEL1_ICACHE_LINESIZE);
-+    int tmp_isize = (int) sysconf(_SC_LEVEL1_ICACHE_LINESIZE);
-+    if (tmp_isize > 0) {
-+        *isize = tmp_isize;
-+    }
- # endif
- # ifdef _SC_LEVEL1_DCACHE_LINESIZE
--    *dsize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
-+    int tmp_dsize = (int) sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
-+    if (tmp_dsize > 0) {
-+        *dsize = tmp_dsize;
-+    }
- # endif
- }
- #endif /* sys_cache_info */
--- 
-2.18.1
-
package/qemu/4.2.0/0003-target-arm-arm-semi-fix-SYS_OPEN-to-return-nonzero-f.patch deleted +0 -78

78 lines not on this page · raw message

package/qemu/5.0.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch renamed from package/qemu/4.2.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch +5 -5
similarity index 85%
rename from package/qemu/4.2.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
rename to package/qemu/5.0.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
index 157d28b112..548ec3e765 100644
@@ -1,4 +1,4 @@
-From d3f1e7e9ff9aae3f770b0bcb9aa3c2f787f76a1b Mon Sep 17 00:00:00 2001
+From 923d25365fbdff17fa4c8c2883960be07c3dad56 Mon Sep 17 00:00:00 2001
 From: Thomas Petazzoni <[email protected]>
 Date: Fri, 5 May 2017 09:07:15 +0200
 Subject: [PATCH] user-exec: fix usage of mcontext structure on ARM/uClibc
@@ -14,14 +14,14 @@ uClibc.
 
 Signed-off-by: Thomas Petazzoni <[email protected]>
 ---
- user-exec.c | 2 +-
+ accel/tcg/user-exec.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
-index 6db0758..2b3d116 100644
+index 4be78eb9b3..0a690bec55 100644
 --- a/accel/tcg/user-exec.c
 +++ b/accel/tcg/user-exec.c
-@@ -506,7 +506,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+@@ -508,7 +508,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
  
  #if defined(__NetBSD__)
      pc = uc->uc_mcontext.__gregs[_REG_R15];
@@ -31,5 +31,5 @@ index 6db0758..2b3d116 100644
  #else
      pc = uc->uc_mcontext.arm_pc;
 -- 
-2.7.4
+2.25.3
 
package/qemu/qemu.hash +1 -1
index dae11cb3fe..6dd9aba4b2 100644
@@ -1,5 +1,5 @@
 # Locally computed, tarball verified with GPG signature
-sha256 d3481d4108ce211a053ef15be69af1bdd9dde1510fda80d92be0f6c3e98768f0  qemu-4.2.0.tar.xz
+sha256 2f13a92a0fa5c8b69ff0796b59b86b080bbb92ebad5d301a7724dd06b5e78cb6  qemu-5.0.0.tar.xz
 sha256 6f04ae8364d0079a192b14635f4b1da294ce18724c034c39a6a41d1b09df6100  COPYING
 sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  COPYING.LIB
 
package/qemu/qemu.mk +9 -5
index e8b43d3b36..e6fb001ee8 100644
@@ -8,7 +8,7 @@ ifeq ($(BR2_csky),y)
 QEMU_VERSION = b517e1dc3125a57555d67a8deed9eac7b42288e2
 QEMU_SITE = $(call github,c-sky,qemu,$(QEMU_VERSION))
 else
-QEMU_VERSION = 4.2.0
+QEMU_VERSION = 5.0.0
 QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.xz
 QEMU_SITE = http://download.qemu.org
 endif
@@ -136,15 +136,16 @@ define QEMU_CONFIGURE_CMDS
 			--enable-attr \
 			--enable-vhost-net \
 			--disable-bsd-user \
+			--disable-containers \
 			--disable-xen \
 			--disable-vnc \
 			--disable-virtfs \
 			--disable-brlapi \
 			--disable-curses \
 			--disable-curl \
-			--disable-bluez \
 			--disable-vde \
 			--disable-linux-aio \
+			--disable-linux-io-uring \
 			--disable-cap-ng \
 			--disable-docs \
 			--disable-spice \
@@ -276,11 +277,12 @@ HOST_QEMU_OPTS += --enable-vde
 HOST_QEMU_DEPENDENCIES += host-vde2
 endif
 
+# virtfs-proxy-helper is the only user of libcap-ng.
 ifeq ($(BR2_PACKAGE_HOST_QEMU_VIRTFS),y)
-HOST_QEMU_OPTS += --enable-virtfs
-HOST_QEMU_DEPENDENCIES += host-libcap
+HOST_QEMU_OPTS += --enable-virtfs --enable-cap-ng
+HOST_QEMU_DEPENDENCIES += host-libcap-ng
 else
-HOST_QEMU_OPTS += --disable-virtfs
+HOST_QEMU_OPTS += --disable-virtfs --disable-cap-ng
 endif
 
 ifeq ($(BR2_PACKAGE_HOST_QEMU_USB),y)
@@ -305,7 +307,9 @@ define HOST_QEMU_CONFIGURE_CMDS
 		--extra-ldflags="$(HOST_LDFLAGS)" \
 		--python=$(HOST_DIR)/bin/python3 \
 		--disable-bzip2 \
+		--disable-containers \
 		--disable-libssh \
+		--disable-linux-io-uring \
 		--disable-sdl \
 		--disable-vnc-jpeg \
 		--disable-vnc-png \
Signature · 1 line
2.25.4
#2 lore raw

PATCH 2/2 package/qemu: bump to 5.0.0

Hello,

package/qemu/qemu.mk HOST_QEMU_OPTS += --enable-vde · line 283

Quoted 6 lines · On Sat, 2 May 2020 15:52:05 +0200 Romain Naour <[email protected]> wrote:
package/qemu/qemu.mk +3 -2
+# virtfs-proxy-helper is the only user of libcap-ng.
 ifeq ($(BR2_PACKAGE_HOST_QEMU_VIRTFS),y)
-HOST_QEMU_OPTS += --enable-virtfs
-HOST_QEMU_DEPENDENCIES += host-libcap
+HOST_QEMU_OPTS += --enable-virtfs --enable-cap-ng
+HOST_QEMU_DEPENDENCIES += host-libcap-ng

We don't have any host-libcap-ng package, we only have the target variant for libcap-ng, so I don't think this can build.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 2/2 package/qemu: bump to 5.0.0

Quoted 2 lines · On Sat, 2 May 2020 16:10:31 +0200 Thomas Petazzoni…

We don't have any host-libcap-ng package, we only have the target variant for libcap-ng, so I don't think this can build.

Of course, scratch that. When a patch series has two patches, I should read the first patch of the series before the second patch.

Sorry for the noise :-/

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/2 package/libcap-ng: add host variant

In reply to Romain Naour
Quoted 9 lines · On Sat, 2 May 2020 15:52:04 +0200 Romain Naour <[email protected]> wrote:

Qemu 5.0.0 recently switched to libcap-ng [1].
Add the host variant for host-qemu package.

[1] https://git.qemu.org/?p=qemu.git;a=commit;h=7e46261368d129c5ee8be927f5bcadc7ecd800d7

---
 package/libcap-ng/libcap-ng.mk | 4 ++++
 1 file changed, 4 insertions(+)

Both patches applied to next. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com