This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix alpha compilation failure


Am Montag, 17. Mai 2004 19:58 schrieb Ulrich Drepper:
> GOTO Masanori wrote:
> > The current cvs failed to compile on alpha with linux kernel < 2.6.4,
> > because old version did not have __NR_{fstat,lstat,stat}64.  This
> > patch checks such syscalls are actually defined.
>
> This patch is not correct.  The code should never set errno unless it's
> necessary.  It's allowed by the standard, yes, but we still don't do it.
>
> Secondly, it would be good to introduce an appropriate __ASSUME_* macro.
>  I know, this is nothing you introduced but still, it needs fixing.

Hi,

since i couldn't find a new version of the patch, i gave it a try (and hope
this is what you intended).

stefan
diff -Naur glibc-2.3.4-20041102.orig/sysdeps/unix/sysv/linux/alpha/fxstat.c glibc-2.3.4-20041102/sysdeps/unix/sysv/linux/alpha/fxstat.c
--- glibc-2.3.4-20041102.orig/sysdeps/unix/sysv/linux/alpha/fxstat.c	2004-12-24 21:20:33.000000000 +0000
+++ glibc-2.3.4-20041102/sysdeps/unix/sysv/linux/alpha/fxstat.c	2004-12-24 21:39:43.000000000 +0000
@@ -40,12 +40,14 @@
 
   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
     {
+#ifdef __ASSUME_STAT64_SYSCALL
       result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
 	return result;
       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
       if (errno_out != ENOSYS)
 	goto fail;
+#endif
       __libc_missing_axp_stat64 = 1;
     }
 
diff -Naur glibc-2.3.4-20041102.orig/sysdeps/unix/sysv/linux/alpha/lxstat.c glibc-2.3.4-20041102/sysdeps/unix/sysv/linux/alpha/lxstat.c
--- glibc-2.3.4-20041102.orig/sysdeps/unix/sysv/linux/alpha/lxstat.c	2004-12-24 21:20:33.000000000 +0000
+++ glibc-2.3.4-20041102/sysdeps/unix/sysv/linux/alpha/lxstat.c	2004-12-24 21:39:33.000000000 +0000
@@ -40,12 +40,14 @@
 
   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
     {
+#ifdef __ASSUME_STAT64_SYSCALL
       result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
 	return result;
       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
       if (errno_out != ENOSYS)
 	goto fail;
+#endif
       __libc_missing_axp_stat64 = 1;
     }
 
diff -Naur glibc-2.3.4-20041102.orig/sysdeps/unix/sysv/linux/alpha/xstat.c glibc-2.3.4-20041102/sysdeps/unix/sysv/linux/alpha/xstat.c
--- glibc-2.3.4-20041102.orig/sysdeps/unix/sysv/linux/alpha/xstat.c	2004-12-24 21:20:34.000000000 +0000
+++ glibc-2.3.4-20041102/sysdeps/unix/sysv/linux/alpha/xstat.c	2004-12-24 21:39:24.000000000 +0000
@@ -40,12 +40,14 @@
 
   if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
     {
+#ifdef __ASSUME_STAT64_SYSCALL
       result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
       if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
 	return result;
       errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
       if (errno_out != ENOSYS)
 	goto fail;
+#endif
       __libc_missing_axp_stat64 = 1;
     }
 
diff -Naur glibc-2.3.4-20041102.orig/sysdeps/unix/sysv/linux/kernel-features.h glibc-2.3.4-20041102/sysdeps/unix/sysv/linux/kernel-features.h
--- glibc-2.3.4-20041102.orig/sysdeps/unix/sysv/linux/kernel-features.h	2004-12-24 21:20:34.000000000 +0000
+++ glibc-2.3.4-20041102/sysdeps/unix/sysv/linux/kernel-features.h	2004-12-24 21:30:37.000000000 +0000
@@ -419,3 +419,8 @@
 #if __LINUX_KERNEL_VERSION >= 0x020609 && defined __alpha__
 #define __ASSUME_IEEE_RAISE_EXCEPTION	1
 #endif
+
+/* Starting with version 2.6.4, {l,f,}stat64 syscalls are available on alpha. */
+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
+#define __ASSUME_STAT64_SYSCALL 1
+#endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]