svn commit: trunk/uClibc: include libc/sysdeps/linux/common

vda at uclibc.org vda at uclibc.org
Fri Feb 27 22:51:08 UTC 2009


Author: vda
Date: 2009-02-27 22:51:07 +0000 (Fri, 27 Feb 2009)
New Revision: 25469

Log:
fix breakage in x86_64 defconfig



Modified:
   trunk/uClibc/include/libc-symbols.h
   trunk/uClibc/libc/sysdeps/linux/common/fstat.c
   trunk/uClibc/libc/sysdeps/linux/common/getdents.c
   trunk/uClibc/libc/sysdeps/linux/common/getdents64.c
   trunk/uClibc/libc/sysdeps/linux/common/lstat.c
   trunk/uClibc/libc/sysdeps/linux/common/posix_fadvise.c
   trunk/uClibc/libc/sysdeps/linux/common/sendfile.c
   trunk/uClibc/libc/sysdeps/linux/common/stat.c


Changeset:
Modified: trunk/uClibc/include/libc-symbols.h
===================================================================
--- trunk/uClibc/include/libc-symbols.h	2009-02-27 14:59:17 UTC (rev 25468)
+++ trunk/uClibc/include/libc-symbols.h	2009-02-27 22:51:07 UTC (rev 25469)
@@ -177,6 +177,12 @@
 # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
 # define _strong_alias(name, aliasname) \
   extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+/* Same, but does not check for type match. Use sparingly.
+   Example: strong_alias(stat,stat64) may fail, this one works: */
+# define strong_alias_untyped(name, aliasname) \
+  _strong_alias_untyped(name, aliasname)
+# define _strong_alias_untyped(name, aliasname) \
+  extern __typeof (aliasname) aliasname __attribute__ ((alias (#name)));
 
 /* This comes between the return type and function name in
    a function definition to make that definition weak.  */

Modified: trunk/uClibc/libc/sysdeps/linux/common/fstat.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/fstat.c	2009-02-27 14:59:17 UTC (rev 25468)
+++ trunk/uClibc/libc/sysdeps/linux/common/fstat.c	2009-02-27 22:51:07 UTC (rev 25469)
@@ -7,19 +7,11 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_fstat64 doesnt exist */
-#define fstat64 __hidefstat64
-
 #include <sys/syscall.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include "xstatconv.h"
 
-#undef fstat64
-
-/* libc_hidden_proto(fstat) */
-
 #define __NR___syscall_fstat __NR_fstat
 static __inline__ _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf)
 
@@ -37,8 +29,6 @@
 libc_hidden_def(fstat)
 
 #if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__
-extern __typeof(fstat) fstat64;
-/* libc_hidden_proto(fstat64) */
-strong_alias(fstat,fstat64)
+strong_alias_untyped(fstat,fstat64)
 libc_hidden_def(fstat64)
 #endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/getdents.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/getdents.c	2009-02-27 14:59:17 UTC (rev 25468)
+++ trunk/uClibc/libc/sysdeps/linux/common/getdents.c	2009-02-27 22:51:07 UTC (rev 25469)
@@ -18,6 +18,11 @@
 #include <bits/kernel_types.h>
 #include <bits/kernel-features.h>
 
+#if !(defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 && __WORDSIZE == 64)
+/* If the condition above is met, __getdents is defined as an alias
+ * for __getdents64 (see getdents64.c). Otherwise...
+ */
+
 /* With newer versions of linux, the getdents syscall returns d_type
  * information after the name field.
  *
@@ -42,7 +47,8 @@
 #define __NR___syscall_getdents __NR_getdents
 static __always_inline _syscall3(int, __syscall_getdents, int, fd, unsigned char *, kdirp, size_t, count)
 
-#ifdef __ASSUME_GETDENTS32_D_TYPE
+#if defined __ASSUME_GETDENTS32_D_TYPE
+
 ssize_t __getdents (int fd, char *buf, size_t nbytes)
 {
 	ssize_t retval;
@@ -72,9 +78,6 @@
 
 #elif ! defined __UCLIBC_HAS_LFS__ || ! defined __NR_getdents64
 
-/* Experimentally off - libc_hidden_proto(memcpy) */
-/* libc_hidden_proto(lseek) */
-
 ssize_t __getdents (int fd, char *buf, size_t nbytes)
 {
     struct dirent *dp;
@@ -136,8 +139,6 @@
 
 #elif __WORDSIZE == 32
 
-/* Experimentally off - libc_hidden_proto(memmove) */
-
 extern __typeof(__getdents) __getdents64 attribute_hidden;
 ssize_t __getdents (int fd, char *buf, size_t nbytes)
 {
@@ -165,3 +166,5 @@
 }
 
 #endif
+
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/getdents64.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/getdents64.c	2009-02-27 14:59:17 UTC (rev 25468)
+++ trunk/uClibc/libc/sysdeps/linux/common/getdents64.c	2009-02-27 22:51:07 UTC (rev 25469)
@@ -20,9 +20,6 @@
 
 #if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64
 
-/* Experimentally off - libc_hidden_proto(memcpy) */
-/* libc_hidden_proto(lseek64) */
-
 # ifndef offsetof
 #  define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 # endif
@@ -36,7 +33,6 @@
     char		d_name[256];
 };
 
-
 # define __NR___syscall_getdents64 __NR_getdents64
 static __inline__ _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count)
 
@@ -102,4 +98,4 @@
 attribute_hidden strong_alias(__getdents64,__getdents)
 #endif
 
-#endif /* __UCLIBC_HAS_LFS__ */
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/lstat.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/lstat.c	2009-02-27 14:59:17 UTC (rev 25468)
+++ trunk/uClibc/libc/sysdeps/linux/common/lstat.c	2009-02-27 22:51:07 UTC (rev 25469)
@@ -7,19 +7,11 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_lstat64 doesnt exist */
-#define lstat64 __hidelstat64
-
 #include <sys/syscall.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include "xstatconv.h"
 
-#undef lstat64
-
-/* libc_hidden_proto(lstat) */
-
 #define __NR___syscall_lstat __NR_lstat
 static __inline__ _syscall2(int, __syscall_lstat,
 		const char *, file_name, struct kernel_stat *, buf)
@@ -38,8 +30,6 @@
 libc_hidden_def(lstat)
 
 #if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__
-extern __typeof(lstat) lstat64;
-/* libc_hidden_proto(lstat64) */
-strong_alias(lstat,lstat64)
+strong_alias_untyped(lstat,lstat64)
 libc_hidden_def(lstat64)
 #endif

Modified: trunk/uClibc/libc/sysdeps/linux/common/posix_fadvise.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/posix_fadvise.c	2009-02-27 14:59:17 UTC (rev 25468)
+++ trunk/uClibc/libc/sysdeps/linux/common/posix_fadvise.c	2009-02-27 22:51:07 UTC (rev 25469)
@@ -8,15 +8,9 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_fadvise64_64 doesnt exist */
-#define posix_fadvise64 __hideposix_fadvise64
-
 #include <sys/syscall.h>
 #include <fcntl.h>
 
-#undef posix_fadvise64
-
 #ifdef __NR_fadvise64
 #define __NR_posix_fadvise __NR_fadvise64
 /* get rid of following conditional when
@@ -49,7 +43,6 @@
 #endif
 
 #if defined __UCLIBC_HAS_LFS__ && (!defined __NR_fadvise64_64 || !defined _syscall6)
-extern __typeof(posix_fadvise) posix_fadvise64;
 strong_alias(posix_fadvise,posix_fadvise64)
 #endif
 

Modified: trunk/uClibc/libc/sysdeps/linux/common/sendfile.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/sendfile.c	2009-02-27 14:59:17 UTC (rev 25468)
+++ trunk/uClibc/libc/sysdeps/linux/common/sendfile.c	2009-02-27 22:51:07 UTC (rev 25469)
@@ -7,16 +7,10 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_sendfile64 doesnt exist */
-#define sendfile64 __hidesendfile64
-
 #include <sys/syscall.h>
 #include <unistd.h>
 #include <sys/sendfile.h>
 
-#undef sendfile64
-
 #ifdef __NR_sendfile
 
 _syscall4(ssize_t, sendfile, int, out_fd, int, in_fd, __off_t *, offset,

Modified: trunk/uClibc/libc/sysdeps/linux/common/stat.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/stat.c	2009-02-27 14:59:17 UTC (rev 25468)
+++ trunk/uClibc/libc/sysdeps/linux/common/stat.c	2009-02-27 22:51:07 UTC (rev 25469)
@@ -7,19 +7,11 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_stat64 doesnt exist */
-#define stat64 __hidestat64
-
 #include <sys/syscall.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include "xstatconv.h"
 
-#undef stat64
-
-/* libc_hidden_proto(stat) */
-
 #define __NR___syscall_stat __NR_stat
 #undef stat
 static __inline__ _syscall2(int, __syscall_stat,
@@ -39,8 +31,6 @@
 libc_hidden_def(stat)
 
 #if ! defined __NR_stat64 && defined __UCLIBC_HAS_LFS__
-extern __typeof(stat) stat64;
-/* libc_hidden_proto(stat64) */
-strong_alias(stat,stat64)
+strong_alias_untyped(stat,stat64)
 libc_hidden_def(stat64)
 #endif



More information about the uClibc-cvs mailing list