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
Index: configure.ac =================================================================== RCS file: /home/wine/wine/configure.ac,v retrieving revision 1.37 diff -u -r1.37 configure.ac --- configure.ac 12 May 2002 03:16:39 -0000 1.37 +++ configure.ac 12 May 2002 13:19:43 -0000 @@ -1079,6 +1079,40 @@ fi fi +dnl **** cdrom IOCTL checks **** +AC_CACHE_CHECK( [whether cdrom_generic_command in linux/cdrom.h defines quiet], + wine_cdrom_linux_cdrom_has_quiet, + AC_TRY_COMPILE([ + #include <linux/cdrom.h> + ],[ + struct cdrom_generic_command gen_command; + + gen_command.quiet = 0; + ],wine_cdrom_linux_cdrom_has_quiet=yes,wine_cdrom_linux_cdrom_has_quiet=no + ) +) +if test "$wine_cdrom_linux_cdrom_has_quiet" = "yes" +then + AC_DEFINE(CDROM_GENERIC_COMMAND_HAS_QUIET, 1, + [Define if the cdrom_generic_command struct defined by <sys/vfs.h> has the member quiet]) +fi +AC_CACHE_CHECK( [whether cdrom_generic_command in linux/cdrom.h defines timeout], + wine_cdrom_linux_cdrom_has_timeout, + AC_TRY_COMPILE([ + #include <linux/cdrom.h> + ],[ + struct cdrom_generic_command gen_command; + + gen_command.timeout = 0; + ],wine_cdrom_linux_cdrom_has_timeout=yes,wine_cdrom_linux_cdrom_has_timeout=no + ) +) +if test "$wine_cdrom_linux_cdrom_has_timeout" = "yes" +then + AC_DEFINE(CDROM_GENERIC_COMMAND_HAS_TIMEOUT, 1, + [Define if the cdrom_generic_command struct defined by <sys/vfs.h> has the member timeout]) +fi + dnl **** statfs checks **** if test "$ac_cv_header_sys_vfs_h" = "yes" Index: dlls/ntdll/cdrom.c =================================================================== RCS file: /home/wine/wine/dlls/ntdll/cdrom.c,v retrieving revision 1.9 diff -u -r1.9 cdrom.c --- dlls/ntdll/cdrom.c 1 May 2002 22:25:42 -0000 1.9 +++ dlls/ntdll/cdrom.c 12 May 2002 13:19:43 -0000 @@ -1057,8 +1057,12 @@ cmd.buffer = pPacket->DataBuffer; cmd.buflen = pPacket->DataTransferLength; cmd.sense = &sense; +#ifdef CDROM_GENERIC_COMMAND_HAS_QUIET cmd.quiet = 0; +#endif +#ifdef CDROM_GENERIC_COMMAND_HAS_TIMEOUT cmd.timeout = pPacket->TimeOutValue*HZ; +#endif switch (pPacket->DataIn) { @@ -1128,8 +1132,12 @@ } cmd.buflen = pPacket->DataTransferLength; cmd.sense = &sense; +#ifdef CDROM_GENERIC_COMMAND_HAS_QUIET cmd.quiet = 0; +#endif +#ifdef CDROM_GENERIC_COMMAND_HAS_TIMEOUT cmd.timeout = pPacket->TimeOutValue*HZ; +#endif switch (pPacket->DataIn) {