On 16/05/2022 21.14, Richard Henderson wrote:
On 5/16/22 09:53, Peter Maydell wrote:
https://lists.gnu.org/archive/html/qemu-devel/2020-09/msg07542.html
Is that this one?
https://lore.kernel.org/qemu-devel/87wo0no0wz....@linaro.org/
Could well be.
Did we find out why Ubuntu's capstone in particular fell over ?
I vaguely recall that it was a snapshot of a capstone prior to the 4.0
release. The error message you quote above is because CAPSTONE_API is not
defined to something reasonable. I don't have an ubuntu 18 system to
quickly look at.
I just had a try with our Ubuntu 18.04 docker container (as it has not been
removed yet) and my patches applied:
$ make docker-test-build@ubuntu1804 \
EXTRA_CONFIGURE_OPTS=--enable-capstone
...
Dependencies
...
capstone : YES 3.0.4
...
[1023/3301] Compiling C object libcommon.fa.p/disas_capstone.c.o
FAILED: libcommon.fa.p/disas_capstone.c.o
cc -m64 -mcx16 -Ilibcommon.fa.p -I../src/common-user/host/x86_64
-I../src/dtc/libfdt -I../src/slirp -I../src/slirp/src -I/usr/include/capstone
-I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/spice-server
-I/usr/include/spice-1 -I/usr/include/p11-kit-1 -I/usr/include/libusb-1.0
-I/usr/include/SDL2 -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gio-unix-2.0/
-I/usr/include/alsa -I/usr/include/virgl -I/usr/include/ncursesw
-I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo
-I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0
-I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0
-I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include
-I/usr/include/vte-2.91 -fdiagnostics-color=auto -Wall -Winvalid-pch -Werror
-std=gnu11 -O2 -g -isystem /tmp/qemu-test/src/linux-headers -isystem
linux-headers -iquote . -iquote /tmp/qemu-test/src -iquote
/tmp/qemu-test/src/include -iquote /tmp/qemu-test/src/disas/libvixl -iquote
/tmp/qemu-test/src/tcg/i386 -pthread -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes
-fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration
-Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self
-Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels
-Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs
-Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIE
-D_GNU_SOURCE -D_DEFAULT_SOURCE -DNCURSES_WIDECHAR=1 -D_REENTRANT -Wno-undef
-DSTRUCT_IOVEC_DEFINED -MD -MQ libcommon.fa.p/disas_capstone.c.o -MF
libcommon.fa.p/disas_capstone.c.o.d -o libcommon.fa.p/disas_capstone.c.o -c
../src/disas/capstone.c
../src/disas/capstone.c:25:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘cap_skipdata_s390x_cb’
cap_skipdata_s390x_cb(const uint8_t *code, size_t code_size,
^~~~~~~~~~~~~~~~~~~~~
../src/disas/capstone.c:49:17: error: ‘cap_skipdata_s390x_cb’ undeclared here
(not in a function); did you mean ‘cap_skipdata_s390x’?
.callback = cap_skipdata_s390x_cb
^~~~~~~~~~~~~~~~~~~~~
cap_skipdata_s390x
ninja: build stopped: subcommand failed.
Makefile:163: recipe for target 'run-ninja' failed
So it seems like really only the capstone 3.0.4 from Ubuntu 18.04 is broken,
while this compiles fine with the capstone 3.0.5 from Ubuntu 20.04.
I think my patches should be ok to apply now that we dropped support
for Ubuntu 18.04.
Thomas