public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH roland/off64_t] clean up wordsize-64 off_t functions
@ 2012-08-02 17:21 Roland McGrath
  2012-08-02 18:14 ` Chris Metcalf
  2012-08-02 20:46 ` Joseph S. Myers
  0 siblings, 2 replies; 15+ messages in thread
From: Roland McGrath @ 2012-08-02 17:21 UTC (permalink / raw)
  To: libc-alpha, libc-ports

This gets rid of the sysdeps/wordsize-64 files that exist for the case
of off_t matching off64_t.  I've added a macro to bits/typesizes.h,
__OFF_T_MATCHES_OFF64_T.  This indicates that off_t and off64_t are
really the same width, even if they have incompatible source types (like
off_t reducing to 'long int' and off64_t reducing to 'long long int').

I've verified that this makes no difference in the x86_64-linux-gnu
build.  It needs testing (or just eyeball sign-off) for sparc(64),
s390(x), and alpha, and perhaps for x32.

If there are any linux-generic configurations where off_t matches off64_t,
i.e. __SLONGWORD_TYPE matches __SQUAD_TYPE (tilegx64?), then that will need
some additional attention too.  I'm not sure how best to handle that.
It would be nice not to add another bits/typesizes.h, but it may be
unavoidable unless every such machine predefines __LP64__ or something
like that.  In trunk GCC it looks like that is done generically, but I
don't know if all relevant GCC versions did that.

ia64 and powerpc64 don't have their own bits/typesizes.h files.  So some
more work will be required there too and again I'm not entirely sure
what's best to do.  We can make the generic bits/typesizes.h test
__LP64__, but I'm not positive that all compiler versions that we
support for those targets defined that.  (Note that here we have to be
concerned with all compilers that we support for building applications
with libc headers, not just the compilers we support for building libc
itself.)

There is a lot more such consolidation that could be done to get rid of
code in sysdeps/unix/sysv/linux/wordsize-64.  But I am not planning to
tackle that myself any time soon.  If someone else wants to take it up,
that would be great.

I think the reduction in hair and code duplication done here is good.
It's been mentioned before that wordsize-64 conflates too many concepts
and paring it down to just mean "'long int' is 64 bits" seems good in
its own right.  But my own motivation for this now is to support new
configurations where 'long int' is 32 bits but off_t is 64 bits.


Thanks,
Roland


2012-08-02  Roland McGrath  <roland@hack.frob.com>

	* libio/fseeko.c [__OFF_T_MATCHES_OFF64_T]:
	Define fseeko64 as an alias.
	* libio/ftello.c [__OFF_T_MATCHES_OFF64_T]:
	Define ftello64 as an alias.
	* libio/iofgetpos.c [__OFF_T_MATCHES_OFF64_T]:
	Define _IO_fgetpos64 and fgetpos64 as aliases.
	* libio/iofsetpos.c [__OFF_T_MATCHES_OFF64_T]:
	Define _IO_fsetpos64 and fsetpos64 as aliases.
	* libio/fseeko64.c [!__OFF_T_MATCHES_OFF64_T]:
	Conditionalize body on this.
	* libio/ftello64.c: Likewise.
	* libio/iofgetpos64.c: Likewise.
	* libio/iofsetpos64.c: Likewise.
	* sysdeps/wordsize-64/fseeko.c: File removed.
	* sysdeps/wordsize-64/fseeko64.c: File removed.
	* sysdeps/wordsize-64/ftello.c: File removed.
	* sysdeps/wordsize-64/ftello64.c: File removed.
	* sysdeps/wordsize-64/iofgetpos.c: File removed.
	* sysdeps/wordsize-64/iofgetpos64.c: File removed.
	* sysdeps/wordsize-64/iofsetpos.c: File removed.
	* sysdeps/wordsize-64/iofsetpos64.c: File removed.

	* sysdeps/unix/sysv/linux/s390/bits/typesizes.h:
	[__s390x__] (__OFF_T_MATCHES_OFF64_T): New macro.
	* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
	[defined __arch64__ || defined __sparcv9]
	(__OFF_T_MATCHES_OFF64_T): New macro.
	* sysdeps/unix/sysv/linux/x86/bits/typesizes.h
	[__x86_64__] (__OFF_T_MATCHES_OFF64_T): New macro.
	* sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
	(__OFF_T_MATCHES_OFF64_T): New macro.

ports/ChangeLog.alpha
2012-08-02  Roland McGrath  <roland@hack.frob.com>

	* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
	(__OFF_T_MATCHES_OFF64_T): New macro.


diff --git a/libio/fseeko.c b/libio/fseeko.c
index 7a70636..6d37aea 100644
--- a/libio/fseeko.c
+++ b/libio/fseeko.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995,1996,1997,1998,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -40,3 +40,7 @@ fseeko (fp, offset, whence)
   _IO_release_lock (fp);
   return result;
 }
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (fseeko, fseeko64)
+#endif
diff --git a/libio/fseeko64.c b/libio/fseeko64.c
index 2291f61..9fbe308 100644
--- a/libio/fseeko64.c
+++ b/libio/fseeko64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1995,1996,1997,1998,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +28,9 @@
 #include "libioP.h"
 #include "stdio.h"
 
+/* fseeko.c defines this as an alias if __OFF_T_MATCHES_OFF64_T.  */
+#ifndef __OFF_T_MATCHES_OFF64_T
+
 int
 fseeko64 (fp, offset, whence)
      _IO_FILE* fp;
@@ -46,3 +49,5 @@ fseeko64 (fp, offset, whence)
   return -1;
 #endif
 }
+
+#endif
diff --git a/libio/ftello.c b/libio/ftello.c
index 1d85bc6..9052276 100644
--- a/libio/ftello.c
+++ b/libio/ftello.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004, 2007
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -63,3 +62,7 @@ ftello (fp)
   return pos;
 }
 libc_hidden_def (ftello)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (ftello, ftello64)
