qemu-devel
[Top][All Lists]
Advanced

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

Re: meson: problems building under msys2/mingw-w64 native


From: Mark Cave-Ayland
Subject: Re: meson: problems building under msys2/mingw-w64 native
Date: Mon, 24 Aug 2020 21:26:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 24/08/2020 14:18, Paolo Bonzini wrote:

> Il lun 24 ago 2020, 13:06 Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk
> <mailto:mark.cave-ayland@ilande.co.uk>> ha scritto:
> 
>     Within configure the default location to ninja is overridden via
>     "NINJA=$PWD/ninjatool $meson setup ..." and subprocess.Popen() sends the 
> filename to
>     Win32's CreateProcess() which fails because ninjatool is not a native 
> executable but
>     a shell script. Any thoughts as to what would be the best solution here?
> 
> 
> The simplest stopgap solution is to remove the NINJA= override and install 
> ninja. It
> will only be used to build the compile_commands.json file.

I can confirm this works - I changed "NINJA=$PWD/ninjatool $meson setup ..." to
"NINJA=ninja $meson setup ..." and that allows configure to complete 
successfully.
However running make afterwards fails with this error:

/mingw64/bin/python3 -B /home/Mark/qemu/scripts/qapi-gen.py -o tests -p "test-"
/home/Mark/qemu/tests/qapi-schema/qapi-schema-test.json
Makefile.ninja:26: *** multiple target patterns.  Stop.
make[1]: Leaving directory '/home/Mark/qemu/build'
make: *** [GNUmakefile:11: all] Error 2

Looking at build/Makefile.ninja there seems to be an escaping issue with the 
"C:\"
being replaced with "C$$:" throughout the file:

PHONY:
version.rc_version.o: ../version.rc C$$:/msys64/mingw64/bin/windres.EXE
../pc-bios/qemu-nsis.ico | ; ${ninja-command}
...
...

I was able to fix this using the substitution '%s/C\$\$:/C:/g' in vim which 
allows
make to get much further:

"cc" "-Iqemu-system-ppc.exe.p" "-I." "-I.." "-Iqapi" "-Itrace" "-Iui" 
"-Iui/shader"
"-I/home/Mark/qemu/dtc/libfdt" "-I/home/Mark/qemu/capstone/include"
"-I/home/Mark/qemu/slirp/src" "-I/home/Mark/qemu/build/slirp/src"
"-IC:/msys64/mingw64/include/libpng16" "-IC:/msys64/mingw64/include"
"-IC:/msys64/mingw64/include/pixman-1" "-IC:/msys64/mingw64/include/glib-2.0"
"-IC:/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=always" "-pipe"
"-Wall" "-Winvalid-pch" "-Werror" "-std=gnu99" "-O2" "-g" "-Werror"
"-U_FORTIFY_SOURCE" "-D_FORTIFY_SOURCE=2" "-pthread" "-mms-bitfields" "-m64" 
"-mcx16"
"-D_GNU_SOURCE" "-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" "-Wno-missing-include-dirs"
"-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong" "-iquote"
"/home/Mark/qemu/tcg/i386" "-iquote" "." "-iquote" "/home/Mark/qemu" "-iquote"
"/home/Mark/qemu/accel/tcg" "-iquote" "/home/Mark/qemu/include" "-iquote"
"/home/Mark/qemu/disas/libvixl" "-fPIE" "-mms-bitfields" "-mms-bitfields"
"-Dmain=SDL_main" "-isystemC:/msys64/mingw64/include/SDL2" "-Wno-undef"
"-DNEED_CPU_H" "-DCONFIG_TARGET=\"ppc-softmmu-config-target.h\""
"-DCONFIG_DEVICES=\"ppc-softmmu-config-devices.h\"" -MD -MQ
qemu-system-ppc.exe.p/softmmu_main.c.obj -MF
"qemu-system-ppc.exe.p/softmmu_main.c.obj.d" -o
qemu-system-ppc.exe.p/softmmu_main.c.obj "-c" ../softmmu/main.c -MP
../softmmu/main.c:31:10: fatal error: SDL.h: No such file or directory
   31 | #include <SDL.h>
      |          ^~~~~~~
compilation terminated.
make[1]: *** [Makefile.ninja:1402: qemu-system-ppc.exe.p/softmmu_main.c.obj] 
Error 1

After checking carefully I spotted the problem is with
"-isystemC:/msys64/mingw64/include/SDL2" not being quoted correctly at multiple
places in Makefile.ninja.

Again I was able to fix this in vim using the substitution 
'%s/isystemC:/isystem"
"C:/g' to turn "-isystemC:/msys64/mingw64/include/SDL2" into "-isystem"
"C:/msys64/mingw64/include/SDL2".

With this I can get all the way to the link phase so I think it's fairly close. 
I'm
not sure whether these escaping/quoting problems are with meson or the way in 
which
configure is using it?


ATB,

Mark.



reply via email to

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