AndreRH / hangover

Hangover runs simple Win64 and Win32 applications on arm64 Linux
GNU Lesser General Public License v2.1
1.42k stars 101 forks source link

[ARM64\aarch64] Build problem #34

Closed Dante4 closed 4 years ago

Dante4 commented 5 years ago

First question. Is hangover intended to be build on arm64 boards?

And if yes. Second question. What to do with this error:

Description: If i use gcc I'm getting this error:

make[1]: Entering directory '/root/hangover/wine/build/dlls/acledit'
gcc -c -o main.o ../../../dlls/acledit/main.c -I. -I../../../dlls/acledit -I../../include \
  -I../../../include -I../../../include/msvcrt -D__WINESRC__ -D_REENTRANT -fPIC -fno-builtin \
  -fshort-wchar -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body \
  -Wignored-qualifiers -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \
  -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -gdwarf-2 \
  -gstrict-dwarf -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
In file included from ../../../dlls/acledit/main.c:28:0:
../../../include/wine/debug.h: In function ‘wine_dbg_sprintf’:
../../../include/wine/debug.h:162:29: error: unknown type name ‘__builtin_ms_va_list’; did you mean ‘__builtin_va_list’?
 # define __wine_dbg_va_list __builtin_ms_va_list
                             ^
../../../include/wine/debug.h:176:5: note: in expansion of macro ‘__wine_dbg_va_list’
     __wine_dbg_va_list args;
     ^~~~~~~~~~~~~~~~~~
../../../include/wine/debug.h:163:40: warning: implicit declaration of function ‘__builtin_ms_va_start’; did you mean ‘__builtin_va_start’? [-Wimplicit-function-declaration]
 # define __wine_dbg_va_start(list,arg) __builtin_ms_va_start(list,arg)
                                        ^
../../../include/wine/debug.h:178:5: note: in expansion of macro ‘__wine_dbg_va_start’
     __wine_dbg_va_start( args, format );
     ^~~~~~~~~~~~~~~~~~~
../../../include/wine/debug.h:179:48: error: incompatible type for argument 4 of ‘vsnprintf’
     vsnprintf( buffer, sizeof(buffer), format, args );
                                                ^~~~
In file included from ../../../include/wine/debug.h:25:0,
                 from ../../../dlls/acledit/main.c:28:
../../../include/msvcrt/stdio.h:300:19: note: expected ‘va_list {aka __va_list}’ but argument is of type ‘int’
 static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); }
                   ^~~~~~~~~
In file included from ../../../dlls/acledit/main.c:28:0:
../../../include/wine/debug.h:164:34: warning: implicit declaration of function ‘__builtin_ms_va_end’; did you mean ‘__builtin_va_end’? [-Wimplicit-function-declaration]
 # define __wine_dbg_va_end(list) __builtin_ms_va_end(list)
                                  ^
../../../include/wine/debug.h:180:5: note: in expansion of macro ‘__wine_dbg_va_end’
     __wine_dbg_va_end( args );
     ^~~~~~~~~~~~~~~~~
../../../include/wine/debug.h: In function ‘wine_dbg_printf’:
../../../include/wine/debug.h:162:29: error: unknown type name ‘__builtin_ms_va_list’; did you mean ‘__builtin_va_list’?
 # define __wine_dbg_va_list __builtin_ms_va_list
                             ^
../../../include/wine/debug.h:188:5: note: in expansion of macro ‘__wine_dbg_va_list’
     __wine_dbg_va_list args;
     ^~~~~~~~~~~~~~~~~~
../../../include/wine/debug.h:191:48: error: incompatible type for argument 4 of ‘vsnprintf’
     vsnprintf( buffer, sizeof(buffer), format, args );
                                                ^~~~
In file included from ../../../include/wine/debug.h:25:0,
                 from ../../../dlls/acledit/main.c:28:
../../../include/msvcrt/stdio.h:300:19: note: expected ‘va_list {aka __va_list}’ but argument is of type ‘int’
 static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); }
                   ^~~~~~~~~
In file included from ../../../dlls/acledit/main.c:28:0:
../../../include/wine/debug.h: In function ‘wine_dbg_log’:
../../../include/wine/debug.h:162:29: error: unknown type name ‘__builtin_ms_va_list’; did you mean ‘__builtin_va_list’?
 # define __wine_dbg_va_list __builtin_ms_va_list
                             ^