+#endif
diff --git a/libio/ftello64.c b/libio/ftello64.c
index 0f70c66..852ef71 100644
--- a/libio/ftello64.c
+++ b/libio/ftello64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -30,6 +29,7 @@
 #include <libioP.h>
 #include <errno.h>
 
+#ifndef __OFF_T_MATCHES_OFF64_T
 
 off64_t
 ftello64 (fp)
@@ -60,3 +60,5 @@ ftello64 (fp)
   return -1;
 #endif
 }
+
+#endif
diff --git a/libio/iofgetpos.c b/libio/iofgetpos.c
index 4338b50..a1d6bb6 100644
--- a/libio/iofgetpos.c
+++ b/libio/iofgetpos.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +24,17 @@
    This exception applies to code released by its copyright holders
    in files containing the exception.  */
 
+/* We need to avoid the header declarations of these, because
+   the types don't match _IO_fgetpos and then the compiler will
+   complain about the mismatch when we do the alias below.  */
+#define _IO_new_fgetpos64 __renamed__IO_new_fgetpos64
+#define _IO_fgetpos64 __renamed__IO_fgetpos64
+
 #include "libioP.h"
+
+#undef _IO_new_fgetpos64
+#undef _IO_fgetpos64
+
 #include <errno.h>
 #include <stdlib.h>
 #include <shlib-compat.h>
@@ -78,3 +87,10 @@ _IO_new_fgetpos (fp, posp)
 strong_alias (_IO_new_fgetpos, __new_fgetpos)
 versioned_symbol (libc, _IO_new_fgetpos, _IO_fgetpos, GLIBC_2_2);
 versioned_symbol (libc, __new_fgetpos, fgetpos, GLIBC_2_2);
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (_IO_new_fgetpos, _IO_new_fgetpos64)
+strong_alias (_IO_new_fgetpos64, __new_fgetpos64)
+versioned_symbol (libc, _IO_new_fgetpos64, _IO_fgetpos64, GLIBC_2_2);
+versioned_symbol (libc, __new_fgetpos64, fgetpos64, GLIBC_2_2);
+#endif
diff --git a/libio/iofgetpos64.c b/libio/iofgetpos64.c
index 0cb141b..9755c32 100644
--- a/libio/iofgetpos64.c
+++ b/libio/iofgetpos64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2001, 2002, 2003, 2004
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -29,6 +28,7 @@
 #include <errno.h>
 #include <shlib-compat.h>
 
+#ifndef __OFF_T_MATCHES_OFF64_T
 
 int
 _IO_new_fgetpos64 (fp, posp)
@@ -75,3 +75,5 @@ _IO_new_fgetpos64 (fp, posp)
 strong_alias (_IO_new_fgetpos64, __new_fgetpos64)
 versioned_symbol (libc, _IO_new_fgetpos64, _IO_fgetpos64, GLIBC_2_2);
 versioned_symbol (libc, __new_fgetpos64, fgetpos64, GLIBC_2_2);
+
+#endif
diff --git a/libio/iofsetpos.c b/libio/iofsetpos.c
index 19bea3b..5e8d444 100644
--- a/libio/iofsetpos.c
+++ b/libio/iofsetpos.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +24,17 @@
    This exception applies to code released by its copyright holders
    in files containing the exception.  */
 
+/* We need to avoid the header declarations of these, because
+   the types don't match _IO_fsetpos and then the compiler will
+   complain about the mismatch when we do the alias below.  */
+#define _IO_new_fsetpos64 __renamed__IO_new_fsetpos64
+#define _IO_fsetpos64 __renamed__IO_fsetpos64
+
 #include <libioP.h>
+
+#undef _IO_new_fsetpos64
+#undef _IO_fsetpos64
+
 #include <errno.h>
 #include <shlib-compat.h>
 
@@ -63,3 +72,10 @@ _IO_new_fsetpos (fp, posp)
 strong_alias (_IO_new_fsetpos, __new_fsetpos)
 versioned_symbol (libc, _IO_new_fsetpos, _IO_fsetpos, GLIBC_2_2);
 versioned_symbol (libc, __new_fsetpos, fsetpos, GLIBC_2_2);
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (_IO_new_fsetpos, _IO_new_fsetpos64)
+strong_alias (_IO_new_fsetpos64, __new_fsetpos64)
+versioned_symbol (libc, __new_fsetpos64, fsetpos64, GLIBC_2_2);
+versioned_symbol (libc, _IO_new_fsetpos64, _IO_fsetpos64, GLIBC_2_2);
+#endif
diff --git a/libio/iofsetpos64.c b/libio/iofsetpos64.c
index 9835c12..20edd8d 100644
--- a/libio/iofsetpos64.c
+++ b/libio/iofsetpos64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -29,6 +28,8 @@
 #include <errno.h>
 #include <shlib-compat.h>
 
+#ifndef __OFF_T_MATCHES_OFF64_T
+
 int
 _IO_new_fsetpos64 (fp, posp)
      _IO_FILE *fp;
@@ -68,3 +69,5 @@ _IO_new_fsetpos64 (fp, posp)
 strong_alias (_IO_new_fsetpos64, __new_fsetpos64)
 versioned_symbol (libc, __new_fsetpos64, fsetpos64, GLIBC_2_2);
 versioned_symbol (libc, _IO_new_fsetpos64, _IO_fsetpos64, GLIBC_2_2);
+
+#endif
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
index 2dbeb42..31258e4 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
@@ -1,5 +1,5 @@
 /* bits/typesizes.h -- underlying types for *_t.  Linux/Alpha version.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -61,6 +61,10 @@
 #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
 #define __FSWORD_T_TYPE		__S32_TYPE
 
+/* Tell the libc code that off_t and off64_t are actually the same type
+   for all ABI purposes, even if possibly expressed as different base types
+   for C type-checking purposes.  */
+#define __OFF_T_MATCHES_OFF64_T	1
 
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define	__FD_SETSIZE		1024
diff --git a/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h b/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
index 02c24e4..67d82e6 100644
--- a/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
+++ b/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
@@ -61,6 +61,11 @@
 #define __SYSCALL_SLONG_TYPE	__SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
 
