qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] some remarks to build last version of qemu in M


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] some remarks to build last version of qemu in MSYS2 (from user)
Date: Sat, 7 Mar 2020 19:47:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

Hi Youry,

On 6/20/19 2:38 AM, Метлицкий Юрий wrote:
Hello!

Today I tried to build qemu from git in the current version of MSYS2 for 
Windows 10 (X64).
As a result, got the file qemu-setup-4.0.50.exe
But on the way to this I met several problems that I want to share.

Sorry to be newbie and write in bad english. And so...

After resolving all packages dependencies, I execute the commands:

$ ./configure --enable-gtk --enable-sdl --enable-vnc-sasl 
--enable-capstone=system --enable-docs
----------------------------------------------------------------------------------------------------------
Install prefix    c:/Program Files/QEMU
BIOS directory    c:/Program Files/QEMU
firmware path     c:/Program Files/QEMU/share/qemu-firmware
binary directory  c:/Program Files/QEMU
library directory c:/Program Files/QEMU/lib
module directory  c:/Program Files/QEMU/lib
libexec directory c:/Program Files/QEMU/libexec
include directory c:/Program Files/QEMU/include
config directory  c:/Program Files/QEMU
local state directory   queried at runtime
Windows SDK       no
Source path       /home/my/qemu
GIT binary        git
GIT submodules    ui/keycodemapdb tests/fp/berkeley-testfloat-3 
tests/fp/berkeley-softfloat-3 dtc slirp
C compiler        cc
Host C compiler   cc
C++ compiler      c++
Objective-C compiler cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g
QEMU_CFLAGS       -IC:/msys64/mingw64/include/pixman-1 -I$(SRC_PATH)/dtc/libfdt 
-Werror -DHAS_LIBSSH2_SFTP_FSYNC -IC:/msys64/mingw64/include -pthread 
-mms-bitfields -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/glib-2.0 
-IC:/msys64/mingw64/lib/glib-2.0/include -IC:/msys64/mingw64/include -m64 
-mcx16 -mthreads -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings 
-Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -std=gnu99  
-Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value 
-Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security 
-Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration 
-Wold-style-definition -Wtype-limits -fstack-protector-strong 
-IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/p11-kit-1 
-IC:/msys64/mingw64/include   -IC:/msys64/mingw64/include/libpng16 
-IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/capstone
LDFLAGS           -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase 
-Wl,--warn-common -m64 -g
QEMU_LDFLAGS      -L$(BUILD_DIR)/dtc/libfdt
make              make
install           install
python            python3 -B (3.7.3)
slirp support     git
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       aarch64-softmmu alpha-softmmu arm-softmmu cris-softmmu 
hppa-softmmu i386-softmmu lm32-softmmu m68k-softmmu microblazeel-softmmu 
microblaze-softmmu mips64el-softmmu mips64-softmmu mipsel-softmmu mips-softmmu 
moxie-softmmu nios2-softmmu or1k-softmmu ppc64-softmmu ppc-softmmu 
riscv32-softmmu riscv64-softmmu s390x-softmmu sh4eb-softmmu sh4-softmmu 
sparc64-softmmu sparc-softmmu tricore-softmmu unicore32-softmmu x86_64-softmmu 
xtensaeb-softmmu xtensa-softmmu
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
SDL support       yes (2.0.9)
SDL image support no
GTK support       yes (3.24.8)
GTK GL support    no
VTE support       no
TLS priority      NORMAL
GNUTLS support    yes
libgcrypt         no
nettle            yes (3.4.1)
libtasn1          yes
PAM               no
iconv support     yes
curses support    no
virgl support     no
curl support      yes
mingw32 support   yes
Audio drivers     dsound
Block whitelist (rw)
Block whitelist (ro)
VirtFS support    no
Multipath support no
VNC support       yes
VNC SASL support  yes
VNC JPEG support  yes
VNC PNG support   yes
xen support       no
brlapi support    no
bluez  support    no
Documentation     yes
PIE               no
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support no
Install blobs     yes
KVM support       no
HAX support       yes
HVF support       no
WHPX support      no
TCG support       yes
TCG debug enabled no
TCG interpreter   no
malloc trim support no
RDMA support      no
PVRDMA support    no
fdt support       git
membarrier        no
preadv support    no
fdatasync         no
madvise           no
posix_madvise     no
posix_memalign    no
libcap-ng support no
vhost-net support
vhost-crypto support no
vhost-scsi support no
vhost-vsock support no
vhost-user support no
Trace backends    log
spice support     no
rbd support       no
xfsctl support    no
smartcard support no
libusb            yes
usb net redir     yes
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no
build guest agent yes
QGA VSS support   no
QGA w32 disk info yes
QGA MSI support   no
seccomp support   no
coroutine backend win32
coroutine pool    yes
debug stack usage no
mutex debugging   no
crypto afalg      no
GlusterFS support no
gcov              gcov
gcov enabled      no
TPM support       no
libssh2 support   yes
QOM debugging     yes
Live block migration yes
lzo support       yes
snappy support    yes
bzip2 support     yes
lzfse support     no
NUMA host support no
libxml2           yes
tcmalloc support  no
jemalloc support  no
avx2 optimization yes
replication support yes
VxHS block device no
bochs support     yes
cloop support     yes
dmg support       yes
qcow v1 support   yes
vdi support       yes
vvfat support     yes
qed support       yes
parallels support yes
sheepdog support  yes
capstone          system
docker            no
libpmem support   no
libudev           no
default devices   yes

