Hi,
I've tried to get wine to compile under a 2.2.17 kernel machine (w/ RedHat 7.0), not particularly because of Stefan's problems under RH-5.2, but trying to track down some other bugs (although hopefully the patches will help a little :)
The first stumbling block was in dlls/ntdll/cdrom.c. Two routines in the file try to set members of the cdrom_generic_command structure (defined in linux/cdrom.h) that don't exist in 2.2.x kernels, but do exist in 2.4.x kernels.
The attached patch adds configure checks for these structure members and puts "#ifdef"s around the assignments in dlls/ntdll/cdrom.c . I don't know the knock-on effects for not setting these values, but presumably getting something to work is better than wine not compiling :)
On a point of style, should there be one test for these two structure members, or two independent tests? The members appear in the kernel at the same time (2.2.x -> 2.4.0)
ChangeLog: Towards fixing compilation under 2.2.x kernels
NB both configure and include/config.h.in need to be regenerated.
... but, the problems didn't stop there. The compilation continues until it starts to use wmc, which core-dumps on the /second/ usage.
------------------------[ Compilation log ]--------------------------- [...] make[2]: Leaving directory `/scratch/remus1/paulm/wine/dlls/ntdll' rm -f ntdll.dll.so && ln -s ntdll/ntdll.dll.so ntdll.dll.so rm -f libntdll.dll.so && ln -s ntdll/ntdll.dll.so libntdll.dll.so make[2]: Entering directory `/scratch/remus1/paulm/wine/dlls/kernel' LD_LIBRARY_PATH="../../library:../../unicode:$LD_LIBRARY_PATH" ../../tools/wmc/wmc -i -H /dev/null -o messages/winerr_enu.mc.rc messages/winerr_enu.mc DEBUG: setting up handler DEBUG: getting time DEBUG: cmdlen=72 LD_LIBRARY_PATH="../../library:../../unicode:$LD_LIBRARY_PATH" ../../tools/wrc/wrc -I. -I. -I../../include -I../../include -o kernel.res -r kernel.rc make[2]: *** [kernel.res] Segmentation fault (core dumped) make[2]: Leaving directory `/scratch/remus1/paulm/wine/dlls/kernel' make[1]: *** [kernel/kernel32.dll.so] Error 2 make[1]: Leaving directory `/scratch/remus1/paulm/wine/dlls' make: *** [dlls] Error 2 [paulm@mowgli wine]$ ------------------------------[ End of log ]-------------------------
The DEBUG output above was from the following patch:
--- wmc.c 10 Mar 2002 00:24:24 -0000 1.3 +++ wmc.c 11 May 2002 19:49:33 -0000 @@ -125,8 +125,10 @@ int i; int cmdlen;
+ printf( "DEBUG: setting up handler\n"); signal(SIGSEGV, segvhandler);
+ printf( "DEBUG: getting time\n"); now = time(NULL);
/* First rebuild the commandline to put in destination */ @@ -134,6 +136,7 @@ cmdlen = 4; /* for "wmc " */ for(i = 1; i < argc; i++) cmdlen += strlen(argv[i]) + 1; + printf( "DEBUG: cmdlen=%u\n", cmdlen); cmdline = (char *)xmalloc(cmdlen); strcpy(cmdline, "wmc "); for(i = 1; i < argc; i++)
so, wmc is crashing before it is running main(), suggesting some linking problem? The machine is running glibc 2.2.4 (via RedHat RPM glibc-2.2.4-18.7.0.3) and I was compiling with the alleged "v2.96" release of gcc (RPM gcc-2.96-85).
Any ideas?
Cheers,
---- Paul Millar