+
+/* Tell the libc code that off_t and off64_t are actually the same type.  */
+#define __OFF_T_MATCHES_OFF64_T	1
+
+
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define	__FD_SETSIZE		1024
 
diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index def84cc..bf3d8b7 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -67,6 +67,13 @@
 #define __SYSCALL_SLONG_TYPE	__SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
 
+#ifdef __s390x__
+/* Tell the libc code that off_t and off64_t are actually the same type
+   for all ABI purposes, even if possibly expressed as different base types
+   for C type-checking purposes.  */
+# define __OFF_T_MATCHES_OFF64_T	1
+#endif
+
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define	__FD_SETSIZE		1024
 
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
index b65a1a5..7b1f191 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -61,6 +61,13 @@
 #define __SYSCALL_SLONG_TYPE	__SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
 
+#if defined __arch64__ || defined __sparcv9
+/* Tell the libc code that off_t and off64_t are actually the same type
+   for all ABI purposes, even if possibly expressed as different base types
+   for C type-checking purposes.  */
+# define __OFF_T_MATCHES_OFF64_T	1
+#endif
+
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define	__FD_SETSIZE		1024
 
diff --git a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
index be8985b..a477627 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
@@ -73,6 +73,13 @@
 #define __FSID_T_TYPE		struct { int __val[2]; }
 #define __SSIZE_T_TYPE		__SWORD_TYPE
 
+#ifdef __x86_64__
+/* Tell the libc code that off_t and off64_t are actually the same type
+   for all ABI purposes, even if possibly expressed as different base types
+   for C type-checking purposes.  */
+# define __OFF_T_MATCHES_OFF64_T	1
+#endif
+
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define __FD_SETSIZE		1024
 
diff --git a/sysdeps/wordsize-64/fseeko.c b/sysdeps/wordsize-64/fseeko.c
deleted file mode 100644
index 692885a..0000000
--- a/sysdeps/wordsize-64/fseeko.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../libio/fseeko.c"
-
-weak_alias (fseeko, fseeko64)
diff --git a/sysdeps/wordsize-64/fseeko64.c b/sysdeps/wordsize-64/fseeko64.c
deleted file mode 100644
index 73e011a..0000000
--- a/sysdeps/wordsize-64/fseeko64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in fseeko.c.  */
diff --git a/sysdeps/wordsize-64/ftello.c b/sysdeps/wordsize-64/ftello.c
deleted file mode 100644
index fa05cfc..0000000
--- a/sysdeps/wordsize-64/ftello.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../libio/ftello.c"
-
-weak_alias (ftello, ftello64)
diff --git a/sysdeps/wordsize-64/ftello64.c b/sysdeps/wordsize-64/ftello64.c
deleted file mode 100644
index 2cbbe63..0000000
--- a/sysdeps/wordsize-64/ftello64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in ftello.c.  */
diff --git a/sysdeps/wordsize-64/iofgetpos.c b/sysdeps/wordsize-64/iofgetpos.c
deleted file mode 100644
index ba8df67..0000000
--- a/sysdeps/wordsize-64/iofgetpos.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#define _IO_new_fgetpos64 __renamed__IO_new_fgetpos64
-#define _IO_fgetpos64 __renamed__IO_fgetpos64
-
-#include "../../libio/iofgetpos.c"
-
-#undef _IO_new_fgetpos64
-#undef _IO_fgetpos64
-
-strong_alias (_IO_new_fgetpos, _IO_new_fgetpos64)
-strong_alias (_IO_new_fgetpos64, __new_fgetpos64)
-versioned_symbol (libc, _IO_new_fgetpos64, _IO_fgetpos64, GLIBC_2_2);
-versioned_symbol (libc, __new_fgetpos64, fgetpos64, GLIBC_2_2);
diff --git a/sysdeps/wordsize-64/iofgetpos64.c b/sysdeps/wordsize-64/iofgetpos64.c
deleted file mode 100644
index 1748b810..0000000
--- a/sysdeps/wordsize-64/iofgetpos64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in iofgetpos.c.  */
diff --git a/sysdeps/wordsize-64/iofsetpos.c b/sysdeps/wordsize-64/iofsetpos.c
deleted file mode 100644
index f2bb8ae..0000000
--- a/sysdeps/wordsize-64/iofsetpos.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#define _IO_new_fsetpos64 __renamed__IO_new_fsetpos64
-#define _IO_fsetpos64 __renamed__IO_fsetpos64
-
-#include "../../libio/iofsetpos.c"
-
-#undef _IO_new_fsetpos64
-#undef _IO_fsetpos64
-
-strong_alias (_IO_new_fsetpos, _IO_new_fsetpos64)
-strong_alias (_IO_new_fsetpos64, __new_fsetpos64)
-versioned_symbol (libc, __new_fsetpos64, fsetpos64, GLIBC_2_2);
-versioned_symbol (libc, _IO_new_fsetpos64, _IO_fsetpos64, GLIBC_2_2);
diff --git a/sysdeps/wordsize-64/iofsetpos64.c b/sysdeps/wordsize-64/iofsetpos64.c
deleted file mode 100644
index 5fbc732..0000000
--- a/sysdeps/wordsize-64/iofsetpos64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in iofsetpos.c.  */

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/off64_t] clean up wordsize-64 off_t functions
  2012-08-02 17:21 [PATCH roland/off64_t] clean up wordsize-64 off_t functions Roland McGrath
