Message ID | 6755edb6-f953-4ca2-a4b6-31e4566e9842@zapateado.de |
---|---|
State | New |
Headers | show |
Series | [qemu-web] Fix link to Windows page in Wiki | expand |
CCing Paolo and Thomas On Wed, Aug 25, 2021 at 06:43:56PM +0200, Helge Konetzka wrote: >The appended patch fixes the link to Wiki Windows page on Website >Download Sources page. > >Furthermore I would like to propose to change the instructions for >Native builds with MSYS2 on Wiki Windows page. > >Please remove the section which copies system binaries to match the >expected file names! > >Instead define variables for configure (gcc-ar and gcc-ranlib are >existing copies of x86_64-w64-mingw32-gcc-ar and >x86_64-w64-mingw32-gcc-ranlib) and add strip to enable make install: > >AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres >STRIP=strip \ >./configure --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl > >Signed-off-by: Helge Konetzka <hk@zapateado.de> >--- > _download/source.html | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/_download/source.html b/_download/source.html >index 35fd156..8671f4e 100644 >--- a/_download/source.html >+++ b/_download/source.html >@@ -2,7 +2,7 @@ > <p>Grab the source code for the latest releases and compile it >yourself! > Detailed compilation instructions can be found in the wiki for > <a href="https://wiki.qemu.org/Hosts/Linux">Linux</a>, >- <a href="https://wiki.qemu.org/Hosts/Windows">Win32</a> and >+ <a href="https://wiki.qemu.org/Hosts/W32">Win32</a> and > <a href="https://wiki.qemu.org/Hosts/Mac">macOS</a>.</p> > > <div id="releases"> >-- >2.20.1 >
On 25/08/21 18:43, Helge Konetzka wrote: > Furthermore I would like to propose to change the instructions for > Native builds with MSYS2 on Wiki Windows page. > > Please remove the section which copies system binaries to match the > expected file names! > > Instead define variables for configure (gcc-ar and gcc-ranlib are > existing copies of x86_64-w64-mingw32-gcc-ar and > x86_64-w64-mingw32-gcc-ranlib) and add strip to enable make install: > > AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres > STRIP=strip \ > ./configure --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl Do you even need anything but "./configure"? (possibly AR=gcc-ar NM=nm at the beginning)? I applied the webpage fix in the meanwhile, thanks! Paolo
Am 10.09.21 um 17:44 schrieb Paolo Bonzini: > On 25/08/21 18:43, Helge Konetzka wrote: >> Furthermore I would like to propose to change the instructions for >> Native builds with MSYS2 on Wiki Windows page. >> >> Please remove the section which copies system binaries to match the >> expected file names! >> >> Instead define variables for configure (gcc-ar and gcc-ranlib are >> existing copies of x86_64-w64-mingw32-gcc-ar and >> x86_64-w64-mingw32-gcc-ranlib) and add strip to enable make install: >> >> AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres >> STRIP=strip \ >> ./configure --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl > > Do you even need anything but "./configure"? (possibly AR=gcc-ar NM=nm > at the beginning)? Sorry for being indistinct! My intention was to put "AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres STRIP=strip" in front of "./configure" (see the '\' after STRIP=strip) instead of copying binaries: diff -Naur qemu.org.orig/Hosts/W32 qemu.org/Hosts/W32 --- qemu.org.orig/Hosts/W32 2021-09-11 08:27:01.198715675 +0200 +++ qemu.org/Hosts/W32 2021-09-11 08:28:15.853605118 +0200 @@ -232,14 +232,6 @@ Close the MSYS2 console. Start mingw64.exe. -cd /mingw64/bin -cp x86_64-w64-mingw32-gcc-ar.exe x86_64-w64-mingw32-ar.exe -cp x86_64-w64-mingw32-gcc-ranlib.exe x86_64-w64-mingw32-ranlib.exe -cp windres.exe x86_64-w64-mingw32-windres.exe -cp nm.exe x86_64-w64-mingw32-nm.exe -cp objcopy.exe x86_64-w64-mingw32-objcopy.exe -cd ~ - Download the QEMU source code: git clone https://www.github.com/qemu/qemu @@ -247,6 +239,7 @@ Finally build QEMU with: cd qemu +AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres STRIP=strip \ ./configure --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl make
On Sat, Sep 11, 2021 at 8:29 AM Helge Konetzka <hk@zapateado.de> wrote: > Am 10.09.21 um 17:44 schrieb Paolo Bonzini: > > On 25/08/21 18:43, Helge Konetzka wrote: > >> Furthermore I would like to propose to change the instructions for > >> Native builds with MSYS2 on Wiki Windows page. > >> > >> Please remove the section which copies system binaries to match the > >> expected file names! > >> > >> Instead define variables for configure (gcc-ar and gcc-ranlib are > >> existing copies of x86_64-w64-mingw32-gcc-ar and > >> x86_64-w64-mingw32-gcc-ranlib) and add strip to enable make install: > >> > >> AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres > >> STRIP=strip \ > >> ./configure --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl > > > > Do you even need anything but "./configure"? (possibly AR=gcc-ar NM=nm > > at the beginning)? > > Sorry for being indistinct! > > My intention was to put "AR=gcc-ar NM=nm OBJCOPY=objcopy > RANLIB=gcc-ranlib WINDRES=windres STRIP=strip" in front of "./configure" > (see the '\' after STRIP=strip) instead of copying binaries: > > diff -Naur qemu.org.orig/Hosts/W32 qemu.org/Hosts/W32 > --- qemu.org.orig/Hosts/W32 2021-09-11 08:27:01.198715675 +0200 > +++ qemu.org/Hosts/W32 2021-09-11 08:28:15.853605118 +0200 > @@ -232,14 +232,6 @@ > Close the MSYS2 console. > Start mingw64.exe. > > -cd /mingw64/bin > -cp x86_64-w64-mingw32-gcc-ar.exe x86_64-w64-mingw32-ar.exe > -cp x86_64-w64-mingw32-gcc-ranlib.exe x86_64-w64-mingw32-ranlib.exe > -cp windres.exe x86_64-w64-mingw32-windres.exe > -cp nm.exe x86_64-w64-mingw32-nm.exe > -cp objcopy.exe x86_64-w64-mingw32-objcopy.exe > -cd ~ > - > Download the QEMU source code: > > git clone https://www.github.com/qemu/qemu > @@ -247,6 +239,7 @@ > Finally build QEMU with: > > cd qemu > +AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres > STRIP=strip \ > ./configure --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl > make > > Hi, I wrote those instructions as I obviously could not find a better way to get Qemu to cross-compile using MSYS2 in Windows. When you look at configure, you see that only adding the cross-prefix will not find the MSYS equivalents of some tools: ar="${AR-${cross_prefix}ar}" looks for x86_64-w64-mingw32-ar.exe and not (as it is named in MSYS2) x86_64-w64-mingw32-gcc-ar.exe Perhaps it would be better to fix configure for the MSYS2 case so the flags or the renaming are not required? Best, Howard
On 11/09/2021 09:43, Howard Spoelstra wrote: > On Sat, Sep 11, 2021 at 8:29 AM Helge Konetzka <hk@zapateado.de > <mailto:hk@zapateado.de>> wrote: > > Am 10.09.21 um 17:44 schrieb Paolo Bonzini: > > On 25/08/21 18:43, Helge Konetzka wrote: > >> Furthermore I would like to propose to change the instructions for > >> Native builds with MSYS2 on Wiki Windows page. > >> > >> Please remove the section which copies system binaries to match the > >> expected file names! > >> > >> Instead define variables for configure (gcc-ar and gcc-ranlib are > >> existing copies of x86_64-w64-mingw32-gcc-ar and > >> x86_64-w64-mingw32-gcc-ranlib) and add strip to enable make install: > >> > >> AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres > >> STRIP=strip \ > >> ./configure --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl > > > > Do you even need anything but "./configure"? (possibly AR=gcc-ar NM=nm > > at the beginning)? > > Sorry for being indistinct! > > My intention was to put "AR=gcc-ar NM=nm OBJCOPY=objcopy > RANLIB=gcc-ranlib WINDRES=windres STRIP=strip" in front of "./configure" > (see the '\' after STRIP=strip) instead of copying binaries: > > diff -Naur qemu.org.orig/Hosts/W32 qemu.org/Hosts/W32 <http://qemu.org/Hosts/W32> > --- qemu.org.orig/Hosts/W32 2021-09-11 08:27:01.198715675 +0200 > +++ qemu.org/Hosts/W32 <http://qemu.org/Hosts/W32> 2021-09-11 08:28:15.853605118 > +0200 > @@ -232,14 +232,6 @@ > Close the MSYS2 console. > Start mingw64.exe. > > -cd /mingw64/bin > -cp x86_64-w64-mingw32-gcc-ar.exe x86_64-w64-mingw32-ar.exe > -cp x86_64-w64-mingw32-gcc-ranlib.exe x86_64-w64-mingw32-ranlib.exe > -cp windres.exe x86_64-w64-mingw32-windres.exe > -cp nm.exe x86_64-w64-mingw32-nm.exe > -cp objcopy.exe x86_64-w64-mingw32-objcopy.exe > -cd ~ > - > Download the QEMU source code: > > git clone https://www.github.com/qemu/qemu <https://www.github.com/qemu/qemu> > @@ -247,6 +239,7 @@ > Finally build QEMU with: > > cd qemu > +AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres > STRIP=strip \ > ./configure --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl > make > > Hi, > > I wrote those instructions as I obviously could not find a better way to get Qemu to > cross-compile using MSYS2 in Windows. > When you look at configure, you see that only adding the cross-prefix will not find > the MSYS equivalents of some tools: > > ar="${AR-${cross_prefix}ar}" > looks for x86_64-w64-mingw32-ar.exe and not (as it is named in MSYS2) > x86_64-w64-mingw32-gcc-ar.exe > > Perhaps it would be better to fix configure for the MSYS2 case so the flags or the > renaming are not required? FWIW it was me that added the MSYS2 section to the wiki since I had a requirement to do some bespoke Windows builds (see https://wiki.qemu.org/index.php?title=Hosts/W32&diff=6803&oldid=5723). As you can see at that point in time there was no need to copy binaries with different names, or pass --cross-prefix into configure. So the question is: what has changed? I find it hard to believe that MSYS2/MingW64 is configured out-of-the-box to break a standard "./configure && make" build incantation. ATB, Mark.
Il sab 11 set 2021, 10:43 Howard Spoelstra <hsp.cat7@gmail.com> ha scritto: > I wrote those instructions as I obviously could not find a better way to > get Qemu to cross-compile using MSYS2 in Windows. > But if you are using MSYS2, why do you need cross compilation and --cross-prefix at all? When you look at configure, you see that only adding the cross-prefix will > not find the MSYS equivalents of some tools: > > ar="${AR-${cross_prefix}ar}" > looks for x86_64-w64-mingw32-ar.exe and not (as it is named in MSYS2) > x86_64-w64-mingw32-gcc-ar.exe > Yes, if the static linker is gcc-ar (I think that's only needed with link-time optimization) you would need AR=. But if you don't need gcc-ar you don't need to change the AR variable, and if you don't need a cross prefix you can just set AR=gcc-ar. Paolo > Perhaps it would be better to fix configure for the MSYS2 case so the flags or the renaming are not required? > > Best, > Howard > >
On 11/09/2021 10:03, Mark Cave-Ayland wrote: > So the question is: what has changed? I find it hard to believe that MSYS2/MingW64 is > configured out-of-the-box to break a standard "./configure && make" build incantation. Also it is worth pointing out that neither the copying/renaming of binaries or passing --cross-prefix into configure are required for our MSYS2-based native Windows CI builds: https://gitlab.com/qemu-project/qemu/-/blob/master/.cirrus.yml. ATB, Mark.
Am 11.09.21 um 11:03 schrieb Mark Cave-Ayland: > So the question is: what has changed? I find it hard to believe that > MSYS2/MingW64 is configured out-of-the-box to break a standard > "./configure && make" build incantation. > On my last attempt to build qemu without --cross-prefix=x86_64-w64-mingw32- (qemu-6.1.0.tar.xz) for building target soft-mmu-x86_64 I received make[1]: *** No rule to make target 'multiboot.bin', needed by 'all'. Stop. make: *** [Makefile:189: pc-bios/optionrom/all] Error 2 make: *** Waiting for unfinished jobs.... ... [1599/1599] Generating QAPI rST doc reference newline-sanitized with a custom command (wrapped by meson to capture output) ==> ERROR: A failure occurred in build(). Aborting...
Am 11.09.21 um 10:43 schrieb Howard Spoelstra: > > Perhaps it would be better to fix configure for the MSYS2 case so the > flags or the renaming are not required? > Currently MSys2 packages qemu successfully for 3 different toolchains: MINGW64: msvcrt / libstdc++ UCRT64: ucrt / libstdc++ CLANG64: ucrt libc++ see https://www.msys2.org/docs/environments/ and https://packages.msys2.org/base/mingw-w64-qemu For CLANG64 configure needs different flags - all other flag-definitions failed: AR=llvm-ar RANLIB=llvm-ranlib NM=nm OBJCOPY=objcopy STRIP=strip WINDRES=windres \ ./configure.sh --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl see https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-qemu/PKGBUILD Just a note to keep in mind if someone wants to fix. Regards Helge.
On 11/09/2021 10:17, Helge Konetzka wrote: > Am 11.09.21 um 11:03 schrieb Mark Cave-Ayland: > >> So the question is: what has changed? I find it hard to believe that MSYS2/MingW64 >> is configured out-of-the-box to break a standard "./configure && make" build >> incantation. >> > > On my last attempt to build qemu without --cross-prefix=x86_64-w64-mingw32- > (qemu-6.1.0.tar.xz) for building target soft-mmu-x86_64 I received > > make[1]: *** No rule to make target 'multiboot.bin', needed by 'all'. Stop. > make: *** [Makefile:189: pc-bios/optionrom/all] Error 2 > make: *** Waiting for unfinished jobs.... > ... > [1599/1599] Generating QAPI rST doc reference newline-sanitized with a custom command > (wrapped by meson to capture output) > ==> ERROR: A failure occurred in build(). > Aborting... Ah the multiboot.bin failure is a known issue with symlinks - see https://www.mail-archive.com/qemu-devel@nongnu.org/msg750968.html and unfortunately the wiki didn't get updated accordingly :( Helge, can you test and see if this fixes your build issue? ATB, Mark.
Am 11.09.21 um 11:30 schrieb Mark Cave-Ayland: > On 11/09/2021 10:17, Helge Konetzka wrote: > >> Am 11.09.21 um 11:03 schrieb Mark Cave-Ayland: >> >>> So the question is: what has changed? I find it hard to believe that >>> MSYS2/MingW64 is configured out-of-the-box to break a standard >>> "./configure && make" build incantation. >>> >> >> On my last attempt to build qemu without >> --cross-prefix=x86_64-w64-mingw32- (qemu-6.1.0.tar.xz) for building >> target soft-mmu-x86_64 I received >> >> make[1]: *** No rule to make target 'multiboot.bin', needed by 'all'. >> Stop. >> make: *** [Makefile:189: pc-bios/optionrom/all] Error 2 >> make: *** Waiting for unfinished jobs.... >> ... >> [1599/1599] Generating QAPI rST doc reference newline-sanitized with a >> custom command (wrapped by meson to capture output) >> ==> ERROR: A failure occurred in build(). >> Aborting... > > Ah the multiboot.bin failure is a known issue with symlinks - see > https://www.mail-archive.com/qemu-devel@nongnu.org/msg750968.html and > unfortunately the wiki didn't get updated accordingly :( > > Helge, can you test and see if this fixes your build issue? Thanks for pointing to this thread. But I wasn't able to go exactly the described way. I've finally succeeded in building Qemu natively from tarball using symlinks configuring winsymlinks:native instead of described winsymlinks:nativestrict. I haven't been able to build Qemu from git sources with symlinks active because of configure failures. Comparing the native build with the cross build shows that pc-bios/optionrom/Makefile is only executed for native builds. To build Qemu natively on default Msys2, I've found an alternative way WITHOUT creating symlinks by adjusting the copied (instead of linked) Makefile in build tree: cd qemu ./configure SMF="../../../pc-bios/optionrom/Makefile" BMF="build/pc-bios/optionrom/Makefile" [ -L $BMF ] || sed -i "s%^\(CURRENT_MAKEFILE\) := .*$%\1 = $SMF%" $BMF make The unit tests pass. Build succeeds on git sources and on tarball. Regards, Helge.
diff --git a/_download/source.html b/_download/source.html index 35fd156..8671f4e 100644 --- a/_download/source.html +++ b/_download/source.html @@ -2,7 +2,7 @@ <p>Grab the source code for the latest releases and compile it yourself! Detailed compilation instructions can be found in the wiki for <a href="https://wiki.qemu.org/Hosts/Linux">Linux</a>, - <a href="https://wiki.qemu.org/Hosts/Windows">Win32</a> and + <a href="https://wiki.qemu.org/Hosts/W32">Win32</a> and <a href="https://wiki.qemu.org/Hosts/Mac">macOS</a>.</p>
The appended patch fixes the link to Wiki Windows page on Website Download Sources page. Furthermore I would like to propose to change the instructions for Native builds with MSYS2 on Wiki Windows page. Please remove the section which copies system binaries to match the expected file names! Instead define variables for configure (gcc-ar and gcc-ranlib are existing copies of x86_64-w64-mingw32-gcc-ar and x86_64-w64-mingw32-gcc-ranlib) and add strip to enable make install: AR=gcc-ar NM=nm OBJCOPY=objcopy RANLIB=gcc-ranlib WINDRES=windres STRIP=strip \ ./configure --cross-prefix=x86_64-w64-mingw32- --enable-gtk --enable-sdl Signed-off-by: Helge Konetzka <hk@zapateado.de> --- _download/source.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) <div id="releases">