building a native winedll on MacOS Monterey

Questions about Wine on macOS.
Locked
winegb
Level 1
Level 1
Posts: 5
Joined: Fri Apr 01, 2022 1:48 pm

building a native winedll on MacOS Monterey

Post by winegb »

I am using wine to run a win32 application on an Apple M1 machine. This app has the ability to extend it's functionality by loading DLL libraries.
Now I am attempting to use winegcc to build a native 32 bit winedll on MacOS but I am getting a "bad relocation" error.
I am not sure what I am doing wrong. Can someone help out?

Code: Select all

[x@MacBook-Pro winedll]$ make
winegcc -v -Wm -m32 -shared -isystem /opt/local/llvm-mingw/armv7-w64-mingw32/include/ -L/opt/local/llvm-mingw/armv7-w64-mingw32 -L/opt/local/llvm-mingw/armv7-w64-mingw32/lib -o libtestnative.dll libtest_main.c libtest.spec
/opt/local/llvm-mingw/bin/clang -m32 -fshort-wchar -DWINE_UNICODE_NATIVE -D_REENTRANT -fPIC -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -D__WINNT -D__WINNT__ -D__stdcall=__attribute__((pcs("aapcs-vfp"))) -D__cdecl=__stdcall -D__fastcall=__stdcall -D_stdcall=__stdcall -D_cdecl=__cdecl -D_fastcall=__fastcall -D__declspec(x)=__declspec_##x -D__declspec_align(x)=__attribute__((aligned(x))) -D__declspec_allocate(x)=__attribute__((section(x))) -D__declspec_deprecated=__attribute__((deprecated)) -D__declspec_dllimport=__attribute__((dllimport)) -D__declspec_dllexport=__attribute__((dllexport)) -D__declspec_naked=__attribute__((naked)) -D__declspec_noinline=__attribute__((noinline)) -D__declspec_noreturn=__attribute__((noreturn)) -D__declspec_nothrow=__attribute__((nothrow)) -D__declspec_novtable=__attribute__(()) -D__declspec_selectany=__attribute__((weak)) -D__declspec_thread=__thread -D__int8=char -D__int16=short -D__int32=int "-D__int64=long long" -D__WINE__ -c -o libtest_main-Sg6zKL.o -v -Wm -m32 -isystem /opt/local/llvm-mingw/armv7-w64-mingw32/include/ libtest_main.c -isystem/usr/local/include/wine/windows -isystem/usr/include/wine/windows -isystem/usr/local/include -isystem/usr/include
clang version 14.0.0 (https://github.com/llvm/llvm-project.git 329fda39c507e8740978d10458451dcdb21563be)
Target: arm-apple-darwin21.3.0
Thread model: posix
InstalledDir: /opt/local/llvm-mingw/bin
 (in-process)
 "/opt/local/llvm-mingw/bin/clang-14" -cc1 -triple armv4t-apple-macosx12.0.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name libtest_main.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -ffp-contract=on -fno-rounding-math -fcompatibility-qualified-id-block-type-checking -fvisibility-inlines-hidden-static-local-var -target-cpu arm7tdmi -Wunaligned-access -target-feature +soft-float -target-feature +soft-float-abi -target-feature -vfp2 -target-feature -vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature -vfp3d16sp -target-feature -vfp3sp -target-feature -fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature -vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature -fp64 -target-feature -d32 -target-feature -neon -target-feature -sha2 -target-feature -aes -target-feature -dotprod -target-feature -fp16fml -target-feature -bf16 -target-feature -mve -target-feature -mve.fp -target-feature -fpregs -target-feature +strict-align -target-abi apcs-gnu -msoft-float -mfloat-abi soft -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=lldb -target-linker-version 650.9 -v -fcoverage-compilation-dir=/Users/goran.blankendal/Dev/winedll -resource-dir /opt/local/llvm-mingw/lib/clang/14.0.0 -isystem /opt/local/llvm-mingw/armv7-w64-mingw32/include/ -isystem /usr/local/include/wine/windows -isystem /usr/include/wine/windows -isystem /usr/local/include -isystem /usr/include -D WINE_UNICODE_NATIVE -D _REENTRANT -D WIN32 -D _WIN32 -D __WIN32 -D __WIN32__ -D __WINNT -D __WINNT__ -D "__stdcall=__attribute__((pcs(\"aapcs-vfp\")))" -D __cdecl=__stdcall -D __fastcall=__stdcall -D _stdcall=__stdcall -D _cdecl=__cdecl -D _fastcall=__fastcall -D __declspec(x)=__declspec_##x -D __declspec_align(x)=__attribute__((aligned(x))) -D __declspec_allocate(x)=__attribute__((section(x))) -D __declspec_deprecated=__attribute__((deprecated)) -D __declspec_dllimport=__attribute__((dllimport)) -D __declspec_dllexport=__attribute__((dllexport)) -D __declspec_naked=__attribute__((naked)) -D __declspec_noinline=__attribute__((noinline)) -D __declspec_noreturn=__attribute__((noreturn)) -D __declspec_nothrow=__attribute__((nothrow)) -D __declspec_novtable=__attribute__(()) -D __declspec_selectany=__attribute__((weak)) -D __declspec_thread=__thread -D __int8=char -D __int16=short -D __int32=int -D "__int64=long long" -D __WINE__ -internal-isystem /usr/local/include -internal-isystem /opt/local/llvm-mingw/lib/clang/14.0.0/include -internal-externc-isystem /usr/include -Wm -fdebug-compilation-dir=/Users/goran.blankendal/Dev/winedll -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-signature -fwchar-type=short -fno-signed-wchar -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -exception-model=sjlj -fmax-type-align=16 -fcolor-diagnostics -o libtest_main-Sg6zKL.o -x c libtest_main.c
warning: unknown warning option '-Wm' [-Wunknown-warning-option]
clang -cc1 version 14.0.0 based upon LLVM 14.0.0 default target arm64-apple-darwin21.3.0
ignoring nonexistent directory "/usr/include/wine/windows"
ignoring nonexistent directory "/usr/include"
ignoring nonexistent directory "/usr/include"
ignoring duplicate directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/local/llvm-mingw/armv7-w64-mingw32/include
 /usr/local/include/wine/windows
 /usr/local/include
 /opt/local/llvm-mingw/lib/clang/14.0.0/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
1 warning generated.
/usr/local/bin/winebuild -v -fno-asynchronous-unwind-tables --cc-cmd=/opt/local/llvm-mingw/bin/clang --ld-cmd=/usr/bin/ld -m32 -D_REENTRANT -fPIC --dll -o libtestnative.dll-Coc1at.spec.o -E libtest.spec -L/opt/local/llvm-mingw/armv7-w64-mingw32 -L/opt/local/llvm-mingw/armv7-w64-mingw32/lib -L/usr/local/lib/wine -L/usr/local/lib -- libtest_main-Sg6zKL.o /opt/local/llvm-mingw/armv7-w64-mingw32/lib/libadvapi32.a /opt/local/llvm-mingw/armv7-w64-mingw32/lib/libuser32.a /usr/local/lib/wine/libwinecrt0.a /opt/local/llvm-mingw/armv7-w64-mingw32/lib/libkernel32.a /opt/local/llvm-mingw/armv7-w64-mingw32/lib/libntdll.a
/opt/local/llvm-mingw/bin/clang -xassembler -c -m32 -o libtestnative.y6Efdz.o libtestnative.WpIXFR.s
libtestnative.WpIXFR.s:2:8: error: bad relocation fixup type
        .quad _so_request_new_data
              ^
libtestnative.WpIXFR.s:3:8: error: bad relocation fixup type
        .quad _DllMain
              ^
winebuild: /opt/local/llvm-mingw/bin/clang failed with status 1
winegb
Level 1
Level 1
Posts: 5
Joined: Fri Apr 01, 2022 1:48 pm

Re: building a native winedll on MacOS Monterey

Post by winegb »

I have been able to make some progress however wine refuses to load the resulting library:

Code: Select all

uname -a
Darwin MacBook-Pro.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64

MacBook-Pro winedll]$file libmt4native_osx_32.dll.so
libmt4native_osx_32.dll.so: Mach-O bundle i386