NOTE: cross-compilers enabled:  'cc'
----------------------------------------------------------------------------------------------------------
$ make installer

Problem 1: if I do not use the --enable-capstone=system option, the build is 
aborted

$make -C /home/my/qemu/capstone CAPSTONE_SHARED=no BUILDDIR="/home/my/qemu/capstone" CC="cc" AR="ar" 
LD="ld" RANLIB="ranlib" CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g -IC:/msys64/mingw64/include/pixman-1 
-I/home/my/qemu/dtc/libfdt -DHAS_LIBSSH2_SFTP_FSYNC -IC:/msys64/mingw64/include -pthread -mms-bitfields -IC:/msys64/mingw64/include 
-IC:/msys64/mingw64/include/glib-2.0 -IC:/msys64/mingw64/lib/glib-2.0/include -IC:/msys64/mingw64/include -m64 -mcx16 -mthreads 
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -std=gnu99 -fstack-protector-strong 
-IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/p11-kit-1 -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/libpng16 
-IC:/msys64/mingw64/include -I/home/my/qemu/capstone/include -I/home/my/qemu/tests -DCAPSTONE_USE_SYS_DYN_MEM -DCAPSTONE_HAS_ARM 
-DCAPSTONE_HAS_ARM64 -DCAPSTONE_HAS_POWERPC -DCAPSTONE_HAS_X86"  BUILD_DIR=/home/my/qemu /home/my/qemu/capstone/capstone.lib

make: Entering directory '/home/my/qemu/capstone'
make: *** No rule to make target '/home/my/qemu/capstone/capstone.lib'.  Stop.
make: Leaving directory '/home/my/qemu/capstone'

I found this solution:
$ cd capstone
$ make CROSS=x86_64-w64-mingw32- capstone.lib
   ...
   AR      capstone.lib
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/../../../../x86_64-w64-mingw32/bin/ar.exe:
 creating ./capstone.lib
$ cd ..

Problem 2: I wanted to use the --enable-vnc-sasl option, but the build stopped 
due to a conflict of iovec structure definitions in files 
/mingw64/x86_64-w64-mingw32/include/sasl.h and include/qemu/osdep.h
I made simple patches:

diff -Nurp cyrus-sasl-2.1.27-old/include/sasl.h cyrus-sasl-2.1.27/include/sasl.h
--- cyrus-sasl-old/include/sasl.h       2019-06-19 17:05:06.334050200 +0300
+++ cyrus-sasl/include/sasl.h   2019-06-19 17:08:22.115365400 +0300
@@ -189,8 +189,8 @@
  #ifndef STRUCT_IOVEC_DEFINED
  #define STRUCT_IOVEC_DEFINED 1
  struct iovec {
-    long iov_len;
-    char *iov_base;
+    void *iov_base;
+    size_t iov_len;
  };
  #endif
  #else