../../../include/wine/debug.h:204:5: note: in expansion of macro ‘__wine_dbg_va_list’
     __wine_dbg_va_list args;
     ^~~~~~~~~~~~~~~~~~
../../../include/wine/debug.h:215:48: error: incompatible type for argument 4 of ‘vsnprintf’
     vsnprintf( buffer, sizeof(buffer), format, args );
                                                ^~~~
In file included from ../../../include/wine/debug.h:25:0,
                 from ../../../dlls/acledit/main.c:28:
../../../include/msvcrt/stdio.h:300:19: note: expected ‘va_list {aka __va_list}’ but argument is of type ‘int’
 static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); }
                   ^~~~~~~~~
Makefile:171: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
make[1]: Leaving directory '/root/hangover/wine/build/dlls/acledit'
Makefile:8472: recipe for target 'dlls/acledit' failed
make: *** [dlls/acledit] Error 2

If i use clang I'm getting this error:

make[1]: Entering directory '/root/hangover/wine/dlls/activeds'
clang -c -o activeds_main.o activeds_main.c -I. -I../../include -I../../include/msvcrt -D__WINESRC__ \
  -D_REENTRANT -fPIC -fno-builtin -fshort-wchar -Wall -pipe -fno-strict-aliasing \
  -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wno-pragma-pack \
  -Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings -Wpointer-arith -gdwarf-2 -gstrict-dwarf \
  -g -O2
In file included from main.c:28:
../../include/wine/debug.h:178:5: error: '__builtin_ms_va_start' used in System V ABI function
    __wine_dbg_va_start( args, format );
    ^
../../include/wine/debug.h:163:40: note: expanded from macro '__wine_dbg_va_start'
# define __wine_dbg_va_start(list,arg) __builtin_ms_va_start(list,arg)
                                       ^
../../include/wine/debug.h:179:48: error: passing '__builtin_ms_va_list' to parameter of incompatible type 'va_list'
      (aka '__builtin_va_list')
    vsnprintf( buffer, sizeof(buffer), format, args );
                                               ^~~~
../../include/msvcrt/stdio.h:300:89: note: passing argument to parameter 'args' here
static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format...
                                                                                        ^
In file included from main.c:28:
../../include/wine/debug.h:190:5: error: '__builtin_ms_va_start' used in System V ABI function
    __wine_dbg_va_start( args, format );
    ^
../../include/wine/debug.h:163:40: note: expanded from macro '__wine_dbg_va_start'
# define __wine_dbg_va_start(list,arg) __builtin_ms_va_start(list,arg)
                                       ^
../../include/wine/debug.h:191:48: error: passing '__builtin_ms_va_list' to parameter of incompatible type 'va_list'
      (aka '__builtin_va_list')
    vsnprintf( buffer, sizeof(buffer), format, args );
                                               ^~~~
../../include/msvcrt/stdio.h:300:89: note: passing argument to parameter 'args' here
static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format...
                                                                                        ^
In file included from main.c:28:
../../include/wine/debug.h:214:5: error: '__builtin_ms_va_start' used in System V ABI function
    __wine_dbg_va_start( args, format );
    ^
../../include/wine/debug.h:163:40: note: expanded from macro '__wine_dbg_va_start'
# define __wine_dbg_va_start(list,arg) __builtin_ms_va_start(list,arg)
                                       ^
../../include/wine/debug.h:215:48: error: passing '__builtin_ms_va_list' to parameter of incompatible type 'va_list'
      (aka '__builtin_va_list')
    vsnprintf( buffer, sizeof(buffer), format, args );
                                               ^~~~
../../include/msvcrt/stdio.h:300:89: note: passing argument to parameter 'args' here
static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format...
                                                                                        ^
6 errors generated.
Makefile:171: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
make[1]: Leaving directory '/root/hangover/wine/dlls/acledit'
Makefile:8462: recipe for target 'dlls/acledit' failed
make: *** [dlls/acledit] Error 2
make: *** Waiting for unfinished jobs....

I'm using Ubuntu 18.04.02. Kernel 4.4.154-90.

stefand commented 5 years ago