@ 2012-08-02 18:14 ` Chris Metcalf
  2012-08-02 20:23   ` Roland McGrath
  2012-08-02 20:46 ` Joseph S. Myers
  1 sibling, 1 reply; 15+ messages in thread
From: Chris Metcalf @ 2012-08-02 18:14 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha, libc-ports

On 8/2/2012 1:21 PM, Roland McGrath wrote:
> If there are any linux-generic configurations where off_t matches off64_t,
> i.e. __SLONGWORD_TYPE matches __SQUAD_TYPE (tilegx64?), then that will need
> some additional attention too.  I'm not sure how best to handle that.
> It would be nice not to add another bits/typesizes.h, but it may be
> unavoidable unless every such machine predefines __LP64__ or something
> like that.  In trunk GCC it looks like that is done generically, but I
> don't know if all relevant GCC versions did that.

Yes, it's correct that tilegx64 has off_t == off64_t.

I think using "#ifdef __LP64__" in
ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h is a reasonable
approach here; it's certainly true for tile that gcc supports __LP64__ that
way, and since as you say it's generic in gcc, I think we can assume that
any new platform that incorporates support for linux-generic will also
properly support __LP64__.

Alternately, I suppose, one could #include <bits/wordsize.h> in
<bits/typesizes.h> and test __WORDSIZE == 64.  But I don't think it's
necessary.

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/off64_t] clean up wordsize-64 off_t functions
  2012-08-02 18:14 ` Chris Metcalf
@ 2012-08-02 20:23   ` Roland McGrath
  0 siblings, 0 replies; 15+ messages in thread
From: Roland McGrath @ 2012-08-02 20:23 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: libc-alpha, libc-ports

For anyone testing, please try the current branch rather than the patch I
posted.  It has the __LP64__ test for linux-generic.  I also added lockf,
which I had overlooked.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/off64_t] clean up wordsize-64 off_t functions
  2012-08-02 17:21 [PATCH roland/off64_t] clean up wordsize-64 off_t functions Roland McGrath
  2012-08-02 18:14 ` Chris Metcalf
@ 2012-08-02 20:46 ` Joseph S. Myers
  2012-08-02 20:54   ` Roland McGrath
  2012-08-02 21:47   ` Roland McGrath
  1 sibling, 2 replies; 15+ messages in thread
From: Joseph S. Myers @ 2012-08-02 20:46 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha, libc-ports

On Thu, 2 Aug 2012, Roland McGrath wrote:

> ia64 and powerpc64 don't have their own bits/typesizes.h files.  So some
> more work will be required there too and again I'm not entirely sure
> what's best to do.  We can make the generic bits/typesizes.h test
> __LP64__, but I'm not positive that all compiler versions that we
> support for those targets defined that.  (Note that here we have to be
> concerned with all compilers that we support for building applications
> with libc headers, not just the compilers we support for building libc
> itself.)

How is this definition *used* by installed headers?  If installed headers 
don't use it (only define it), it could be conditioned on _LIBC so it's 
clear it's not a public interface.  It appears __LP64__ has been defined 
(if long and pointers are 64-bit and int is 32-bit) since at least GCC 
3.4.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/off64_t] clean up wordsize-64 off_t functions
  2012-08-02 20:46 ` Joseph S. Myers
@ 2012-08-02 20:54   ` Roland McGrath
  2012-08-02 21:47   ` Roland McGrath
  1 sibling, 0 replies; 15+ messages in thread
From: Roland McGrath @ 2012-08-02 20:54 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-alpha, libc-ports

> How is this definition *used* by installed headers?  

Oh, it's not at all.  Good point.

> If installed headers don't use it (only define it), it could be
> conditioned on _LIBC so it's clear it's not a public interface.  

We don't do that for other cases like _DIRENT_HAVE_*, so I don't
see a reason to do it here.

> It appears __LP64__ has been defined (if long and pointers are 64-bit and
> int is 32-bit) since at least GCC 3.4.

Good to know.  I'll use that in bits/typesizes.h and that should cover
ia64 and powerpc64 just fine.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/off64_t] clean up wordsize-64 off_t functions
  2012-08-02 20:46 ` Joseph S. Myers
  2012-08-02 20:54   ` Roland McGrath
