With this patch, qemu requires keyboard-config when libxkbcommon is
found on the system. So if the qemu is configured when libxkbcommon is
installed but not keyboard-config, the configure stage will produce an
error message, thus avoid coredump in the build stage.
From e0b1e479e8a82f7a7940ca70b5136bf10e36756b Mon Sep 17 00:00:00 2001
From: Zhang Wen <zhw2101024@gmail.com>
Date: Fri, 26 Jan 2024 17:09:10 +0800
Subject: [PATCH] requires xkeyboard-config when libxkbcommon is available to
avoid build error
Signed-off-by: Zhang Wen <zhw2101024@gmail.com>
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index d0329966f1..233c006754 100644
--- a/meson.build
+++ b/meson.build
@@ -1093,6 +1093,7 @@ else
xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'),
method: 'pkg-config')
endif
+xkeyboard_config = dependency('xkeyboard-config')
slirp = not_found
if not get_option('slirp').auto() or have_system
@@ -3978,7 +3979,7 @@ subdir('qga')
if xkbcommon.found()
# used for the update-keymaps target, so include rules even if !have_tools
qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
- dependencies: [qemuutil, xkbcommon], install: have_tools)
+ dependencies: [qemuutil, xkbcommon, xkeyboard_config], install: have_tools)
endif
if have_tools
--
2.43.0
31.01.2024 11:13, Zhang Wen: > With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed > but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage. I'm not sure what you're talking about. What *is* keyboard-config anyway? On a debian system there's no such thing. There's keyboard-configuration package but it has nothing to do with that. It looks like if we apply such patch, it will be impossible to build qemu on debian. /mjt
01.02.2024 15:11, Michael Tokarev wrote: > 31.01.2024 11:13, Zhang Wen: >> With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed >> but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage. > > I'm not sure what you're talking about. What *is* keyboard-config anyway? > > On a debian system there's no such thing. There's keyboard-configuration > package but it has nothing to do with that. It looks like if we apply > such patch, it will be impossible to build qemu on debian. Aha, I found it. On debian it is /usr/share/pkgconfig/keyboard-config.pc, which is a part of xkb-data package. And libxkbcommon Depends on xkb-data. It looks like the distribution here is wrong, there should be no libxkbcommon without xkb-data which includes keyboard-config. /mjt
On Thu, 1 Feb 2024 at 12:50, Michael Tokarev <mjt@tls.msk.ru> wrote: > > 01.02.2024 15:11, Michael Tokarev wrote: > > 31.01.2024 11:13, Zhang Wen: > >> With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed > >> but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage. > > > > I'm not sure what you're talking about. What *is* keyboard-config anyway? > > > > On a debian system there's no such thing. There's keyboard-configuration > > package but it has nothing to do with that. It looks like if we apply > > such patch, it will be impossible to build qemu on debian. > > Aha, I found it. On debian it is /usr/share/pkgconfig/keyboard-config.pc, > which is a part of xkb-data package. And libxkbcommon Depends on xkb-data. > It looks like the distribution here is wrong, there should be no libxkbcommon > without xkb-data which includes keyboard-config. Are we talking about "keyboard-config" or "xkeyboard-config" here? The commit message says "keyboard-config" but the patch itself says "xkeyboard-config". Zhang: it would be helpful if you could tell us which distro you are building on where you see this problem. thanks -- PMM
Peter Maydell <peter.maydell@linaro.org> 于2024年2月1日周四 20:57写道: > > On Thu, 1 Feb 2024 at 12:50, Michael Tokarev <mjt@tls.msk.ru> wrote: > > > > 01.02.2024 15:11, Michael Tokarev wrote: > > > 31.01.2024 11:13, Zhang Wen: > > >> With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed > > >> but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage. > > > > > > I'm not sure what you're talking about. What *is* keyboard-config anyway? > > > > > > On a debian system there's no such thing. There's keyboard-configuration > > > package but it has nothing to do with that. It looks like if we apply > > > such patch, it will be impossible to build qemu on debian. > > > > Aha, I found it. On debian it is /usr/share/pkgconfig/keyboard-config.pc, > > which is a part of xkb-data package. And libxkbcommon Depends on xkb-data. > > It looks like the distribution here is wrong, there should be no libxkbcommon > > without xkb-data which includes keyboard-config. > > Are we talking about "keyboard-config" or "xkeyboard-config" here? > The commit message says "keyboard-config" but the patch itself > says "xkeyboard-config". > > Zhang: it would be helpful if you could tell us which distro > you are building on where you see this problem. > > thanks > -- PMM I'm so sorry for the misspelling in my initial post and the confusion caused by that. I'm building my own system following the Linux From Scratch package, which is at https://www.linuxfromscratch.org. I accidently built libxkbcommon package but not xkeyboard-config package, and then while building qemu I saw this problem. it's a little difficult to find the root cause from this error message, so I sent this patch to seek for help from upstream. -- Key fingerprint: 419F 72F3 F3A9 36EE 1B72 B00B C1C3 4BD4 FDA3 362F
On Tue, 6 Feb 2024 at 06:35, Zhang Wen <zhw2101024@gmail.com> wrote: > I'm building my own system following the Linux From Scratch package, which is at > https://www.linuxfromscratch.org. > I accidently built libxkbcommon package but not xkeyboard-config > package, and then > while building qemu I saw this problem. I found this interesting commit in FreeBSD: https://svnweb.freebsd.org/ports?view=revision&revision=490981 "Add a run time dependency on x11/xkeyboard-config in x11/libxkbcommon. While not strictly necessary, this is recommended upstream, since almost all uses of libxkbcommon also needs xkeyboard-config. This is similar to how it is done in other distributions. This solves issues when graphics/xpdf4 is installed without a desktop or graphical environment, as well as other places." That suggests that the intention of X11 upstream is that if a distro provides libxkbcommon then it should also provide xkeyboard-config, and if the distro doesn't do that then various things will not work correctly, not just QEMU. Looking at the Linux From Scratch website I see that their libxkbcommon page https://www.linuxfromscratch.org/blfs/view/svn/general/libxkbcommon.html says: # Required # xkeyboard-config-2.41 (runtime) So LFS agrees that xkeyboard-config is a required dependency. My inclination is therefore to say that "libxkbcommon is present but one of its required dependencies is missing" is not really a situation we need to change QEMU to handle. thanks -- PMM
06.02.2024 09:35, Zhang Wen: ... > I'm so sorry for the misspelling in my initial post and the confusion > caused by that. That's no problem, things happen. > I'm building my own system following the Linux From Scratch package, which is at > https://www.linuxfromscratch.org. > I accidently built libxkbcommon package but not xkeyboard-config > package, and then > while building qemu I saw this problem. it's a little difficult to > find the root cause from > this error message, so I sent this patch to seek for help from upstream. Okay, so it is mostly a self-built/self-installed linux. That works too. So how the problem manifests itself? What the actual error message is? You mentioned some segfault iirc, care to share some details? It's not a problem at all to pick this change up, but I'd love to know more details about this first :) Thanks, /mjt
> So how the problem manifests itself? What the actual error message is? > You mentioned some segfault iirc, care to share some details? I'm doing a rebuild, and will attach the error message and coredump file here in one or two days. -- Key fingerprint: 419F 72F3 F3A9 36EE 1B72 B00B C1C3 4BD4 FDA3 362F
Here's my error message and core file attached. -- Key fingerprint: 419F 72F3 F3A9 36EE 1B72 B00B C1C3 4BD4 FDA3 362F Generating pc-bios/keymaps/ar with a custom command FAILED: pc-bios/keymaps/ar /sources/qemu/qemu-8.2.0/build/qemu-keymap -f pc-bios/keymaps/ar -l ara xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb ninja: build stopped: subcommand failed. ELF >