Yes, building on aarch64 boards should work. The details depend on the exact software environment of course. My aarch64 machine is an Nvidia Shield running Gentoo.

Your problem was probably caused by my patches from yesterday. Try to check out the hangover-0.4.0 tags in all 3 git modules (hangover, wine, qemu). I rebased Wine after a long hiatus and did not test it on ARM yet - I needed it for some MacOS x86_64 experiments. It is quite possible that the new Wine code introduced some new problems.

Also see commit d80c9f653b9b7ad95d27d7416141c619e8801930 in Wine. The revert should go eventually, at which point you need clang to build or preferably patch gcc to support Microsoft's va_args on arm64. However, the changed calling convention needs to be implemented in hangover/dlls/include/va_helper_impl.h too, which is why so far I've stuck with the revert and go for the Linux arm64 calling convention.

Dante4 commented 5 years ago

Yes, i was able to built version with 0.4.0 tag, but when i try to run notepad.exe i'm getting this. Does it mean i forgot to install some package?

0009:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
0009:fixme:qemu_module:import_dll No implementation for KERNEL32.dll.FindNLSString imported from L"L:\\root\\notepad.exe", setting to 0x7f8ad37690
0009:fixme:qemu_module:import_dll No implementation for user32.dll.SetProcessDpiAwarenessInternal imported from L"C:\\windows\\system32\\shcore.dll", setting to 0x7f8ad37690
0009:fixme:qemu_module:import_dll No implementation for ntdll.dll._setjmp imported from L"C:\\windows\\system32\\windowscodecs.dll", setting to 0x7f8ad37690
0009:fixme:qemu_module:import_dll No implementation for ntdll.dll.longjmp imported from L"C:\\windows\\system32\\windowscodecs.dll", setting to 0x7f8ad37690
0009:fixme:qemu_module:import_dll No implementation for ntdll.dll.WinSqmIncrementDWORD imported from L"L:\\root\\notepad.exe", setting to 0x7f8ad37690
0009:fixme:qemu_module:import_dll No implementation for ntdll.dll.WinSqmAddToStream imported from L"L:\\root\\notepad.exe", setting to 0x7f8ad37690
0009:fixme:qemu_kernel32:qemu_HeapSetInformation Unverified!
0009:fixme:heap:RtlSetHeapInformation (nil) 1 (nil) 0 stub
0009:fixme:qemu_module:qemu_ldr_module_g2h A host L"ole32.dll" has been found, but no wrapper named L"qemu_ole32.dll".
0009:fixme:qemu_module:qemu_ldr_module_g2h A host L"ole32.dll" has been found, but no wrapper named L"qemu_ole32.dll".
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
0009:fixme:qemu_user32:qemu_CharNextW Unverified!
stefand commented 5 years ago

Are you running the original Windows notepad or Wine's? I never ran Windows notepad myself, and keep in mind that hangover is a very incomplete proof of concept. Try to run Wine's PE notepad build in build/wine-guest/programs/notepad/notepad.exe to see if a simple application works. If that works you're welcome to try more complicated things and 32 bit apps like build/wine-guest32/programs/notepad/notepad.exe, but don't expect magic :-)

Dante4 commented 5 years ago

Tried original one. Should have googled better. Sorry, it's just i never worked with wine. Guess homm5 is a little bit impossible.

If try to start wine's one (i guess if i just type notepad it should be wine's, right?) i'm getting

root@localhost:~/hangover# ./build/wine-host/loader/wine64 ./build/qemu/x86_64-windows-user/qemu-x86_64.exe.so notepad
Could not load wine-gecko. HTML rendering will be disabled.
Could not load wine-gecko. HTML rendering will be disabled.
wine: configuration in '/root/.wine' has been updated.
0009:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
Failed to load "notepad", last error 126.

After I installed winbind it's just Failed to load "notepad", last error 126.

stefand commented 5 years ago

you have to cd into the directory where notepad.exe is located. qemu doesn't search the default wine apps on its own.

Also note that if you just run "wine notepad" you'll run the aarch64 winelib version.

stefand commented 5 years ago