@ 2012-08-02 21:47   ` Roland McGrath
  2012-08-02 21:55     ` [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions Roland McGrath
  2012-08-03 19:58     ` [PATCH roland/off64_t] clean up wordsize-64 off_t functions Richard Henderson
  1 sibling, 2 replies; 15+ messages in thread
From: Roland McGrath @ 2012-08-02 21:47 UTC (permalink / raw)
  To: libc-alpha, libc-ports

I've updated the roland/off64_t branch and I now think it should cover all
wordsize-64 configurations, but only x86_64 has actually been tested.
So folks please test on:
	alpha, ia64, mips64, tilegx64, powerpc64, s390x, sparc64

We don't have much in the way of test coverage for this stuff.
So I would recommend checking that it doesn't change the code at all
rather than just running the test suite.

What I've been doing on x86_64-linux-gnu is:

* Do a complete build from master for the baseline.
* In your build directory do:
$ tar cf save.tar `find . -name '*.so'`
$ mkdir =save; (cd =save; tar xf save.tar)
* Update your build from the branch:
$ push $srcdir; git checkout roland/off64_t; popd
$ rm io/lockf* libio/{fseeko,ftello,iof?etpos}*
$ make -j<n>
(or clean build if you prefer).
* Compare objdump -rd output on the saved files:
$ so=`find =save -type f | sed s,=save/,,`
$ for x in $so; do diff -u <(objdump -rd =save/$x) <(objdump -rd $x) > =save/$x.diff; done
$ find =save -name \*.diff -ls

Every .diff file for no change will have a size around 260 bytes just for
the diff showing the =save/foo vs foo file names.  If a .diff file is
bigger, then look at it to see if there is something significant.  There
can sometimes be pervasive insignificant changes, where the actual code is
the same but only differs in some immediate values that are the line
numbers in __assert_fail calls and things like that.  This is pretty easy
to tell from eyeballing the diff.

When I get good testing reports from two or three of the seven
architectures above, I'll put the changes in and if any of the
others turn out to be broken you can flame me later.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions
  2012-08-02 21:47   ` Roland McGrath
@ 2012-08-02 21:55     ` Roland McGrath
  2012-08-03 20:12       ` Richard Henderson
                         ` (2 more replies)
  2012-08-03 19:58     ` [PATCH roland/off64_t] clean up wordsize-64 off_t functions Richard Henderson
  1 sibling, 3 replies; 15+ messages in thread
From: Roland McGrath @ 2012-08-02 21:55 UTC (permalink / raw)
  To: libc-alpha, libc-ports

This patch is on the roland/dirent64 branch, which forks from the
roland/off64_t branch (the patch won't apply to master).  It removes
from sysdeps/wordsize-64 the various functions using 'struct dirent'
and 'struct dirent64' where those types are identical.

I added an __INO_T_MATCHES_INO64_T macro to bits/typesizes.h analogous
to __OFF_T_MATCHES_OFF64_T.  Then sysdeps/unix/sysv/linux/bits/dirent.h
(shared by all machines) defines _DIRENT_MATCHES_DIRENT64 if both
__OFF_T_MATCHES_OFF64_T and __INO_T_MATCHES_INO64_T are defined, since
the use of those types is the only difference between dirent and dirent64.

As before, I've tested that no code changed on x86_64-linux-gnu.
I think it should cover all wordsize-64 configurations, but they should
be tested:
	alpha, ia64, mips64, tilegx64, powerpc64, s390x, sparc64

See my last message about roland/off64_t for testing suggestions:
	http://sourceware.org/ml/libc-alpha/2012-08/msg00054.html

Since this branch includes roland/off64_t, folks might as well just test
roland/dirent64 first and look no further unless there are problems.


Thanks,
Roland


2012-08-02  Roland McGrath  <roland@hack.frob.com>

	* dirent/alphasort.c [_DIRENT_MATCHES_DIRENT64]:
	Define alphasort64 as an alias.
	* dirent/versionsort.c [_DIRENT_MATCHES_DIRENT64]:
	Define versionsort64 as an alias.
	* dirent/scandir.c [_DIRENT_MATCHES_DIRENT64]:
	Define scandir64 as an alias.
	* dirent/scandirat.c [_DIRENT_MATCHES_DIRENT64]:
	Define scandirat64 as an alias.
	* dirent/alphasort64.c (alphasort64):
	Conditionalize on [!_DIRENT_MATCHES_DIRENT64].
	* dirent/versionsort64.c: Likewise.
	* dirent/scandir64.c: Likewise.
	* dirent/scandirat64.c: Likewise.
	* sysdeps/wordsize-64/alphasort.c: File removed.
	* sysdeps/wordsize-64/alphasort64.c: File removed.
	* sysdeps/wordsize-64/scandir.c: File removed.
	* sysdeps/wordsize-64/scandir64.c: File removed.
	* sysdeps/wordsize-64/scandirat.c: File removed.
	* sysdeps/wordsize-64/scandirat64.c: File removed.
	* sysdeps/wordsize-64/versionsort.c: File removed.
	* sysdeps/wordsize-64/versionsort64.c: File removed.

	* bits/typesizes.h [__LP64__] (__INO_T_MATCHES_INO64_T): New macros.
	* sysdeps/unix/sysv/linux/s390/bits/typesizes.h:
	[__s390x__] (__INO_T_MATCHES_INO64_T): New macro.
	* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
	[defined __arch64__ || defined __sparcv9]
	(__INO_T_MATCHES_INO64_T): New macro.
	* sysdeps/unix/sysv/linux/x86/bits/typesizes.h
	[__x86_64__] (__INO_T_MATCHES_INO64_T): New macro.
	* bits/dirent.h (_DIRENT_MATCHES_DIRENT64): New macro.
	* sysdeps/unix/sysv/linux/bits/dirent.h
	[defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T]
	(_DIRENT_MATCHES_DIRENT64): New macro.

ports/ChangeLog.alpha
2012-08-02  Roland McGrath  <roland@hack.frob.com>

	* sysdeps/unix/sysv/linux/alpha/bits/dirent.h
	(_DIRENT_MATCHES_DIRENT64): New macro.

diff --git a/bits/dirent.h b/bits/dirent.h
index ac1928d..5b803c6 100644
--- a/bits/dirent.h
+++ b/bits/dirent.h
@@ -1,5 +1,5 @@
 /* Directory entry structure `struct dirent'.  Stub version.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -33,3 +33,6 @@ struct dirent64
     int d_fileno;
   };
 #endif
+
+/* Inform libc code that these two types are identical.  */
+#define _DIRENT_MATCHES_DIRENT64	1
diff --git a/bits/typesizes.h b/bits/typesizes.h
index 09959f2..c3debd0 100644
--- a/bits/typesizes.h
+++ b/bits/typesizes.h
@@ -66,6 +66,9 @@
    for all ABI purposes, even if possibly expressed as different base types
    for C type-checking purposes.  */
 # define __OFF_T_MATCHES_OFF64_T	1
+
+/* Same for ino_t and ino64_t.  */
+# define __INO_T_MATCHES_INO64_T	1
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
diff --git a/dirent/alphasort.c b/dirent/alphasort.c
index 5939322..6fab7f8 100644
--- a/dirent/alphasort.c
+++ b/dirent/alphasort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -15,7 +15,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+/* We need to avoid the header declaration of alphasort64, because
+   the types don't match alphasort and then the compiler will
+   complain about the mismatch when we do the alias below.  */
+#define alphasort64     __renamed_alphasort64
+
 #include <dirent.h>
+
+#undef  alphasort64
+
 #include <string.h>
 
 int
@@ -23,3 +31,7 @@ alphasort (const struct dirent **a, const struct dirent **b)
 {
   return strcoll ((*a)->d_name, (*b)->d_name);
 }
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (alphasort, alphasort64)
+#endif
diff --git a/dirent/alphasort64.c b/dirent/alphasort64.c
index 4f5c1dd..a4d37ab 100644
--- a/dirent/alphasort64.c
+++ b/dirent/alphasort64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2000, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +18,13 @@
 #include <dirent.h>
 #include <string.h>
 
+/* alphasort.c defines alphasort64 as an alias if _DIRENT_MATCHES_DIRENT64.  */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
 int
 alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
 {
   return strcoll ((*a)->d_name, (*b)->d_name);
 }
+
+#endif
diff --git a/dirent/scandir.c b/dirent/scandir.c
index 8b0a87b..6dce54d 100644
--- a/dirent/scandir.c
+++ b/dirent/scandir.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992-1998,2000,2002,2003,2009,2011
-   Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +15,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+/* We need to avoid the header declaration of scandir64, because
+   the types don't match scandir and then the compiler will
+   complain about the mismatch when we do the alias below.  */
+#define scandir64       __renamed_scandir64
+
 #include <dirent.h>
+
+#undef  scandir64
+
 #include <fcntl.h>
 
 #ifndef SCANDIR
@@ -35,3 +42,7 @@ SCANDIR (dir, namelist, select, cmp)
 {
   return SCANDIRAT (AT_FDCWD, dir, namelist, select, cmp);
 }
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (scandir, scandir64)
+#endif
diff --git a/dirent/scandir64.c b/dirent/scandir64.c
index 78ac570..bba302f 100644
--- a/dirent/scandir64.c
+++ b/dirent/scandir64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,8 +17,13 @@
 
 #include <dirent.h>
 
+/* scandir.c defines scandir64 as an alias if _DIRENT_MATCHES_DIRENT64.  */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
 #define SCANDIR scandir64
 #define SCANDIRAT scandirat64
 #define DIRENT_TYPE struct dirent64
 
 #include <dirent/scandir.c>
+
+#endif
diff --git a/dirent/scandirat.c b/dirent/scandirat.c
index 13bd574..c2704ba 100644
--- a/dirent/scandirat.c
+++ b/dirent/scandirat.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992-1998,2000,2002,2003,2009,2011
-   Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +15,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+/* We need to avoid the header declaration of scandir64, because
+   the types don't match scandir and then the compiler will
+   complain about the mismatch when we do the alias below.  */
+#define scandirat64       __renamed_scandirat64
+
 #include <dirent.h>
+
+#undef  scandirat64
+
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -141,3 +148,7 @@ SCANDIRAT (dfd, dir, namelist, select, cmp)
   return c.cnt;
 }
 libc_hidden_def (SCANDIRAT)
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (scandirat, scandirat64)
+#endif
diff --git a/dirent/scandirat64.c b/dirent/scandirat64.c
index a816ee9..608ca33 100644
--- a/dirent/scandirat64.c
+++ b/dirent/scandirat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,9 +17,14 @@
 
 #include <dirent.h>
 
+/* scandirat.c defines scandirat64 as an alias if _DIRENT_MATCHES_DIRENT64.  */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
 #define SCANDIRAT scandirat64
 #define READDIR __readdir64
 #define DIRENT_TYPE struct dirent64
 #define SKIP_SCANDIR_CANCEL 1
 
 #include "scandirat.c"
+
+#endif
diff --git a/dirent/versionsort.c b/dirent/versionsort.c
index 47bda04..ee34659 100644
--- a/dirent/versionsort.c
+++ b/dirent/versionsort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -15,7 +15,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+/* We need to avoid the header declaration of versionsort64, because
+   the types don't match versionsort and then the compiler will
+   complain about the mismatch when we do the alias below.  */
+#define versionsort64     __renamed_versionsort64
+
 #include <dirent.h>
+
+#undef  versionsort64
+
 #include <string.h>
 
 int
@@ -23,3 +31,7 @@ versionsort (const struct dirent **a, const struct dirent **b)
 {
   return __strverscmp ((*a)->d_name, (*b)->d_name);
 }
+
+#ifdef _DIRENT_MATCHES_DIRENT64
+weak_alias (versionsort, versionsort64)
+#endif
diff --git a/dirent/versionsort64.c b/dirent/versionsort64.c
index 5b40e10..dca72e8 100644
--- a/dirent/versionsort64.c
+++ b/dirent/versionsort64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2000, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +18,13 @@
 #include <dirent.h>
 #include <string.h>
 
+/* versionsort.c defines a versionsort64 alias if _DIRENT_MATCHES_DIRENT64.  */
+#ifndef _DIRENT_MATCHES_DIRENT64
+
 int
 versionsort64 (const struct dirent64 **a, const struct dirent64 **b)
 {
   return __strverscmp ((*a)->d_name, (*b)->d_name);
 }
+
+#endif
diff --git a/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h b/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
index f146466..487ad15 100644
--- a/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
+++ b/ports/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -51,4 +51,7 @@ struct dirent64
 #define _DIRENT_HAVE_D_OFF
 #define _DIRENT_HAVE_D_TYPE
 
+/* Inform libc code that these two types are effectively identical.  */
+#define _DIRENT_MATCHES_DIRENT64	1
+
 #endif /* bits/dirent.h */
diff --git a/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
index 670c6d1..d7d2a5c 100644
--- a/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
+++ b/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
@@ -67,6 +67,9 @@
    for all ABI purposes, even if possibly expressed as different base types
    for C type-checking purposes.  */
 # define __OFF_T_MATCHES_OFF64_T	1
+
+/* Same for ino_t and ino64_t.  */
+# define __INO_T_MATCHES_INO64_T	1
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
diff --git a/sysdeps/unix/sysv/linux/bits/dirent.h b/sysdeps/unix/sysv/linux/bits/dirent.h
index 5728618..11daabe 100644
--- a/sysdeps/unix/sysv/linux/bits/dirent.h
+++ b/sysdeps/unix/sysv/linux/bits/dirent.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -50,3 +50,8 @@ struct dirent64
 #define _DIRENT_HAVE_D_RECLEN
 #define _DIRENT_HAVE_D_OFF
 #define _DIRENT_HAVE_D_TYPE
+
+#if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T
+/* Inform libc code that these two types are effectively identical.  */
+# define _DIRENT_MATCHES_DIRENT64	1
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index bf3d8b7..b630488 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -72,6 +72,9 @@
    for all ABI purposes, even if possibly expressed as different base types
    for C type-checking purposes.  */
 # define __OFF_T_MATCHES_OFF64_T	1
+
+/* Same for ino_t and ino64_t.  */
+# define __INO_T_MATCHES_INO64_T	1
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
index 7b1f191..e55d642 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -66,6 +66,9 @@
    for all ABI purposes, even if possibly expressed as different base types
    for C type-checking purposes.  */
 # define __OFF_T_MATCHES_OFF64_T	1
+
+/* Same for ino_t and ino64_t.  */
+# define __INO_T_MATCHES_INO64_T	1
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
index a477627..397e867 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
@@ -78,6 +78,9 @@
    for all ABI purposes, even if possibly expressed as different base types
    for C type-checking purposes.  */
 # define __OFF_T_MATCHES_OFF64_T	1
+
+/* Same for ino_t and ino64_t.  */
+# define __INO_T_MATCHES_INO64_T	1
 #endif
 
 /* Number of descriptors that can fit in an `fd_set'.  */
diff --git a/sysdeps/wordsize-64/alphasort.c b/sysdeps/wordsize-64/alphasort.c
deleted file mode 100644
index edc4101..0000000
--- a/sysdeps/wordsize-64/alphasort.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#define alphasort64 rename_alphasort64
-
-#include "../../dirent/alphasort.c"
-
-#undef alphasort64
-
-weak_alias (alphasort, alphasort64)
diff --git a/sysdeps/wordsize-64/alphasort64.c b/sysdeps/wordsize-64/alphasort64.c
deleted file mode 100644
index 0850913..0000000
--- a/sysdeps/wordsize-64/alphasort64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in alphasort.c.  */
diff --git a/sysdeps/wordsize-64/scandir.c b/sysdeps/wordsize-64/scandir.c
deleted file mode 100644
index 9af7e9b..0000000
--- a/sysdeps/wordsize-64/scandir.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#define scandir64 scandir64_renamed
-
-#include "../../dirent/scandir.c"
-
-#undef scandir64
-weak_alias (scandir, scandir64)
diff --git a/sysdeps/wordsize-64/scandir64.c b/sysdeps/wordsize-64/scandir64.c
deleted file mode 100644
index 3c2c4a1..0000000
--- a/sysdeps/wordsize-64/scandir64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in scandir.c.  */
diff --git a/sysdeps/wordsize-64/scandirat.c b/sysdeps/wordsize-64/scandirat.c
deleted file mode 100644
index 02b8fde..0000000
--- a/sysdeps/wordsize-64/scandirat.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#define scandirat64 scandirat64_renamed
-
-#include "../../dirent/scandirat.c"
-
-#undef scandirat64
-weak_alias (scandirat, scandirat64)
diff --git a/sysdeps/wordsize-64/scandirat64.c b/sysdeps/wordsize-64/scandirat64.c
deleted file mode 100644
index fb93865..0000000
--- a/sysdeps/wordsize-64/scandirat64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in scandirat.c.  */
diff --git a/sysdeps/wordsize-64/versionsort.c b/sysdeps/wordsize-64/versionsort.c
deleted file mode 100644
index bb25550..0000000
--- a/sysdeps/wordsize-64/versionsort.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#define versionsort64 rename_versionsort64
-
-#include "../../dirent/versionsort.c"
-
-#undef versionsort64
-
-weak_alias (versionsort, versionsort64)
diff --git a/sysdeps/wordsize-64/versionsort64.c b/sysdeps/wordsize-64/versionsort64.c
deleted file mode 100644
index ac6c3c7..0000000
--- a/sysdeps/wordsize-64/versionsort64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Defined in versionsort.c.  */

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/off64_t] clean up wordsize-64 off_t functions
  2012-08-02 21:47   ` Roland McGrath
  2012-08-02 21:55     ` [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions Roland McGrath
@ 2012-08-03 19:58     ` Richard Henderson
  2012-08-03 20:12       ` Roland McGrath
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Henderson @ 2012-08-03 19:58 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha, libc-ports

On 2012-08-02 14:46, Roland McGrath wrote:
> I've updated the roland/off64_t branch and I now think it should cover all
> wordsize-64 configurations, but only x86_64 has actually been tested.
> So folks please test on:
> 	alpha, ia64, mips64, tilegx64, powerpc64, s390x, sparc64

No changes on alpha.


r~

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions
  2012-08-02 21:55     ` [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions Roland McGrath
@ 2012-08-03 20:12       ` Richard Henderson
  2012-08-04  8:30       ` David Miller
  2012-08-04 16:14       ` Chris Metcalf
  2 siblings, 0 replies; 15+ messages in thread
From: Richard Henderson @ 2012-08-03 20:12 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha, libc-ports

On 2012-08-02 14:55, Roland McGrath wrote:
> Since this branch includes roland/off64_t, folks might as well just test
> roland/dirent64 first and look no further unless there are problems.

... also fine on alpha.


r~

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/off64_t] clean up wordsize-64 off_t functions
  2012-08-03 19:58     ` [PATCH roland/off64_t] clean up wordsize-64 off_t functions Richard Henderson
@ 2012-08-03 20:12       ` Roland McGrath
  0 siblings, 0 replies; 15+ messages in thread
