[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Failed to compile on Ubuntu 26.04 (qemu vs. glibc)



This is what I did for the 26.04 tpm_emulator build (what you suggested anyway):

diff --git a/stubdom/Makefile b/stubdom/Makefile
index a058cc10d5b..8dfab72cf0e 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -248,7 +248,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): 
tpm_emulator-$(TPMEMU_VERSION).tar.gz
        patch -d $@ -p1 < vtpm-tpm_bn_t-addr.patch
        patch -d $@ -p1 < vtpm-6448b979702683de2f846073978271e5e38b4fea.patch
        mkdir $@/build
-       cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 
-DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS)"
+       cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 
-DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" 
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
        touch $@
 
 TPMEMU_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libtpm.a

I also had to bump the OVMF tag to edk2-stable202511 and apply 
9af06ef3cbb052b142f9660c2c01e7aeb401300c.

Regards,
James

On Tue, Jun 30, 2026 at 01:13:27PM +0200, Jan Kellermann wrote:
> Hi,
> 
> this is the final file list for compiling on my machine on Ubuntu 26.04 with
> the error message:
> 
> tools/qemu-xen-dir-remote/util/log.c
> tools/qemu-xen-dir-remote/util/qemu-sockets.c
> tools/qemu-xen-dir-remote/subprojects/dtc/libfdt/fdt_overlay.c
> tools/qemu-xen-dir-remote/gdbstub/gdbstub.c
> tools/qemu-xen-dir-remote/block/vmdk.c
> tools/qemu-xen-dir-remote/block/vvfat.c:
> tools/qemu-xen-dir-remote/ui/ui-hmp-cmds.c
> tools/qemu-xen-dir-remote/backends/tpm/tpm_passthrough.c
> tools/qemu-xen-dir-remote/monitor/hmp.c
> tools/qemu-xen-dir-remote/hw/i386/x86-common.c
> tools/qemu-xen-dir-remote/tests/vhost-user-bridge.c
> 
> These 2 MRs are relevant (but not for all files):
> 
> https://gitlab.com/qemu-project/qemu/-/commit/bf0e7b068b7d156eb2009776c9b90afdf93abb2f
> 
> https://gitlab.com/qemu-project/qemu/-/commit/7154e4df40468012fccb6687ecd2b288c56a4a2d
> 
> And we met these problems on tpm_emulator-x86_64/build:
> 
> CMake Warning (dev) at CMakeLists.txt:6 (project):
>   cmake_minimum_required() should be called prior to this top-level
> project() call.  Please see the cmake-commands(7) manual for usage
> documentation of both commands.
> This warning is for project developers.  Use -Wno-dev to suppress it.
> 
> 
> CMake Error at CMakeLists.txt:8 (cmake_minimum_required):
>   Compatibility with CMake < 3.5 has been removed from CMake.
> Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
> to tell CMake that the project requires at least <min> but has been updated
> to work with policies introduced by <max> or earlier.
> Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
> 
> 
> Maybe someone can help.
> 
> Best regards,
> Kelly.
> 
> 
> Am 30.06.2026 um 10:16 schrieb Jan Kellermann:
> > Dear colleagues,
> > 
> > I would like to install Xen 3.22 (or 3.21) on Ubuntu. But the
> > compilation of qemu fails with this error message:
> > 
> > initialisation discards ‘const’ qualifier from pointer target type
> > 
> > 
> > This affects the definition of variables for strstr(), because since
> > glibc 2.42.9000 the return type of strstr() and other string functions
> > changed to be 'const char *' when the input is a 'const char *'.
> > 
> > Ubuntu 26.04 uses a patched version based on QEMU 10.2.1 (https://
> > packages.ubuntu.com/resolute/qemu-system-x86-xen)
> > 
> > I am in the process of replacing the missing ‘const’ declarations, but I
> > wonder whether a backport might be simpler.
> > 
> > See e.g. this commit:
> > https://gitlab.com/qemu-project/qemu/-/
> > commit/326e620fc0145686124f754194cdc6d0d9b3400d
> > 
> > These commits are only available since V10.2.0
> > 
> > See also here:
> > https://git.redxen.eu/RepoMirrors/qemu/
> > commit/326e620fc0145686124f754194cdc6d0d9b3400d
> > 
> > These files are failing with this error so far, I am still in pathcing
> > progress:
> > 
> > tools/qemu-xen-dir-remote/util/log.c
> > tools/qemu-xen-dir-remote/util/qemu-sockets.c
> > tools/qemu-xen-dir-remote/subprojects/dtc/libfdt/fdt_overlay.c
> > tools/qemu-xen-dir-remote/gdbstub/gdbstub.c
> > tools/qemu-xen-dir-remote/block/vmdk.c
> > tools/qemu-xen-dir-remote/block/vvfat.c:
> > tools/qemu-xen-dir-remote/ui/ui-hmp-cmds.c
> > tools/qemu-xen-dir-remote/backends/tpm/tpm_passthrough.c
> > 
> > Best regards,
> > Kelly.
> 
> -- 
> Pronomen: er/ihm | pronoun: he/him
> 
> werk21 GmbH
> Online-Lösungen für Zivilgesellschaft, Politik und Verwaltung
> 
> Oranienburger Straße 87/89, 10178 Berlin
> Tel: (030) 28 48 48 30
> https://www.werk21.de
> 
> Geschäftsführer*innen:
> Jan Kellermann, Johannes Stahl, Susanne Fritsche
> HRB 131204 - Berlin-Charlottenburg - Sitz: Berlin
> 
> 

-- 
------------------------------------------------------------------------
James Dingwall
e: james@xxxxxxxxxxxxxx
w: http://www.dingwall.me.uk/
------------------------------------------------------------------------



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.