Oh and HOMM appears to be from 2006. I have not tried it with hangover myself, but there are other games from that era that I got working (Dawn of War: Dark Crusade and Settlers 2 the 10th anniversary). The more likely trouble might be your OpenGL driver though. Wine so far still needs Desktop GLX, so you'll need a driver with proper GLX and OpenGL and not EGL and OpenGL:ES. The Tegra driver on my Nvidia shield does that, and anything Mesa-based probably does as well, but other dev boards might be limited to GLES.

Dante4 commented 5 years ago

Well, OpenGL is less problem thanks to gl4es (with this i can play VCMI (HOMM3) and Jedi Academy). I just need to understand how exactly i should work with wine

Yeaaaah. HoMM5 seems not really possible to start since it's i'm getting like x10 terminal windows about import_dll err, aka user32.dll, shlwapi.dll, shell32.dll...

Dante4 commented 5 years ago

Having notepad++ on arm64 is actually rock!

And p.s. were there any specials changes to games you tried? Or just install gog version, transfer it to board and start this up?

stefand commented 5 years ago

I think I've also found the issue that prevented you from building the master branch. I'll push a fix later, although I won't get around to actually verifying it on aarch64 until next week.

Wrt the games, I think Dawn of War I just copied from a Windows machine. For Settlers 2 I installed the game from DVD - the installer actually worked, the update did too I think. I haven't tested the GOG installer though.

Dante4 commented 5 years ago

Ahem, to not overspam i changed title a bit, this what i get when i try to built latest pull

make[2]: Entering directory '/root/hangover/build/wine-guest/dlls/advapi32'
../.././../wine-host/tools/winegcc/winegcc -o advapi32.dll -B../.././../wine-host/tools/winebuild \
  --sysroot=../.. -b x86_64-w64-mingw32 -m64 -fasynchronous-unwind-tables -shared \
  ../../../../wine/dlls/advapi32/advapi32.spec advapi.o cred.o crypt.o crypt_arc4.o crypt_des.o \
  crypt_lmhash.o eventlog.o lsa.o registry.o security.o service.o wmi.o svcctl_c.o version.res \
  ../../dlls/rpcrt4/librpcrt4.delay.a ../../dlls/kernelbase/libkernelbase.a \
  ../../libs/port/libwine_port.a
../../dlls/winecrt0/libwinecrt0.a(debug.o): In function `fallback__wine_dbg_output':
/root/hangover/build/wine-guest/dlls/winecrt0/../../../../wine/dlls/winecrt0/debug.c:176: undefined reference to `__acrt_iob_func'
../../dlls/winecrt0/libwinecrt0.a(debug.o): In function `fallback__wine_dbg_header':
/root/hangover/build/wine-guest/dlls/winecrt0/../../../../wine/dlls/winecrt0/debug.c:201: undefined reference to `__acrt_iob_func'
collect2: error: ld returned 1 exit status
winegcc: x86_64-w64-mingw32-gcc failed
Makefile:542: recipe for target 'advapi32.dll' failed
stefand commented 5 years ago

Check the latest commits, and make sure to update the Wine and Qemu submodule. I have not seen this particular issue before, but many similar ones during my recent rebase spree.

If the problem still persists please tell me your mingw version.

Dante4 commented 5 years ago

So i deleted build folder, did

git pull origin master
git submodule update

and ran "make" twice. Still the same error. As for mingw

mingw-w64/bionic,now 5.0.3-1 all [installed]
  Development environment targeting 32- and 64-bit Windows
stefand commented 5 years ago

Hmm, I have mingw 6.0 here (with gcc 9.2 and binutils 2.32). Does a simple hello world program that writes to stdout compile and link ok?

Wine's debug system changed quite a bit to make it work from inside PE files through Windows API functions rather than going directly to Linux functions.

The next step would be to try to cross compile regular wine with --host=i686-w64-mingw32. You'll have to also pass --with-wine-tools and presumably --without-freetype and --without-x11 unless you feed it a win32 build of freetype and xlib. If that works then there's some flaw in hangover. If it doesn't work than try a newer mingw and/or there is some bug in Wine.

Dante4 commented 5 years ago

I have mingw 6.0 here

I guess you are on Ubuntu 19.04.

I don't think there will be a problem if i will just cross-compile from PC in this case

stefand commented 5 years ago

Gentoo actually, on both my x86_64 PC and aarch64 box.

Dante4 commented 5 years ago

I guess if i just compile last version from github it should solve problem...i hope

