This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports 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]

Fix ftw64 for MIPS n64


On MIPS n64, struct stat and struct stat64 have different layouts (I don't 
know the background to this but presume it is a historical mistake that is 
now part of the ABI rather than a deliberate design choice).  This is 
mainly dealt with by not using sysdeps/unix/sysv/linux/wordsize-64 on this 
target, as that directory has most of the function versions that assume 
the two are the same and so the stat64 versions can be aliases of the 
other versions.

The functions ftw/nftw involve struct stat in their interfaces, so also 
must be distinct from ftw64 and nftw64 on MIPS n64 - but there the version 
making them aliases is in sysdeps/wordsize-64, a directory that *is* used 
on n64.  I've applied this patch to fix those functions by having n64 
overrides that use the <io/ftw*.c> versions directly.  I don't see any 
such issues with the other functions in sysdeps/wordsize-64.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index 74c7bdd..abfc2b4 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2011-11-17  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c: New.
+
 2011-11-11  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/dl-lookup.c: Update from generic version.
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c
new file mode 100644
index 0000000..4638956
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw.c
@@ -0,0 +1 @@
+#include <io/ftw.c>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c
new file mode 100644
index 0000000..cb02172
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ftw64.c
@@ -0,0 +1 @@
+#include <io/ftw64.c>

-- 
Joseph S. Myers
joseph@codesourcery.com


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