diff -Nurp qemu-old/include/qemu/osdep.h qemu/include/qemu/osdep.h
--- qemu-old/include/qemu/osdep.h       2019-06-19 18:10:22.808111000 +0300
+++ qemu/include/qemu/osdep.h   2019-06-19 18:12:54.223226500 +0300
@@ -483,10 +483,18 @@ bool qemu_write_pidfile(const char *pidf
  int qemu_get_thread_id(void);

  #ifndef CONFIG_IOVEC
+
+#ifdef _WIN32
+#ifndef STRUCT_IOVEC_DEFINED
+#define STRUCT_IOVEC_DEFINED 1

There is a different fix for this issue here:
https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg01767.html

  struct iovec {
      void *iov_base;
      size_t iov_len;
  };
+#endif
+#else
+struct iovec;                               /* Defined in OS headers */
+#endif
  /*
   * Use the same value as Linux for now.
   */

Problem 3: when generating the html build stopped with

Warning, treated as error:
C:/msys64/home/my/qemu/docs/interop/bitmaps.rst:202:Could not lex literal_block as 
"json". Highlighting skipped.

Here I simply remove the -W option

$ sphinx-build -v -T -n -b html -D version=4.0.50 -D release="4.0.50 
(v4.0.0-1396-gf3d0bec9f8-dirty)" -d .doctrees/interop /home/my/qemu/docs/interop 
docs/built/interop
...
C:/msys64/home/my/qemu/docs/interop/bitmaps.rst:1437: WARNING: Could not lex 
literal_block as "json". Highlighting skipped.
generating indices... genindex
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 27 warnings.

Problem 4: When installing files into a temporary directory, copying breaked
I made a patch by deleting the "/".

--- Makefile-orig       2019-06-16 23:23:49.352281900 +0300
+++ Makefile    2019-06-16 23:31:44.344762800 +0300
@@ -873,19 +873,19 @@ ifneq ($(DESCS),)
         done
  endif
         for s in $(ICON_SIZES); do \
-               mkdir -p "$(DESTDIR)/$(qemu_icondir)/hicolor/$${s}/apps"; \
+               mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
                 $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
-                       
"$(DESTDIR)/$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \
+                       
"$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \
         done; \
-       mkdir -p "$(DESTDIR)/$(qemu_icondir)/hicolor/32x32/apps"; \
+       mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps"; \
         $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \
-               "$(DESTDIR)/$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \
-       mkdir -p "$(DESTDIR)/$(qemu_icondir)/hicolor/scalable/apps"; \
+               "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \
+       mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps"; \
         $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \
-               "$(DESTDIR)/$(qemu_icondir)/hicolor/scalable/apps/qemu.svg"
-       mkdir -p "$(DESTDIR)/$(qemu_desktopdir)"
+               "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps/qemu.svg"
+       mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
         $(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
-               "$(DESTDIR)/$(qemu_desktopdir)/qemu.desktop"
+               "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
  ifdef CONFIG_GTK
         $(MAKE) -C po $@
  endif

Problem 5: No bmp files
...
File: "C:/msys64/tmp/qemu-nsis\*.bmp" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
    /oname=outfile one_file_only)
Error in script "C:/msys64/home/my/qemu/qemu.nsi" on line 122 -- aborting 
creation process
make: *** [Makefile:1073: qemu-setup-4.0.50.exe] Error 1

Simple hack:

--- qemu.nsi-orig       2019-06-17 00:33:33.148978300 +0300
+++ qemu.nsi    2019-06-20 02:57:19.030516900 +0300
@@ -119,7 +119,7 @@ Section "${PRODUCT} (required)"
      File "${SRCDIR}\README"
      File "${SRCDIR}\VERSION"

-    File "${BINDIR}\*.bmp"
+;    File "${BINDIR}\*.bmp"
      File "${BINDIR}\*.bin"
      File "${BINDIR}\*.dtb"
      File "${BINDIR}\*.rom"
@@ -206,7 +206,7 @@ Section "Uninstall"
      Delete "$INSTDIR\COPYING.LIB"
      Delete "$INSTDIR\README"
      Delete "$INSTDIR\VERSION"
-    Delete "$INSTDIR\*.bmp"
+;    Delete "$INSTDIR\*.bmp"
      Delete "$INSTDIR\*.bin"
      Delete "$INSTDIR\*.dll"
      Delete "$INSTDIR\*.dtb"

Finally, the build is over, but it was not very easy


--
With best regards, Youry Metlitsky



reply via email to

[Prev in Thread] Current Thread [Next in Thread]