From: Roland McGrath @ 2012-08-03 20:12 UTC (permalink / raw)
  To: Richard Henderson; +Cc: libc-alpha, libc-ports

> On 2012-08-02 14:46, Roland McGrath wrote:
> > I've updated the roland/off64_t branch and I now think it should cover all
> > wordsize-64 configurations, but only x86_64 has actually been tested.
> > So folks please test on:
> > 	alpha, ia64, mips64, tilegx64, powerpc64, s390x, sparc64
> 
> No changes on alpha.

Did you test roland/off64_t or roland/dirent64?

Thanks,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions
  2012-08-02 21:55     ` [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions Roland McGrath
  2012-08-03 20:12       ` Richard Henderson
@ 2012-08-04  8:30       ` David Miller
  2012-08-04  9:23         ` Andreas Schwab
  2012-08-04 16:14       ` Chris Metcalf
  2 siblings, 1 reply; 15+ messages in thread
From: David Miller @ 2012-08-04  8:30 UTC (permalink / raw)
  To: roland; +Cc: libc-alpha, libc-ports

From: Roland McGrath <roland@hack.frob.com>
Date: Thu,  2 Aug 2012 14:55:30 -0700 (PDT)

> As before, I've tested that no code changed on x86_64-linux-gnu.
> I think it should cover all wordsize-64 configurations, but they should
> be tested:
> 	alpha, ia64, mips64, tilegx64, powerpc64, s390x, sparc64

This breaks the build on sparc64:

make[2]: *** No rule to make target '../sysdeps/wordsize-64/iofgetpos.c', needed by '/home/davem/src/GIT/GLIBC/build-sparc64-multiarch/libio/iofgetpos.o'.  Stop.
make[2]: *** Waiting for unfinished jobs....
Makefile:233: recipe for target 'libio/subdir_lib' failed
make[1]: *** [libio/subdir_lib] Error 2
Makefile:7: recipe for target 'all' failed
make: *** [all] Error 2

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions
  2012-08-04  8:30       ` David Miller
