Wine build failure in tools/winebuild/spec16 due to recent change

Marcus Meissner marcus at jet.franken.de
Tue May 29 07:33:17 CDT 2001


On Tue, May 29, 2001 at 11:01:28AM +0200, Gerald Pfeifer wrote:
> On Mon, 21 May 2001, Marcus Meissner wrote:
> > Changelog:
> > 	In case our stat already supports 64bit operations (like FreeBSD
> > 	stat does), we don't need to stub them, we can just define the
> > 	x64 functions to x.
> > 	Thanks to Gerald Pfeifer for spotting the problem and testing this!

I have fixed the issues, the define is now in config.h.

Next try at patch is attached below.

Ciao, Marcus

Changelog:
	Drop any file64 functions, try to use system supplied 64bit mode
	by using proper defines.

Index: configure.in
===================================================================
RCS file: /home/wine/wine/configure.in,v
retrieving revision 1.201
diff -u -r1.201 configure.in
--- configure.in	2001/05/16 20:56:05	1.201
+++ configure.in	2001/05/29 12:26:30
@@ -781,7 +796,6 @@
 	ecvt \
 	finite \
 	fpclass \
-	fstat64 \
 	ftruncate64 \
 	getnetbyaddr \
 	getnetbyname \
@@ -794,7 +808,6 @@
 	inet_network \
 	lseek64 \
 	lstat \
-	lstat64 \
 	memmove \
 	mmap \
 	rfork \
@@ -802,7 +815,6 @@
 	sendmsg \
 	settimeofday \
 	sigaltstack \
-	stat64 \
 	statfs \
 	strcasecmp \
 	strerror \
@@ -879,43 +891,6 @@
 AC_TYPE_SIZE_T()
 AC_CHECK_SIZEOF(long long,0)
 
