This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] Enable ILP32 mode on aarch64 (version 2)
On Thu, Dec 08, 2016 at 09:22:55AM +0100, Andreas Schwab wrote:
> On Dez 07 2016, Steve Ellcey <sellcey@caviumnetworks.com> wrote:
>
> > On Wed, 2016-12-07 at 12:52 +0100, Andreas Schwab wrote:
> >
> >> >
> >> > +#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.
> >
> > So it looks like there are two choices, change STATFS_IS_STATFS64 to
> > __STATFS_IS_STATFS64 so that I can use it to
> > ifdef generic/bits/statfs.h without polluting the namespace or
> > introduce a new aarch64/bits/statfs.h header to use instead of
> > generic/bits/statfs.h. Is there a preference one way or the other?
> > My inclination is to create a new header file.
>
> I agree. The X_IS_Y defines should be kept internal.
You can find both approaches in glibc sources.
sysdeps/unix/sysv/linux/bits/statvfs.h introduces
_STATVFSBUF_F_UNUSED for example, and no one complains there. Both
approaches would work, but I'd prefer to 'pollute' the namespace
because __STATFS_IS_STATFS64 is the new default behavior, and it
should be easily available for all new ports as default option.
While here, there's another problem I'd like to discuss. __field64()
macro is defined twice - in linux/generic/bits/statfs.h and
linux/generic/bits/stat.h. And they are identical, so it's definitely
the code duplication. Probably it's time to create new file for it,
or move it to endian.h or bits/types.h
Yury