This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Fix alpha compilation failure
- From: Stefan Knoblich <stkn at gentoo dot org>
- To: drepper at redhat dot com
- Cc: libc-alpha at sources dot redhat dot com
- Date: Tue, 4 Jan 2005 00:55:08 +0100
- Subject: Re: Fix alpha compilation failure
- References: <81vfj1zk9o.wl@omega.webmasters.gr.jp> <40A8FD51.5040708@redhat.com>
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