MacBook-Pro winedll]$nm !$
nm libmt4native_osx_32.dll.so
00014130 d .L__wine_spec_exp_name_ptrs
00014140 d .L__wine_spec_exp_names
00014134 d .L__wine_spec_exp_ordinals
00014104 d .L__wine_spec_exports
00014160 d .L__wine_spec_exports_end
0001412c d .L__wine_spec_exports_funcs
000130bc s .L__wine_spec_relay_args_string
00014160 d .L__wine_spec_relay_descr
000130b8 s .L__wine_spec_relay_entry_point_offsets
0001400c d .L__wine_spec_rva_base
00013030 T _DllMain
00013024 t ___wine_spec_get_pc_thunk_eax
0001400c D ___wine_spec_nt_header
00014008 d __dyld_private
00014178 b __end
00003000 t __wine_spec_pe_header
0001300c t __wine_spec_relay_entry_point_1
00013000 t __wine_spec_relay_entry_points
         U _printf
00013060 T _so_request_new_data
I have used the following command to produce this:

Code: Select all

winegcc -v -Wm -m32 -shared -b i386-apple-darwin -mmacosx-version-min=10.13 -iframework/opt/SDKs/MacOSX10.13.sdk -shared -isysroot /opt/local/wineosx -I/opt/local/wineosx/usr/include/wine/msvcrt/ -L/opt/SDKs/MacOSX10.13.sdk/usr/lib/ -o libmt4native_osx_32.dll libmt4_main.c libmt4.spec
The SDK is downloaded from: https://github.com/phracker/MacOSX-SDKs/releases

