Trouble building a 64-bit Winelib DLL on OpenSUSE

Questions about Wine on Linux
Locked
aleithner
Newbie
Newbie
Posts: 2
Joined: Thu Oct 03, 2024 12:36 pm

Trouble building a 64-bit Winelib DLL on OpenSUSE

Post by aleithner »

(I have previously asked about this on OpenSUSE's forums, but have been told to ask here instead.)

I’m currently working on a project which led me to re-implement a specific DLL using Wine. To be able to compile the C code with the coresponding .spec file into both a 32-bit and a 64-bit shared object capable of being loaded from Wine processes, I have installed the following packages on my OpenSUSE Tumbleweed machine:
  • wine
  • wine-32bit
  • wine-devel
  • wine-devel-32bit
However, so far I have only been able to compile my project as a 32-bit shared object using

Code: Select all

winegcc -m32 -L/usr/lib64/wine/i386-unix -shared -o myproject.dll myproject_main.c myproject.spec
The myproject.dll.so works and 32-bit Wine processes can load and execute it with no problem. If I instead try to compile using

Code: Select all

winegcc -L/usr/lib64/wine/x86_64-unix -shared -o myproject64.dll myproject_main.c myproject.spec
I’m facing the following output of winegcc:

Code: Select all

/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -ladvapi32: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -luser32: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -lwinecrt0: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -lkernel32: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -lntdll: No such file or directory
collect2: error: ld returned 1 exit status
winegcc: /usr/bin/gcc failed
(I have found specifying -L/usr/lib64/wine/i386-unix in the 32-bit variant to be mandatory because even winegcc did not pick up Wine’s library path.)

I suspect this is because /usr/lib64/wine/x86_64-unix is missing all of the above archive files (e.g. libkernel32.a), but /usr/lib/wine/i386-unix has these archive files. Trying to use the archive files from /usr/lib64/wine/x86_64-windows instead, LD complains it cannot link between ELF and PE binaries:

Code: Select all

/usr/bin/ld: relocatable linking with relocations from format pe-x86-64 (/usr/lib64/wine/x86_64-windows/libwinecrt0.a(debug.o)) to format elf64-x86-64 (tmp66fd686a/myproject64-00000001.spec-00000001.o) is not supported
winebuild: /usr/bin/ld failed with status 1
winegcc: /usr/bin/winebuild failed
No matter what packages I install, I cannot get compiling 64-bit “DLLs” to work (wine-wow64-devel is missing even the 32-bit archive files). And as pointed out on the OpenSUSE Forums post I've linked to above, when building the above mentioned packages no files are removed from or added to /usr/lib64/wine/x86_64-unix.

I feel like I should be able to compile my project as a 64-bit binary (I’m on a 64-bit machine). Is this assumption wrong, am I doing something wrong or are the packages missing some files?

I’d be grateful for any advice as I’ve been stuck in this situation for quite a while now.
aleithner
Newbie
Newbie
Posts: 2
Joined: Thu Oct 03, 2024 12:36 pm

Re: Trouble building a 64-bit Winelib DLL on OpenSUSE

Post by aleithner »

I've asked about this on StackOverflow too, but to no avail. Is there really no expertise on this problem, neither here nor over on SO?
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Trouble building a 64-bit Winelib DLL on OpenSUSE

Post by dimesio »

Try asking on the wine developer's mailing list.
Locked