So now, trying to comprehend what everyone has said in the comments of this MR, `winegcc` builds PE executables on x64, but builds ELF executables on ARM64? What changes need to be made to Wine so building a DLL using `winegcc` on ARM64 works the same way as it does x64?
You can't do that, you have to build a PE dll and a separate Unix library, and use the WINE_UNIX_CALL support to call into the Unix library. This is done in the Wine tree in several places, but we don't have the tooling in place yet to do this out of tree, so there will be some manual work involved.
ELF DLLs are not supported on ARM64 because the x18 register is not reserved on the Unix side, so it's not possible to call into a Unix library without going through the Wine Unix call interface.