@ 2012-08-04  9:23         ` Andreas Schwab
  2012-08-04  9:26           ` David Miller
  0 siblings, 1 reply; 15+ messages in thread
From: Andreas Schwab @ 2012-08-04  9:23 UTC (permalink / raw)
  To: David Miller; +Cc: roland, libc-alpha, libc-ports

David Miller <davem@davemloft.net> writes:

> make[2]: *** No rule to make target '../sysdeps/wordsize-64/iofgetpos.c', needed by '/home/davem/src/GIT/GLIBC/build-sparc64-multiarch/libio/iofgetpos.o'.  Stop.

Remove the stale dependency file.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions
  2012-08-04  9:23         ` Andreas Schwab
@ 2012-08-04  9:26           ` David Miller
  2012-08-04 10:37             ` David Miller
  0 siblings, 1 reply; 15+ messages in thread
From: David Miller @ 2012-08-04  9:26 UTC (permalink / raw)
  To: schwab; +Cc: roland, libc-alpha, libc-ports

From: Andreas Schwab <schwab@linux-m68k.org>
Date: Sat, 04 Aug 2012 11:22:45 +0200

> David Miller <davem@davemloft.net> writes:
> 
>> make[2]: *** No rule to make target '../sysdeps/wordsize-64/iofgetpos.c', needed by '/home/davem/src/GIT/GLIBC/build-sparc64-multiarch/libio/iofgetpos.o'.  Stop.
> 
> Remove the stale dependency file.

After I sent that build failure out I kind of figured it was an
issue like that.

Retesting now, thanks.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions
  2012-08-04  9:26           ` David Miller