No that compilation is over my head, so i guess only cross-compilation will work

Dante4 commented 5 years ago

I guess gonna use 0.4.0 :)

AndreRH commented 5 years ago

I had the same issue, my solution currently is to revert Wine commit: commit 14e7e331ae2e86910dbe3c2d9ecd50aa003dd195 Author: Jacek Caban Date: Tue Aug 6 12:23:24 2019 +0200

stdio.h: Use __acrt_iob_func to access standard stream files.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Dante4 commented 5 years ago

Well, i guess now i don't understand what gone wrong. Even after completely re-downloading i'm still gets stuck at

make[2]: Entering directory '/root/hangover/build/wine-guest/dlls/user32'
../.././../wine-host/tools/winegcc/winegcc -o user32.dll -B../.././../wine-host/tools/winebuild \
  --sysroot=../.. -b x86_64-w64-mingw32 -m64 -fasynchronous-unwind-tables -shared \
  ../../../../wine/dlls/user32/user32.spec button.o caret.o class.o clipboard.o combo.o cursoricon.o \
  dde_client.o dde_misc.o dde_server.o defdlg.o defwnd.o desktop.o dialog.o driver.o edit.o \
  exticon.o focus.o hook.o icontitle.o input.o listbox.o lstr.o mdi.o menu.o message.o misc.o \
  msgbox.o nonclient.o painting.o property.o rawinput.o resource.o scroll.o spy.o static.o \
  sysparams.o text.o uitools.o user_main.o win.o winhelp.o winpos.o winproc.o winstation.o \
  wsprintf.o user32.res ../../dlls/hid/libhid.delay.a ../../dlls/imm32/libimm32.delay.a \
  ../../dlls/setupapi/libsetupapi.delay.a ../../dlls/usp10/libusp10.delay.a \
  ../../dlls/gdi32/libgdi32.a ../../dlls/version/libversion.a ../../dlls/advapi32/libadvapi32.a \
  ../../libs/port/libwine_port.a
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/libmingwex.a(lib64_libmingwex_a-wassert.o): In function `_wassert':
./mingw-w64-crt/misc/wassert.c:37: multiple definition of `_wassert'
user_main.o:/root/hangover/build/wine-guest/dlls/user32/../../../../wine/dlls/user32/user_main.c:60: first defined here
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/libuser32.a(libuser32s00498.o):(.text+0x0): multiple definition of `MessageBoxW'
msgbox.o:/root/hangover/build/wine-guest/dlls/user32/../../../../wine/dlls/user32/msgbox.c:395: first defined here
collect2: error: ld returned 1 exit status
winegcc: x86_64-w64-mingw32-gcc failed
Makefile:1356: recipe for target 'user32.dll' failed
make[2]: *** [user32.dll] Error 2
make[2]: Leaving directory '/root/hangover/build/wine-guest/dlls/user32'
Makefile:7712: recipe for target 'dlls/user32' failed
make[1]: *** [dlls/user32] Error 2
make[1]: Leaving directory '/root/hangover/build/wine-guest'
Makefile:102: recipe for target 'wine-guest' failed
make: *** [wine-guest] Error 2
ghost commented 5 years ago

I try to build it on a raspberry pi 4 with ubuntu 18.04 64-bit. When I build current HEAD I get the same build errors:


  -I../../include -I../../../../wine/include -D__WINESRC__ -D_USER32_ -D_WINABLE_ -D_REENTRANT -Wall \
  -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers \
  -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wvla \
  -Wwrite-strings -Wpointer-arith -Wlogical-op -gdwarf-2 -gstrict-dwarf -Wno-format -g -O2 -D_WIN32
../.././../wine-host/tools/wrc/wrc -o user32.res -b x86_64-w64-mingw32 -m64 --nostdinc -I. \
  -I../../../../wine/dlls/user32 -I../../include -I../../../../wine/include -D__WINESRC__ -D_USER32_ \
  -D_WINABLE_ --po-dir=../../po ../../../../wine/dlls/user32/user32.rc
../.././../wine-host/tools/winegcc/winegcc -o user32.dll -B../.././../wine-host/tools/winebuild \
  --sysroot=../.. -b x86_64-w64-mingw32 -m64 -fasynchronous-unwind-tables -shared \
  ../../../../wine/dlls/user32/user32.spec button.o caret.o class.o clipboard.o combo.o cursoricon.o \
  dde_client.o dde_misc.o dde_server.o defdlg.o defwnd.o desktop.o dialog.o driver.o edit.o \
  exticon.o focus.o hook.o icontitle.o input.o listbox.o lstr.o mdi.o menu.o message.o misc.o \
  msgbox.o nonclient.o painting.o property.o rawinput.o resource.o scroll.o spy.o static.o \
  sysparams.o text.o uitools.o user_main.o win.o winhelp.o winpos.o winproc.o winstation.o \
  wsprintf.o user32.res ../../dlls/hid/libhid.delay.a ../../dlls/imm32/libimm32.delay.a \
  ../../dlls/setupapi/libsetupapi.delay.a ../../dlls/usp10/libusp10.delay.a \
  ../../dlls/gdi32/libgdi32.a ../../dlls/version/libversion.a ../../dlls/advapi32/libadvapi32.a \
  ../../libs/port/libwine_port.a
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/libmingwex.a(lib64_libmingwex_a-wassert.o): In function `_wassert':
./mingw-w64-crt/misc/wassert.c:37: multiple definition of `_wassert'
user_main.o:/media/data/hangover/build/wine-guest/dlls/user32/../../../../wine/dlls/user32/user_main.c:60: first defined here
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/libuser32.a(libuser32s00498.o):(.text+0x0): multiple definition of `MessageBoxW'
msgbox.o:/media/data/hangover/build/wine-guest/dlls/user32/../../../../wine/dlls/user32/msgbox.c:395: first defined here
collect2: error: ld returned 1 exit status
winegcc: x86_64-w64-mingw32-gcc failed
Makefile:1356: recipe for target 'user32.dll' failed
make[2]: *** [user32.dll] Error 2
make[2]: Leaving directory '/media/data/hangover/build/wine-guest/dlls/user32'
Makefile:7712: recipe for target 'dlls/user32' failed
make[1]: *** [dlls/user32] Error 2
make[1]: Leaving directory '/media/data/hangover/build/wine-guest'
Makefile:102: recipe for target 'wine-guest' failed
make: *** [wine-guest] Error 2
ubuntu@ubuntu:/media/data/hangover$```
daemongloom commented 5 years ago

I'm also stuck at the same place as others. Ubuntu 18.04, aarch64 (samsung s10, linux on dex).

make[2]: Entering directory '/home/dextop/Desktop/hangover/build/wine-guest/dlls/user32'
../.././../wine-host/tools/winegcc/winegcc -o user32.dll -B../.././../wine-host/tools/winebuild \
  --sysroot=../.. -b x86_64-w64-mingw32 -m64 -fasynchronous-unwind-tables -shared \
  ../../../../wine/dlls/user32/user32.spec button.o caret.o class.o clipboard.o combo.o cursoricon.o \
  dde_client.o dde_misc.o dde_server.o defdlg.o defwnd.o desktop.o dialog.o driver.o edit.o \
  exticon.o focus.o hook.o icontitle.o input.o listbox.o lstr.o mdi.o menu.o message.o misc.o \
  msgbox.o nonclient.o painting.o property.o rawinput.o resource.o scroll.o spy.o static.o \
  sysparams.o text.o uitools.o user_main.o win.o winhelp.o winpos.o winproc.o winstation.o \
  wsprintf.o user32.res ../../dlls/hid/libhid.delay.a ../../dlls/imm32/libimm32.delay.a \
  ../../dlls/setupapi/libsetupapi.delay.a ../../dlls/usp10/libusp10.delay.a \
  ../../dlls/gdi32/libgdi32.a ../../dlls/version/libversion.a ../../dlls/advapi32/libadvapi32.a \
  ../../libs/port/libwine_port.a 
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/libmingwex.a(lib64_libmingwex_a-wassert.o): In function `_wassert':
./mingw-w64-crt/misc/wassert.c:37: multiple definition of `_wassert'
user_main.o:/home/dextop/Desktop/hangover/build/wine-guest/dlls/user32/../../../../wine/dlls/user32/user_main.c:60: first defined here
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/libuser32.a(libuser32s00498.o):(.text+0x0): multiple definition of `MessageBoxW'
msgbox.o:/home/dextop/Desktop/hangover/build/wine-guest/dlls/user32/../../../../wine/dlls/user32/msgbox.c:395: first defined here
collect2: error: ld returned 1 exit status
winegcc: x86_64-w64-mingw32-gcc failed
Makefile:1369: recipe for target 'user32.dll' failed
Dante4 commented 4 years ago