Running the app with WINEDEBUG=+module reveals the following:

Code: Select all

0104:warn:module:load_so_dll failed to load .so lib L"\\??\\c:\\Program Files (x86)\\MetaTrader 4\\libmt4native.dll"
0104:warn:module:load_dll Failed to load module L"libmt4native.dll"; status=c000012f
How can I get more details on why my library refuses to load? I have googled the status code c000012f and found a page where is says that the library may not be designed to run on windows. So apparently something is wrong with the dll but what exactly and how do you troubleshoot this?

The application I am running is metatrader4 and I found a ton of dlls which are in "Mach-O bundle i386" which shows that it is possible:

Code: Select all

uname -a
Darwin MacBook-Pro.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64
[MacBook-Pro winedll]$ file "/Applications/MT4 CapitalIndex.app//Contents/SharedSupport/metatrader4/lib/wine/kerberos.dll.so"
/Applications/MT4 CapitalIndex.app//Contents/SharedSupport/metatrader4/lib/wine/kerberos.dll.so: Mach-O bundle i386
[MacBook-Pro winedll]$ nm "/Applications/MT4 CapitalIndex.app//Contents/SharedSupport/metatrader4/lib/wine/kerberos.dll.so"
00011240 T _SpLsaModeInitialize
00011340 T _SpUserModeInitialize
00013024 D ___wine_spec_nt_header
         U _memcpy
         U _vsnprintf
         U dyld_stub_binder
Here is the output of my build process. Anyone can help please?

Code: Select all

