fix for qemu_mode where capstone 4.0+ is installed
MODIFY
docs/Changelog.md
docs/Changelog.md
@@ -10,8 +10,9 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
### Version ++2.62d (developt):
-
- - ... your patch? :-)
+ - qemu_mode now uses solely the internal capstone version to fix builds
+ on modern Linux distributions
+ - more tools get environment variable usage info in the help output
### Version ++2.62c (release):

MODIFY
qemu_mode/build_qemu_support.sh
qemu_mode/build_qemu_support.sh
@@ -177,7 +177,7 @@ if [ "$STATIC" = "1" ]; then
--disable-sdl --disable-seccomp --disable-smartcard --disable-snappy --disable-spice --disable-libssh2 \
--disable-libusb --disable-usb-redir --disable-vde --disable-vhost-net --disable-virglrenderer \
--disable-virtfs --disable-vnc --disable-vte --disable-xen --disable-xen-pci-passthrough --disable-xfsctl \
- --enable-linux-user --disable-system --disable-blobs --disable-tools \
+ --enable-linux-user --disable-system --disable-blobs --disable-tools --enable-capstone=internal \
--target-list="${CPU_TARGET}-linux-user" --static --disable-pie --cross-prefix=$CROSS_PREFIX || exit 1
else
@@ -186,7 +186,7 @@ else
# improvement, much to my surprise. Not sure how universal this is..
./configure --disable-system \
- --enable-linux-user --disable-gtk --disable-sdl --disable-vnc \
+ --enable-linux-user --disable-gtk --disable-sdl --disable-vnc --enable-capstone=internal \
--target-list="${CPU_TARGET}-linux-user" --enable-pie $CROSS_PREFIX || exit 1
fi

MODIFY
qemu_mode/patches/configure.diff
qemu_mode/patches/configure.diff
-diff --git a/configure b/configure
-index 1c9f609..3edc9a7 100755
---- a/configure
-+++ b/configure
-@@ -4603,6 +4603,21 @@ if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
- libs_softmmu="-lutil $libs_softmmu"
+--- a/configure 2019-08-02 18:04:50.000000000 +0200
++++ b/configure 2020-02-28 06:31:30.424895061 +0100
+@@ -1479,6 +1479,8 @@
+ ;;
+ --enable-capstone=system) capstone="system"
+ ;;
++ --enable-capstone=internal) capstone="internal"
++ ;;
+ --with-git=*) git="$optarg"
+ ;;
+ --enable-git-update) git_update=yes
+@@ -4604,6 +4606,21 @@
fi
-+##########################################
+ ##########################################
+cat > $TMPC << EOF
+#include <dlfcn.h>
+#include <stdlib.h>
@@ -21,6 +27,7 @@ index 1c9f609..3edc9a7 100755
+ error_exit "libdl check failed"
+fi
+
- ##########################################
++##########################################
# spice probe
if test "$spice" != "no" ; then
+ cat > $TMPC << EOF

fix for qemu_mode where capstone 4.0+ is installed