-AC_CACHE_CHECK("for off64_t",
-	wine_cv_off64_t,
-	AC_TRY_COMPILE([
-		#define _LARGEFILE64_SOURCE
-		#include <sys/types.h>
-	],[
-		off64_t testoffset;
-	],
-	wine_cv_off64_t="yes",
-	wine_cv_off64_t="no",
-	wine_cv_off64_t="yes"
-	)
-    )
-    if test "$wine_cv_off64_t" = "yes"
-    then
-        AC_DEFINE(HAVE_OFF64_T)
-    fi
-
-AC_CACHE_CHECK("for struct stat64",
-	wine_cv_struct_stat64,
-	AC_TRY_COMPILE([
-		#define _LARGEFILE64_SOURCE
-		#include <sys/types.h>
-		#include <sys/stat.h>
-	],[
-		struct stat64 tst64;
-	],
-	wine_cv_struct_stat64="yes",
-	wine_cv_struct_stat64="no",
-	wine_cv_struct_stat64="yes"
-	)
-    )
-    if test "$wine_cv_struct_stat64" = "yes"
-    then
-        AC_DEFINE(HAVE_STRUCT_STAT64)
-    fi
-
 AC_CACHE_CHECK("whether linux/input.h is for real",
 	wine_cv_linux_input_h,
 	AC_TRY_COMPILE([
Index: files/file.c
===================================================================
RCS file: /home/wine/wine/files/file.c,v
retrieving revision 1.96
diff -u -r1.96 file.c
--- files/file.c	2001/05/14 20:09:38	1.96
+++ files/file.c	2001/05/29 12:27:52
@@ -491,7 +491,7 @@
  *
  * Fill a file information from a struct stat.
  */
-static void FILE_FillInfo( struct stat64 *st, BY_HANDLE_FILE_INFORMATION *info )
+static void FILE_FillInfo( struct stat *st, BY_HANDLE_FILE_INFORMATION *info )
 {
     if (S_ISDIR(st->st_mode))
         info->dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
@@ -524,9 +524,9 @@
  */
 BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info )
 {
-    struct stat64 st;
+    struct stat st;
 
-    if (lstat64( unixName, &st ) == -1)
+    if (lstat( unixName, &st ) == -1)
     {
         FILE_SetDosError();
         return FALSE;
@@ -536,7 +536,7 @@
     {
         /* do a "real" stat to find out
 	   about the type of the symlink destination */
-        if (stat64( unixName, &st ) == -1)
+        if (stat( unixName, &st ) == -1)
         {
             FILE_SetDosError();
             return FALSE;
@@ -2010,9 +2015,7 @@
 BOOL WINAPI MoveFileA( LPCSTR fn1, LPCSTR fn2 )
 {
     DOS_FULL_NAME full_name1, full_name2;
-    /* Even though we do not need the size, stat will fail for large files, 
-     * so we need to use stat64 here. */
-    struct stat64 fstat;
+    struct stat fstat;
 
 
     TRACE("(%s,%s)\n", fn1, fn2 );
@@ -2033,7 +2036,7 @@
     }
       else return TRUE;
     else /*copy */ {
-      if (stat64(  full_name1.long_name, &fstat ))
+      if (stat(  full_name1.long_name, &fstat ))
 	{
 	  WARN("Invalid source file %s\n",
 			full_name1.long_name);
Index: include/acconfig.h
===================================================================
RCS file: /home/wine/wine/include/acconfig.h,v
retrieving revision 1.39
diff -u -r1.39 acconfig.h
--- include/acconfig.h	2001/05/16 20:56:06	1.39
+++ include/acconfig.h	2001/05/29 12:28:02
@@ -3,6 +3,12 @@
  * defined in the 'configure' script.
  */
 
+/* This is for glibc on Linux, it will turn on 64 bit file support on compile
+ * time */
+#define _FILE_OFFSET_BITS 64
+
+ at TOP@
+
 /* Define if .type asm directive must be inside a .def directive */
 #undef NEED_TYPE_IN_DEF
 
@@ -125,9 +134,3 @@
 
 /* Define if FreeType 2 is installed */
 #undef HAVE_FREETYPE
-
-/* Define if we have 64 bit file offsets */
-#undef HAVE_OFF64_T
-
-/* Define if we have struct stat64 */
-#undef HAVE_STRUCT_STAT64
Index: include/wine/port.h
===================================================================
RCS file: /home/wine/wine/include/wine/port.h,v
retrieving revision 1.12
diff -u -r1.12 port.h
--- include/wine/port.h	2001/05/16 19:45:34	1.12
+++ include/wine/port.h	2001/05/29 12:28:22
@@ -6,8 +6,6 @@
 #ifndef __WINE_WINE_PORT_H
 #define __WINE_WINE_PORT_H
 
-#define _LARGEFILE64_SOURCE	/* for glibc 64 bit file functions */
-
 #include "config.h"
 #include "winnt.h"
 #include <fcntl.h>
@@ -132,54 +130,8 @@
 #ifndef S_ISLNK
 #define S_ISLNK(mod) (0)
 #endif /* S_ISLNK */
-
-#ifndef HAVE_OFF64_T
-# if SIZEOF_LONG_LONG > 0 
-typedef long long off64_t;
-# else
-typedef long off64_t;
-# endif
-#endif
-
-#ifndef HAVE_STRUCT_STAT64
-/* This does not convert all struct members to 64bit, only size. */
-struct stat64 {
-    dev_t         st_dev;      /* device */
-    ino_t         st_ino;      /* inode */
-    mode_t        st_mode;     /* protection */
-    nlink_t       st_nlink;    /* number of hard links */
-    uid_t         st_uid;      /* user ID of owner */
-    gid_t         st_gid;      /* group ID of owner */
-    dev_t         st_rdev;     /* device type (if inode device) */
-    off64_t       st_size;     /* total size, in bytes */
-    unsigned long st_blksize;  /* blocksize for filesystem I/O */
-    unsigned long st_blocks;   /* number of blocks allocated */
-    time_t        st_atime;    /* time of last access */
-    time_t        st_mtime;    /* time of last modification */
-    time_t        st_ctime;    /* time of last change */
-};
-#endif
-
-#ifndef HAVE_LSEEK64
-extern off64_t lseek64(int fildes, off64_t offset, int whence);
-#endif
-
-#ifndef HAVE_STAT64
-extern int stat64(const char *file_name, struct stat64 *buf);
-#endif
-
-#ifndef HAVE_LSTAT64
-extern int lstat64(const char *file_name, struct stat64 *buf);
-#endif
-
-#ifndef HAVE_FSTAT64
-extern int fstat64(int fd, struct stat64 *buf);
-#endif
-
-#ifndef HAVE_FTRUNCATE64
-extern int ftruncate64(int fd, off64_t offset);
-#endif
 
+/* So we open files in 64 bit access mode on Linux */
 #ifndef O_LARGEFILE
 # define O_LARGEFILE 0
 #endif
Index: library/port.c
===================================================================
RCS file: /home/wine/wine/library/port.c,v
retrieving revision 1.12
diff -u -r1.12 port.c
--- library/port.c	2001/05/16 19:45:34	1.12
+++ library/port.c	2001/05/29 12:28:23
@@ -389,94 +389,6 @@
 }
 #endif /* HAVE_LSTAT */
 
-#if !defined(HAVE_STAT64) || !defined(HAVE_LSTAT64) || !defined(HAVE_FSTAT64)
-static void _convert_stat_stat64(struct stat64 *stto,struct stat *stfrom)
-{
-    stto->st_dev     = stfrom->st_dev;
-    stto->st_ino     = stfrom->st_ino;
-    stto->st_mode    = stfrom->st_mode;
-    stto->st_nlink   = stfrom->st_nlink;
-    stto->st_uid     = stfrom->st_uid;
-    stto->st_gid     = stfrom->st_gid;
-    stto->st_rdev    = stfrom->st_rdev;
-    stto->st_blksize = stfrom->st_blksize;
-    stto->st_blocks  = stfrom->st_blocks;
-    stto->st_atime   = stfrom->st_atime;
-    stto->st_mtime   = stfrom->st_mtime;
-    stto->st_ctime   = stfrom->st_ctime;
-    stto->st_size    = (off64_t)stfrom->st_size;
-}
-#endif  /* HAVE_STAT64 || HAVE_LSTAT64 || HAVE_FSTAT64 */
-
-/***********************************************************************
- *		stat64
- */
-#ifndef HAVE_STAT64
-int stat64(const char *file_name, struct stat64 *buf)
-{
-    struct stat stbuf;
-    int res = stat(file_name,&stbuf);
-    _convert_stat_stat64(buf,&stbuf);
-    return res;
-}
-#endif /* HAVE_STAT64 */
-
-/***********************************************************************
- *		lstat64
- */
-#ifndef HAVE_LSTAT64
-int lstat64(const char *file_name, struct stat64 *buf)
-{
-    struct stat stbuf;
-    int res = lstat(file_name,&stbuf);
-    _convert_stat_stat64(buf,&stbuf);
-    return res;
-}
-#endif /* HAVE_LSTAT64 */
-
-/***********************************************************************
- *		fstat64
- */
-#ifndef HAVE_FSTAT64
-int fstat64(int fd, struct stat64 *buf)
-{
-    struct stat stbuf;
-    int res = fstat(fd,&stbuf);
-    _convert_stat_stat64(buf,&stbuf);
-    return res;
-}
-#endif /* HAVE_FSTAT */
-
-/***********************************************************************
- *		lseek64
- */
-#ifndef HAVE_LSEEK64
-off64_t lseek64(int fd, off64_t where, int whence)
-{
-    off_t res;
-    if ((where >= 0x8000000LL)  || ( where <= -0x7fffffffLL)) {
-	errno = EFBIG; /* FIXME: hack */
-	return -1;
-    }
-
-    res = lseek(fd,(off_t)where,whence);
-    return (off64_t)res;
-}
-#endif /* HAVE_LSEEK64 */
-
-/***********************************************************************
- *		ftruncate64
- */
-#ifndef HAVE_FTRUNCATE64
-int ftruncate64(int fd, off64_t where)
-{
-    if ((where >= 0x8000000LL)  || ( where <= -0x7fffffffLL)) {
-	errno = EFBIG; /* FIXME: hack */
-	return -1;
-    }
-    return ftruncate(fd,(off_t)where);
-}
-#endif /* HAVE_LSEEK64 */
 /***********************************************************************
  *		getrlimit
  */
Index: server/file.c
===================================================================
RCS file: /home/wine/wine/server/file.c,v
retrieving revision 1.40
diff -u -r1.40 file.c
--- server/file.c	2001/05/14 20:09:39	1.40
+++ server/file.c	2001/05/29 12:28:47
@@ -259,11 +261,11 @@
 
 static int file_get_info( struct object *obj, struct get_file_info_request *req )
 {
-    struct stat64 st;
+    struct stat st;
     struct file *file = (struct file *)obj;
     assert( obj->ops == &file_ops );
 
-    if (fstat64( file->obj.fd, &st ) == -1)
+    if (fstat( file->obj.fd, &st ) == -1)
     {
         file_set_error();
         return 0;
@@ -343,12 +345,12 @@
 static int set_file_pointer( handle_t handle, unsigned int *low, int *high, int whence )
 {
     struct file *file;
-    off64_t result,xto;
+    off_t result,xto;
 
-    xto = *low+((off64_t)*high<<32);
+    xto = *low+((off_t)*high<<32);
     if (!(file = get_file_obj( current->process, handle, 0 )))
         return 0;
-    if ((result = lseek64(file->obj.fd,xto,whence))==-1)
+    if ((result = lseek(file->obj.fd,xto,whence))==-1)
     {
         /* Check for seek before start of file */
 
@@ -370,17 +372,18 @@
 static int truncate_file( handle_t handle )
 {
     struct file *file;
-    off64_t result;
+    off_t result;
 
     if (!(file = get_file_obj( current->process, handle, GENERIC_WRITE )))
         return 0;
-    if (((result = lseek64( file->obj.fd, 0, SEEK_CUR )) == -1) ||
-        (ftruncate64( file->obj.fd, result ) == -1))
+    if (((result = lseek( file->obj.fd, 0, SEEK_CUR )) == -1) ||
+        (ftruncate( file->obj.fd, result ) == -1))
     {
         file_set_error();
         release_object( file );
         return 0;
     }
+    fprintf(stderr,"server:truncated to %Ld\n",result);
     release_object( file );
     return 1;
 }
@@ -388,16 +391,16 @@
 /* try to grow the file to the specified size */
 int grow_file( struct file *file, int size_high, int size_low )
 {
-    struct stat64 st;
-    off64_t size = size_low + (((off64_t)size_high)<<32);
+    struct stat st;
+    off_t size = size_low + (((off_t)size_high)<<32);
 
-    if (fstat64( file->obj.fd, &st ) == -1)
+    if (fstat( file->obj.fd, &st ) == -1)
     {
         file_set_error();
         return 0;
     }
     if (st.st_size >= size) return 1;  /* already large enough */
-    if (ftruncate64( file->obj.fd, size ) != -1) return 1;
+    if (ftruncate( file->obj.fd, size ) != -1) return 1;
     file_set_error();
     return 0;
 }
Index: win32/file.c
===================================================================
RCS file: /home/wine/wine/win32/file.c,v
retrieving revision 1.27
diff -u -r1.27 file.c
--- win32/file.c	2001/05/18 23:18:25	1.27
+++ win32/file.c	2001/05/29 12:28:55
@@ -57,7 +57,7 @@
  */
 BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes)
 {
-    struct stat64 buf;
+    struct stat buf;
     DOS_FULL_NAME full_name;
 
     if (!DOSFS_GetFullName( lpFileName, TRUE, &full_name ))
@@ -70,7 +70,7 @@
         FIXME("(%s):%lx illegal combination with FILE_ATTRIBUTE_NORMAL.\n",
 	      lpFileName,attributes);
     }
-    if(stat64(full_name.long_name,&buf)==-1)
+    if(stat(full_name.long_name,&buf)==-1)
     {
         FILE_SetDosError();
         return FALSE;




More information about the wine-patches mailing list