This is the mail archive of the libc-alpha@sourceware.org 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: [PATCH 2/2] Enable ILP32 mode on aarch64 (version 2)


On Wed, Dec 07, 2016 at 12:52:30PM +0100, Andreas Schwab wrote:
> Please install autoconf 2.69 and configure with
> --enable-maintainer-mode, and make sure you are using the latest kernel
> headers with the ILP32 patches.
> 
> > +#define STATFS_IS_STATFS64	1
> 
> This is a lie. You are using .../generic/bits/statfs.h, which assumes
> that fsblkcnt64_t == 2* fsblkcnt_t (etc.), but ILP32 wants them to be
> the same.

To make statfs and statfs64 identical I used next code in original
patch "generic/wordsize-32: don't duplicate statfs syscalls if not
needed" in .../generic/bits/statfs.h:
@@ -34,7 +48,7 @@
 
#if defined __USE_FILE_OFFSET64
# define __field64(type, type64, name) type64 name
-#elif __WORDSIZE == 64
+#elif __WORDSIZE == 64 || __STATFS_IS_STATFS64
# define __field64(type, type64, name) type name
#elif __BYTE_ORDER == __LITTLE_ENDIAN
# define __field64(type, type64, name) \

It also assumes that STATFS_IS_STATFS64 is visible for user, and so
should be underscored. I suggested define it at place, depending
on size of __fsblkcnt_t and __fsfilcnt_t:

+#if ((defined (__FSBLKCNT_T_TYPE_MATCHES_FSBLKCNT64_T_TYPE) \
+  && !defined (__FSFILCNT_T_TYPE_MATCHES_FSFILCNT64_T_TYPE))) || \
+    (!defined (__FSBLKCNT_T_TYPE_MATCHES_FSBLKCNT64_T_TYPE) \
+   && defined (__FSFILCNT_T_TYPE_MATCHES_FSFILCNT64_T_TYPE))
+# error "__fsblkcnt_t and __fsfilcnt_t should both be 32- or 64-bit."
+#endif
+
+#if (defined (__FSBLKCNT_T_TYPE_MATCHES_FSBLKCNT64_T_TYPE) \
+  && defined (__FSFILCNT_T_TYPE_MATCHES_FSFILCNT64_T_TYPE))    <<<<< This can be removed though
+# define __STATFS_IS_STATFS64  1
+#else
+# define __STATFS_IS_STATFS64  0
+#endif

I still think it's better to define it 'automatically' at place, than
manually in typesizes.h for all ports.

Yury

> .Lsyscall_error in sysdeps/unix/sysv/linux/aarch64/sysdep.h needs to use
> PTR_REG.
> 
> sysdeps/unix/sysv/linux/aarch64/c++-types.data needs to be adapted.
> 
> Andreas.
> 
> -- 
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."


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