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]

Patch needed for CVS glibc on SH


I believe this flushes my current patches to make glibc work on SH.  Issues:
 - MIPS pread functions have some wackiness in them for the MIPS calling
   conventions, which align long longs to even register pairs; it appears
   that SH does not do this.  This fixes pread64/pwrite64.
 - st_ino is _NOT_ 64-bit in the latest SH kernel trees, or at least it
   wasn't when I checked in April.  --enable-kernel=2.4.x breaks terribly
   without this patch; the errors are along the lines of "version GLIBC_2.3
   not found", because that's the first consequence of a messed up inode
   field - ld.so compares by inodes at some point.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-06-19  Daniel Jacobowitz  <drow@mvista.com>

	* sysdeps/unix/sysv/linux/kernel-features.h: Update kernel features
	for the SH architecture.
	* sysdeps/unix/sysv/linux/sh/pread.c: Use generic Linux version
	instead of the MIPS version.
	* sysdeps/unix/sysv/linux/sh/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pwrite64.c: Likewise.

--- glibc-2.3.2/sysdeps/unix/sysv/linux/kernel-features.h.org	2003-04-21 10:57:55.000000000 -0400
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/kernel-features.h	2003-04-21 11:16:47.000000000 -0400
@@ -151,11 +151,20 @@
 
 /* The changed st_ino field appeared in 2.4.0-test6.  But we cannot
    distinguish this version from other 2.4.0 releases.  Therefore play
-   save and assume it available is for 2.4.1 and up.  */
-#if __LINUX_KERNEL_VERSION >= 132097
+   save and assume it available is for 2.4.1 and up.  However, SH is lame,
+   and still does not have a 64-bit inode field.  */
+#if __LINUX_KERNEL_VERSION >= 132097 \
+    && !defined __sh__
 # define __ASSUME_ST_INO_64_BIT		1
 #endif
 
+/* SH kernels got stat64, mmap2, and truncate64 during 2.4.0-test.  */
+#if __LINUX_KERNEL_VERSION >= 132096 && defined __sh__
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_STAT64_SYSCALL	1
+#endif
+
 /* To support locking of large files a new fcntl() syscall was introduced
    in 2.4.0-test7.  We test for 2.4.1 for the earliest version we know
    the syscall is available.  */

diff -Nurp glibc-2.3.2/sysdeps/unix/sysv/linux/sh.orig/pread.c glibc-2.3.2/sysdeps/unix/sysv/linux/sh/pread.c
--- glibc-2.3.2/sysdeps/unix/sysv/linux/sh.orig/pread.c	2003-02-20 00:21:59.000000000 -0500
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/sh/pread.c	2003-06-04 13:03:19.000000000 -0400
@@ -1 +1 @@
-#include <sysdeps/unix/sysv/linux/mips/pread.c>
+#include <sysdeps/unix/sysv/linux/pread.c>
diff -Nurp glibc-2.3.2/sysdeps/unix/sysv/linux/sh.orig/pread64.c glibc-2.3.2/sysdeps/unix/sysv/linux/sh/pread64.c
--- glibc-2.3.2/sysdeps/unix/sysv/linux/sh.orig/pread64.c	2003-02-20 00:21:59.000000000 -0500
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/sh/pread64.c	2003-06-04 13:03:12.000000000 -0400
@@ -1 +1 @@
-#include <sysdeps/unix/sysv/linux/mips/pread64.c>
+#include <sysdeps/unix/sysv/linux/pread64.c>
diff -Nurp glibc-2.3.2/sysdeps/unix/sysv/linux/sh.orig/pwrite.c glibc-2.3.2/sysdeps/unix/sysv/linux/sh/pwrite.c
--- glibc-2.3.2/sysdeps/unix/sysv/linux/sh.orig/pwrite.c	2003-02-20 00:21:59.000000000 -0500
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/sh/pwrite.c	2003-06-04 13:03:08.000000000 -0400
@@ -1 +1 @@
-#include <sysdeps/unix/sysv/linux/mips/pwrite.c>
+#include <sysdeps/unix/sysv/linux/pwrite.c>
diff -Nurp glibc-2.3.2/sysdeps/unix/sysv/linux/sh.orig/pwrite64.c glibc-2.3.2/sysdeps/unix/sysv/linux/sh/pwrite64.c
--- glibc-2.3.2/sysdeps/unix/sysv/linux/sh.orig/pwrite64.c	2003-02-20 00:21:59.000000000 -0500
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/sh/pwrite64.c	2003-06-04 13:03:16.000000000 -0400
@@ -1 +1 @@
-#include <sysdeps/unix/sysv/linux/mips/pwrite64.c>
+#include <sysdeps/unix/sysv/linux/pwrite64.c>


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