Hi WineHQ,
I have an older library that i have create using winelib (and an application that uses it). It use to work fine. In later wine builds this does not work any more.
I have tried allot of different combinations, and i cannot seem to get was has broken.
1) Every time a call is made into the library the program crashes immediately. 2) If i compile all the files into one program from the beginning the program works fine. 3) Using "winemaker" to create a library and app shows the exact same problem. 4) It seems to be related to importing the library or maybe the calling convention?
I have a feeling this is just broken somewhere, or have i done something wrong all along, and first now do i get punished for it because something changed? Again, winemaker shows the exact same problem.
I created a simple library setup to test it (a tiny lib and tine app):
commands:
winegcc -Wall -Werror -mwindows -mno-cygwin -fPIC -g -O0 -c lib.c -o lib.o winegcc -Wall -Werror -mwindows -mno-cygwin -fPIC -g -O0 -c test.c -o test.o winegcc -shared -olibtest.so lib.o -mwindows -mno-cygwin winegcc -Wl,-rpath,"$ORIGIN" -mwindows -mno-cygwin -ltest -L. test.o -otest.exe
---
lib.c (library):
#include <stdio.h> #include <stdlib.h>
void lib_call(void) { printf("oh\n"); exit(0); }
---
test.c (app):
#include <windows.h>
extern void lib_call(void);
INT WINAPI WinMain(HINSTANCE inst, HINSTANCE prev_inst, PSTR cmd_line, INT cmd_show) { lib_call(); return 0; }
---
Can anyone figure this out. I would be very thankful.
Thanks,
/pedro
BTW: my setup is:
uname -a Linux localhost.localdomain 5.10.15-100.fc32.x86_64 #1 SMP Wed Feb 10 17:52:05 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
wine --version wine-6.2 (Staging)
Thanks,
/pedro
Den fre. 5. mar. 2021 kl. 16.35 skrev Peter Dons Tychsen < donpedro.list@gmail.com>:
Hi WineHQ,
I have an older library that i have create using winelib (and an application that uses it). It use to work fine. In later wine builds this does not work any more.
I have tried allot of different combinations, and i cannot seem to get was has broken.
- Every time a call is made into the library the program crashes
immediately. 2) If i compile all the files into one program from the beginning the program works fine. 3) Using "winemaker" to create a library and app shows the exact same problem. 4) It seems to be related to importing the library or maybe the calling convention?
I have a feeling this is just broken somewhere, or have i done something wrong all along, and first now do i get punished for it because something changed? Again, winemaker shows the exact same problem.
I created a simple library setup to test it (a tiny lib and tine app):
commands:
winegcc -Wall -Werror -mwindows -mno-cygwin -fPIC -g -O0 -c lib.c -o lib.o winegcc -Wall -Werror -mwindows -mno-cygwin -fPIC -g -O0 -c test.c -o test.o winegcc -shared -olibtest.so lib.o -mwindows -mno-cygwin winegcc -Wl,-rpath,"$ORIGIN" -mwindows -mno-cygwin -ltest -L. test.o -otest.exe
lib.c (library):
#include <stdio.h> #include <stdlib.h>
void lib_call(void) { printf("oh\n"); exit(0); }
test.c (app):
#include <windows.h>
extern void lib_call(void);
INT WINAPI WinMain(HINSTANCE inst, HINSTANCE prev_inst, PSTR cmd_line, INT cmd_show) { lib_call(); return 0; }
Can anyone figure this out. I would be very thankful.
Thanks,
/pedro
Hello again,
It smells a bit like, but this time for libraries and not executables:
https://bugs.winehq.org/show_bug.cgi?id=50731 https://bugs.winehq.org/show_bug.cgi?id=50755
But that is first broken in 6.3 and i am running 6.2.
And again, it only breaks for winelib created libs and not executables.
Thanks,
/pedro
Den fre. 5. mar. 2021 kl. 16.49 skrev Peter Dons Tychsen < donpedro.list@gmail.com>:
BTW: my setup is:
uname -a Linux localhost.localdomain 5.10.15-100.fc32.x86_64 #1 SMP Wed Feb 10 17:52:05 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
wine --version wine-6.2 (Staging)
Thanks,
/pedro
Den fre. 5. mar. 2021 kl. 16.35 skrev Peter Dons Tychsen < donpedro.list@gmail.com>:
Hi WineHQ,
I have an older library that i have create using winelib (and an application that uses it). It use to work fine. In later wine builds this does not work any more.
I have tried allot of different combinations, and i cannot seem to get was has broken.
- Every time a call is made into the library the program crashes
immediately. 2) If i compile all the files into one program from the beginning the program works fine. 3) Using "winemaker" to create a library and app shows the exact same problem. 4) It seems to be related to importing the library or maybe the calling convention?
I have a feeling this is just broken somewhere, or have i done something wrong all along, and first now do i get punished for it because something changed? Again, winemaker shows the exact same problem.
I created a simple library setup to test it (a tiny lib and tine app):
commands:
winegcc -Wall -Werror -mwindows -mno-cygwin -fPIC -g -O0 -c lib.c -o lib.o winegcc -Wall -Werror -mwindows -mno-cygwin -fPIC -g -O0 -c test.c -o test.o winegcc -shared -olibtest.so lib.o -mwindows -mno-cygwin winegcc -Wl,-rpath,"$ORIGIN" -mwindows -mno-cygwin -ltest -L. test.o -otest.exe
lib.c (library):
#include <stdio.h> #include <stdlib.h>
void lib_call(void) { printf("oh\n"); exit(0); }
test.c (app):
#include <windows.h>
extern void lib_call(void);
INT WINAPI WinMain(HINSTANCE inst, HINSTANCE prev_inst, PSTR cmd_line, INT cmd_show) { lib_call(); return 0; }
Can anyone figure this out. I would be very thankful.
Thanks,
/pedro
Peter Dons Tychsen donpedro.list@gmail.com writes:
Hi WineHQ,
I have an older library that i have create using winelib (and an application that uses it). It use to work fine. In later wine builds this does not work any more.
I have tried allot of different combinations, and i cannot seem to get was has broken.
- Every time a call is made into the library the program crashes immediately.
- If i compile all the files into one program from the beginning the program works fine.
- Using "winemaker" to create a library and app shows the exact same problem.
- It seems to be related to importing the library or maybe the calling convention?
I have a feeling this is just broken somewhere, or have i done something wrong all along, and first now do i get punished for it because something changed? Again, winemaker shows the exact same problem.
Because of the loader changes needed to support PE builtins, importing a Winelib library directly at the Unix level is currently broken. It may be reimplemented at some point, but that's not trivial.
You can still link to a library at the Unix level (as opposed to building an import library and linking to that), but you have to tell Wine explicitly about the loaded library. This can be done by adding a LoadLibraryA("libtest.so") at the start of your app.