Yep, it's still there

make[2]: Entering directory '/root/hangover/build/wine-guest/dlls/user32'
../.././../wine-host/tools/winegcc/winegcc -o user32.dll --wine-objdir ../.. --winebuild \
  ../.././../wine-host/tools/winebuild/winebuild -b x86_64-w64-mingw32 -m64 \
  -fasynchronous-unwind-tables -shared ../../../../wine/dlls/user32/user32.spec button.o caret.o \
  class.o clipboard.o combo.o cursoricon.o dde_client.o dde_misc.o dde_server.o defdlg.o defwnd.o \
  desktop.o dialog.o driver.o edit.o exticon.o focus.o hook.o icontitle.o input.o listbox.o lstr.o \
  mdi.o menu.o message.o misc.o msgbox.o nonclient.o painting.o property.o rawinput.o resource.o \
  scroll.o spy.o static.o sysparams.o text.o uitools.o user_main.o win.o winhelp.o winpos.o \
  winproc.o winstation.o wsprintf.o user32.res ../../dlls/hid/libhid.delay.a \
  ../../dlls/imm32/libimm32.delay.a ../../dlls/setupapi/libsetupapi.delay.a \
  ../../dlls/usp10/libusp10.delay.a ../../dlls/gdi32/libgdi32.a ../../dlls/version/libversion.a \
  ../../dlls/advapi32/libadvapi32.a ../../libs/port/libwine_port.a
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/libmingwex.a(lib64_libmingwex_a-wassert.o): In function `_wassert':
./mingw-w64-crt/misc/wassert.c:37: multiple definition of `_wassert'
user_main.o:/root/hangover/build/wine-guest/dlls/user32/../../../../wine/dlls/user32/user_main.c:60: first defined here
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/libuser32.a(libuser32s00498.o):(.text+0x0): multiple definition of                                                                                               `MessageBoxW'
msgbox.o:/root/hangover/build/wine-guest/dlls/user32/../../../../wine/dlls/user32/msgbox.c:395: first defined here
collect2: error: ld returned 1 exit status
winegcc: x86_64-w64-mingw32-gcc failed
Makefile:1408: recipe for target 'user32.dll' failed
make[2]: *** [user32.dll] Error 2
make[2]: Leaving directory '/root/hangover/build/wine-guest/dlls/user32'
Makefile:7766: recipe for target 'dlls/user32' failed
make[1]: *** [dlls/user32] Error 2
make[1]: Leaving directory '/root/hangover/build/wine-guest'
Makefile:102: recipe for target 'wine-guest' failed
make: *** [wine-guest] Error 2
stefand commented 4 years ago

I just looked into the Wine code and saw a few lines in dlls/user32/user_main.c that were added by 5aa83bee08e4 to work around an issue that sounds very similar to what you post here. Hangover's wine is new enough to contain this patch, so I don't know why it isn't working for you. Maybe looking at the patch gives you some clues to debug it though - e.g. see if the fake wassert is built.

I am also not sure why libmingwex.a is pulled in. I guess it is part of the default libs mingw links against. See if using -nodefaultlibs helps (see dlls/kernel32/Makefile.in and dlls/user32/Makefile.in for some pointers)

Dante4 commented 4 years ago

Thank you for fast reply. I will check this.

Dante4 commented 4 years ago

@stefand, sorry it took that long, i tried to built it several time.

Yes, adding -nodefaultlibs to user32/Makefile.in fixed problem before. At least one time build was successful, but then i got problem that math.o is empty file (in tests section), so i deleted build folder to rebuild everything, and now i have same problem, so i guess i will redownload everything once more

Dante4 commented 4 years ago

Well. Building with -nodefaultlibs led... to a log of problems. The whole log is much-much bigger but in most cases it's just repeating of following

/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/server.h:61: undefined reference to `wine_server_call'
winstation.o: In function `SetLastError':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/winbase.h:3117: undefined reference to `NtCurrentTeb'
winstation.o: In function `GetUserObjectInformationW':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/server.h:62: undefined reference to `RtlNtStatusToDosError'
winstation.o: In function `SetLastError':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/winbase.h:3117: undefined reference to `NtCurrentTeb'
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/winbase.h:3117: undefined reference to `NtCurrentTeb'
winstation.o: In function `GetUserObjectInformationA':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/dlls/user32/winstation.c:525: undefined reference to `WideCharToMultiByte'
winstation.o: In function `SetLastError':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/winbase.h:3117: undefined reference to `NtCurrentTeb'
winstation.o: In function `GetUserObjectInformationA':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/dlls/user32/winstation.c:536: undefined reference to `WideCharToMultiByte'
winstation.o: In function `SetLastError':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/winbase.h:3117: undefined reference to `NtCurrentTeb'
winstation.o: In function `SetUserObjectInformationW':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/server.h:61: undefined reference to `wine_server_call'
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/server.h:62: undefined reference to `RtlNtStatusToDosError'
winstation.o: In function `SetLastError':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/winbase.h:3117: undefined reference to `NtCurrentTeb'
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/winbase.h:3117: undefined reference to `NtCurrentTeb'
wsprintf.o: In function `wine_dbg_log':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:212: undefined reference to `__wine_dbg_header'
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:217: undefined reference to `__wine_dbg_output'
wsprintf.o: In function `wine_dbg_sprintf':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:181: undefined reference to `__wine_dbg_strdup'
wsprintf.o: In function `wine_dbgstr_an':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:228: undefined reference to `IsBadStringPtrA'
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:228: undefined reference to `IsBadStringPtrA'
wsprintf.o: In function `wvsnprintfA':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:260: undefined reference to `__wine_dbg_strdup'
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:260: undefined reference to `__wine_dbg_strdup'
wsprintf.o: In function `wine_dbgstr_wn':
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:270: undefined reference to `IsBadStringPtrW'
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:304: undefined reference to `__wine_dbg_strdup'
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:270: undefined reference to `IsBadStringPtrW'
/root/hangover/build/wine-host/dlls/user32/../../../../wine/include/wine/debug.h:304: undefined reference to `__wine_dbg_strdup'
/usr/bin/ld: user32.dll.so: hidden symbol `SetCurrentDirectoryW' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
winegcc: gcc failed
Makefile:1452: recipe for target 'user32.dll.so' failed
stefand commented 4 years ago

Hmm ya, patching wine/dlls/user32/Makefile.in also affects the host (arm64) build.

The annoying thing is that wine-guest/dlls/user32/user32.dll isn't used at all. Hangover has its own wrapper in place that will redirect calls to host user32.

I guess (as a temporary hack) you could try to just touch files in build/wine-guest/dlls/user32 and build/wine-guest32/dlls/user32 until make is happy.

Dante4 commented 4 years ago

I guess i'm stuck. Building on ARM64 boards lead to previsions problems. Honestly i don't have any idea what kind of files i need to touch to make make (ha) happy.

And building on my PC leads to https://github.com/AndreRH/hangover/issues/34#issuecomment-523201483 and reverting commit as AndreRH advised lead to

~/hangover/build/wine-host/dlls/winecrt0/../../../../wine/dlls/winecrt0/debug.c:176: undefined reference to `__iob_func'
AndreRH commented 4 years ago

the __acrt_iob_func issue goes away with mingw-w64 6.0 I guess we can't support older versions of mingw-w64

GitSoftwareNow commented 4 years ago

I guess i'm stuck. Building on ARM64 boards lead to previsions problems. Honestly i don't have any idea what kind of files i need to touch to make make (ha) happy.

And building on my PC leads to #34 (comment) and reverting commit as AndreRH advised lead to

~/hangover/build/wine-host/dlls/winecrt0/../../../../wine/dlls/winecrt0/debug.c:176: undefined reference to `__iob_func'

The same problem to me,the gcc version is 10.1 the i686-mingw-gcc version is 10-Win32 ,They are working normally but it's still there /home/hangover/build/wine-guest/dlls/winecrt0/../../../../wine/dlls/winecrt0/debug.c undefined reference to `__iob_func'