export SDKROOT=/opt/SDKs/MacOSX10.13.sdk/
export FRAMEWORK=10.13
winegcc -v -Wm -m32 -shared -b i386-apple-darwin -mmacosx-version-min=10.13 -iframework/opt/SDKs/MacOSX10.13.sdk -shared -isysroot /opt/local/wineosx -I/opt/local/wineosx/usr/include/wine/msvcrt/ -L/opt/SDKs/MacOSX10.13.sdk/usr/lib/ -o libmt4native_osx_32.dll libmt4_main.c libmt4.spec
/opt/local/bin/i386-apple-darwin-gcc -m32 -fshort-wchar -DWINE_UNICODE_NATIVE -D_REENTRANT -fPIC -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -D__WINNT -D__WINNT__ "-D__stdcall=__attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))" "-D__cdecl=__attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))" -D__fastcall=__attribute__((__fastcall__)) -D_stdcall=__stdcall -D_cdecl=__cdecl -D_fastcall=__fastcall -D__declspec(x)=__declspec_##x -D__declspec_align(x)=__attribute__((aligned(x))) -D__declspec_allocate(x)=__attribute__((section(x))) -D__declspec_deprecated=__attribute__((deprecated)) -D__declspec_dllimport=__attribute__((dllimport)) -D__declspec_dllexport=__attribute__((dllexport)) -D__declspec_naked=__attribute__((naked)) -D__declspec_noinline=__attribute__((noinline)) -D__declspec_noreturn=__attribute__((noreturn)) -D__declspec_nothrow=__attribute__((nothrow)) -D__declspec_novtable=__attribute__(()) -D__declspec_selectany=__attribute__((weak)) -D__declspec_thread=__thread -D__int8=char -D__int16=short -D__int32=int "-D__int64=long long" -D__WINE__ -c -o libmt4_main-oJKrwg.o -v -Wm -m32 -mmacosx-version-min=10.13 -iframework/opt/SDKs/MacOSX10.13.sdk -shared -isysroot /opt/local/wineosx -I/opt/local/wineosx/usr/include/wine/msvcrt/ libmt4_main.c -isystem/opt/local/wineosx/usr/local/include/wine/windows -isystem/opt/local/wineosx/usr/include/wine/windows -isystem/opt/local/wineosx/usr/local/include -isystem/opt/local/wineosx/usr/include
clang version 14.0.0 (https://github.com/llvm/llvm-project.git 329fda39c507e8740978d10458451dcdb21563be)
Target: i386-apple-darwin
Thread model: posix
InstalledDir: /opt/local/bin
clang-14: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
 (in-process)
 "/opt/local/llvm-mingw/bin/clang-14" -cc1 -triple i386-apple-macosx10.13.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name libmt4_main.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -ffp-contract=on -fno-rounding-math -funwind-tables=2 -faligned-alloc-unavailable -fcompatibility-qualified-id-block-type-checking -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=lldb -target-linker-version 650.9 -v -fcoverage-compilation-dir=/Users/x/Dev/mt4-notify/winedll -resource-dir /opt/local/llvm-mingw/lib/clang/14.0.0 -iframework /opt/SDKs/MacOSX10.13.sdk -isysroot /opt/local/wineosx -isystem /opt/local/wineosx/usr/local/include/wine/windows -isystem /opt/local/wineosx/usr/include/wine/windows -isystem /opt/local/wineosx/usr/local/include -isystem /opt/local/wineosx/usr/include -D WINE_UNICODE_NATIVE -D _REENTRANT -D WIN32 -D _WIN32 -D __WIN32 -D __WIN32__ -D __WINNT -D __WINNT__ -D "__stdcall=__attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))" -D "__cdecl=__attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))" -D __fastcall=__attribute__((__fastcall__)) -D _stdcall=__stdcall -D _cdecl=__cdecl -D _fastcall=__fastcall -D __declspec(x)=__declspec_##x -D __declspec_align(x)=__attribute__((aligned(x))) -D __declspec_allocate(x)=__attribute__((section(x))) -D __declspec_deprecated=__attribute__((deprecated)) -D __declspec_dllimport=__attribute__((dllimport)) -D __declspec_dllexport=__attribute__((dllexport)) -D __declspec_naked=__attribute__((naked)) -D __declspec_noinline=__attribute__((noinline)) -D __declspec_noreturn=__attribute__((noreturn)) -D __declspec_nothrow=__attribute__((nothrow)) -D __declspec_novtable=__attribute__(()) -D __declspec_selectany=__attribute__((weak)) -D __declspec_thread=__thread -D __int8=char -D __int16=short -D __int32=int -D "__int64=long long" -D __WINE__ -I /opt/local/wineosx/usr/include/wine/msvcrt/ -internal-isystem /opt/local/wineosx/usr/local/include -internal-isystem /opt/local/llvm-mingw/lib/clang/14.0.0/include -internal-externc-isystem /opt/local/wineosx/usr/include -Wm -fdebug-compilation-dir=/Users/x/Dev/mt4-notify/winedll -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-signature -fwchar-type=short -fno-signed-wchar -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-subscripting-legacy-runtime -fmax-type-align=16 -fcolor-diagnostics -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o libmt4_main-oJKrwg.o -x c libmt4_main.c
warning: unknown warning option '-Wm' [-Wunknown-warning-option]
clang -cc1 version 14.0.0 based upon LLVM 14.0.0 default target arm64-apple-darwin21.3.0
ignoring nonexistent directory "/opt/local/wineosx/usr/local/include/wine/windows"
ignoring nonexistent directory "/opt/local/wineosx/usr/local/include"
ignoring nonexistent directory "/opt/local/wineosx/usr/local/include"
ignoring nonexistent directory "/opt/local/wineosx/System/Library/Frameworks"
ignoring nonexistent directory "/opt/local/wineosx/Library/Frameworks"
ignoring duplicate directory "/opt/local/wineosx/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/local/wineosx/usr/include/wine/msvcrt
 /opt/local/wineosx/usr/include/wine/windows
 /opt/local/wineosx/usr/include
 /opt/SDKs/MacOSX10.13.sdk (framework directory)
 /opt/local/llvm-mingw/lib/clang/14.0.0/include
End of search list.
In file included from libmt4_main.c:5:
/opt/local/wineosx/usr/include/wine/msvcrt/stdio.h:17:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
#include <pshpack8.h>
         ^
/opt/local/wineosx/usr/include/wine/windows/pshpack8.h:105:11: note: previous '#pragma pack' directive that modifies alignment is here
#  pragma pack(8)
          ^
In file included from libmt4_main.c:5:
/opt/local/wineosx/usr/include/wine/msvcrt/stdio.h:162:16: warning: incompatible redeclaration of library function 'fread' [-Wincompatible-library-redeclaration]
size_t __cdecl fread(void*,size_t,size_t,FILE*);
               ^
/opt/local/wineosx/usr/include/wine/msvcrt/stdio.h:162:16: note: 'fread' is a builtin with type 'unsigned long (void *, unsigned long, unsigned long, FILE *)' (aka 'unsigned long (void *, unsigned long, unsigned long, struct _iobuf *)')
/opt/local/wineosx/usr/include/wine/msvcrt/stdio.h:172:16: warning: incompatible redeclaration of library function 'fwrite' [-Wincompatible-library-redeclaration]
size_t __cdecl fwrite(const void*,size_t,size_t,FILE*);
               ^
/opt/local/wineosx/usr/include/wine/msvcrt/stdio.h:172:16: note: 'fwrite' is a builtin with type 'unsigned long (const void *, unsigned long, unsigned long, FILE *)' (aka 'unsigned long (const void *, unsigned long, unsigned long, struct _iobuf *)')
/opt/local/wineosx/usr/include/wine/msvcrt/stdio.h:312:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
#include <poppack.h>
         ^
/opt/local/wineosx/usr/include/wine/windows/poppack.h:253:13: note: previous '#pragma pack' directive that modifies alignment is here
#    pragma pack()
            ^
5 warnings generated.
/usr/local/bin/winebuild -v --target i386-apple-darwin -fno-asynchronous-unwind-tables --cc-cmd=/opt/local/bin/i386-apple-darwin-gcc --ld-cmd=/opt/local/bin/i386-apple-darwin-ld -m32 -D_REENTRANT -fPIC --dll -o libmt4native_osx_32.dll-MvniFo.spec.o -E libmt4.spec -L/opt/SDKs/MacOSX10.13.sdk/usr/lib/ -L/usr/local/lib/wine -L/usr/local/lib -- libmt4_main-oJKrwg.o /usr/local/lib/wine/libadvapi32.def /usr/local/lib/wine/libuser32.def /usr/local/lib/wine/libwinecrt0.a /usr/local/lib/wine/libkernel32.def /usr/local/lib/wine/libntdll.def
/opt/local/bin/i386-apple-darwin-gcc -xassembler -c -m32 -o libmt4native_osx_32.4ep9Qo.o libmt4native_osx_32.8VBjvh.s
/opt/local/bin/i386-apple-darwin-ld -arch i386 -r -o libmt4native_osx_32.Uoj8Uz.o libmt4native_osx_32.4ep9Qo.o libmt4_main-oJKrwg.o /usr/local/lib/wine/libwinecrt0.a
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /usr/local/lib/wine/libwinecrt0.a, building for macOS-i386 but attempting to link with file built for macOS-arm64
/opt/local/bin/i386-apple-darwin-nm -u libmt4native_osx_32.Uoj8Uz.o
sh: /opt/local/bin/i386-apple-darwin-nm: Permission denied
/opt/local/bin/i386-apple-darwin-gcc -xassembler -c -m32 -o libmt4native_osx_32.dll-MvniFo.spec.o libmt4native_osx_32.iEzPuN.s
/opt/local/bin/i386-apple-darwin-gcc -m32 -bundle -multiply_defined suppress -o libmt4native_osx_32.dll.so -L/opt/SDKs/MacOSX10.13.sdk/usr/lib/ -L/usr/local/lib/wine -L/usr/local/lib libmt4native_osx_32.dll-MvniFo.spec.o libmt4_main-oJKrwg.o /usr/local/lib/wine/libwinecrt0.a -lm -lc
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /usr/local/lib/wine/libwinecrt0.a, building for macOS-i386 but attempting to link with file built for macOS-arm64
/usr/local/bin/winebuild -v --target i386-apple-darwin -fno-asynchronous-unwind-tables --fixup-ctors libmt4native_osx_32.dll.so
Gcenx
Level 6
Level 6
Posts: 709
Joined: Mon Dec 25, 2017 12:11 pm

Re: building a native winedll on MacOS Monterey

Post by Gcenx »

Upstream wine doesn’t currently support running 32Bit windows binaries so I’m going to assume your running a third-party package.

It looks like your attempting to build a winelib dll and not an actual windows dll as there’s be no other reason to want MacOSX10.13.SDK as a pure 32Bit windows dll could simply be compiled using the relevant mingw compiler.
winegb
Level 1
Level 1
Posts: 5
Joined: Fri Apr 01, 2022 1:48 pm

Re: building a native winedll on MacOS Monterey

Post by winegb »

mt4 is running with wine32on64.
And yes I am attempting to build a winedll so that I can use native unix functions instead of just a windows dll.
I am not sure what is going wrong here.
Gcenx
Level 6
Level 6
Posts: 709
Joined: Mon Dec 25, 2017 12:11 pm

Re: building a native winedll on MacOS Monterey

Post by Gcenx »

winegb wrote: Mon Apr 11, 2022 11:11 am mt4 is running with wine32on64.
And yes I am attempting to build a winedll so that I can use native unix functions instead of just a windows dll.
I am not sure what is going wrong here.
Upstream wine doesn’t provide wine32on64 that’s part of CodeWeavets custom version of wine that’s used for CrossOver and it’s commercial ports.

It also requires using there sources along with a custom version of llvm/clang-8 to build the -mwine32 target. While I’ve built there crossover-sources “wine” I’ve not tried making my own custom winelib package that functions as 64Bit on the unix side and 32Bit on the windows PE side of the winelib dll.

You’ll need to download the corresponding crossover-sources archive and look into how they’ve done this in depth yourself, I’m not aware of anyone breaking all this down as far as making a winelib build for this custom target.

The only guide online are for compiling there llvm/clang-8 and wine sources (all based on ny instructions)
winegb
Level 1
Level 1
Posts: 5
Joined: Fri Apr 01, 2022 1:48 pm

Re: building a native winedll on MacOS Monterey

Post by winegb »

Alright. Thanks Gcenx. I'll see if I can get something out of the crossover-sources.
Locked