@ 2012-08-04 10:37             ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2012-08-04 10:37 UTC (permalink / raw)
  To: schwab; +Cc: roland, libc-alpha, libc-ports

From: David Miller <davem@davemloft.net>
Date: Sat, 04 Aug 2012 02:25:52 -0700 (PDT)

> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Sat, 04 Aug 2012 11:22:45 +0200
> 
>> David Miller <davem@davemloft.net> writes:
>> 
>>> make[2]: *** No rule to make target '../sysdeps/wordsize-64/iofgetpos.c', needed by '/home/davem/src/GIT/GLIBC/build-sparc64-multiarch/libio/iofgetpos.o'.  Stop.
>> 
>> Remove the stale dependency file.
> 
> After I sent that build failure out I kind of figured it was an
> issue like that.
> 
> Retesting now, thanks.

Ok, sparc64 looks good.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions
  2012-08-02 21:55     ` [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions Roland McGrath
  2012-08-03 20:12       ` Richard Henderson
  2012-08-04  8:30       ` David Miller
@ 2012-08-04 16:14       ` Chris Metcalf
  2 siblings, 0 replies; 15+ messages in thread
From: Chris Metcalf @ 2012-08-04 16:14 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-alpha, libc-ports

On 8/2/2012 5:55 PM, Roland McGrath wrote:
> This patch is on the roland/dirent64 branch, which forks from the
> roland/off64_t branch (the patch won't apply to master).  It removes
> from sysdeps/wordsize-64 the various functions using 'struct dirent'
> and 'struct dirent64' where those types are identical.
>
> I added an __INO_T_MATCHES_INO64_T macro to bits/typesizes.h analogous
> to __OFF_T_MATCHES_OFF64_T.  Then sysdeps/unix/sysv/linux/bits/dirent.h
> (shared by all machines) defines _DIRENT_MATCHES_DIRENT64 if both
> __OFF_T_MATCHES_OFF64_T and __INO_T_MATCHES_INO64_T are defined, since
> the use of those types is the only difference between dirent and dirent64.
>
> As before, I've tested that no code changed on x86_64-linux-gnu.
> I think it should cover all wordsize-64 configurations, but they should
> be tested:
>         alpha, ia64, mips64, tilegx64, powerpc64, s390x, sparc64

Tested ok on tilegx64.

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-08-04 16:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-02 17:21 [PATCH roland/off64_t] clean up wordsize-64 off_t functions Roland McGrath
2012-08-02 18:14 ` Chris Metcalf
2012-08-02 20:23   ` Roland McGrath
2012-08-02 20:46 ` Joseph S. Myers
2012-08-02 20:54   ` Roland McGrath
2012-08-02 21:47   ` Roland McGrath
2012-08-02 21:55     ` [PATCH roland/dirent64] clean up wordsize-64 struct dirent functions Roland McGrath
2012-08-03 20:12       ` Richard Henderson
2012-08-04  8:30       ` David Miller
2012-08-04  9:23         ` Andreas Schwab
2012-08-04  9:26           ` David Miller
2012-08-04 10:37             ` David Miller
2012-08-04 16:14       ` Chris Metcalf
2012-08-03 19:58     ` [PATCH roland/off64_t] clean up wordsize-64 off_t functions Richard Henderson
2012-08-03 20:12       ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).