[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] AC_SYS_LARGEFILE: define _DARWIN_USE_64_BIT_INODE conditiona
From: |
PHO |
Subject: |
Re: [PATCH] AC_SYS_LARGEFILE: define _DARWIN_USE_64_BIT_INODE conditionally |
Date: |
Wed, 16 Jan 2013 23:14:05 +0900 (JST) |
From: Eric Blake <address@hidden>
Subject: Re: [PATCH] AC_SYS_LARGEFILE: define _DARWIN_USE_64_BIT_INODE
conditionally
Date: Tue, 15 Jan 2013 20:07:03 -0700
> On 01/15/2013 05:01 PM, PHO wrote:
>> * lib/autoconf/specific.m4 (AC_SYS_LARGEFILE): This macro was
>> accidentally defining _DARWIN_USE_64_BIT_INODE with AH_VERBATIM so the
>> variable was defined even when $enable_largefile = no. The bug also
>> caused inconsistency between AH_HEADER and confdefs.h thus
>> AC_COMPUTE_INT(VAR, [sizeof(ino_t)]) produced a wrong result,
>> i.e. 32-bit ino_t for configuration time and 64-bit ino_t for
>> build/run time.
>> ---
>
> Thanks for the report. but I don't think this patch is quite right. Can
> you please provide more details, such as a minimal configure.ac to
> provoke the issue, and the resulting config.h that gets generated
> incorrectly?
OK, here's a set of files to reproduce the problem:
- configure.ac https://gist.github.com/4547173#file-configure-ac
- main.c https://gist.github.com/4547173#file-main-c
- generated config.h.in https://gist.github.com/4547173#file-config-h-in
- generated config.h https://gist.github.com/4547173#file-config-h
- the output https://gist.github.com/4547173#file-log
Expected output of ./main:
SIZEOF_INO_T in config.h: 8
sizeof(ino_t) in actuality: 8
>> [/* Enable large inode numbers on Mac OS X 10.5. */
>> #ifndef _DARWIN_USE_64_BIT_INODE
>> -# define _DARWIN_USE_64_BIT_INODE 1
>> +# undef _DARWIN_USE_64_BIT_INODE
>> #endif])
>
> Unconditionally undefining a macro when it is already inside an #ifndef
> block is pointless.
>From what I understand, AC_DEFINE replaces "#undef" in a header
template, so my patch conditionally rewrites
#ifndef _DARWIN_USE_64_BIT_INODE
# undef _DARWIN_USE_64_BIT_INODE
#endif
to either
#ifndef _DARWIN_USE_64_BIT_INODE
/* #undef _DARWIN_USE_64_BIT_INODE */
#endif
or
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
depending on the value of $enable_largefile.
> Are you stating that you don't need the AH_VERBATIM at all, and can
> instead just use an AC_DEFINE to get the semantics you want?
Yes, AC_DEFINE is all I need. In fact I don't really understand why
AC_SYS_LARGEFILE uses AH_VERBATIM to conditionally define
_DARWIN_USE_64_BIT_INODE. Just in case a compiler defines it by
default?
> And these days, compiling without large file support is rather
> anti-climactic; gnulib, for example, has already decided that it is much
> easier to always insist on large file support than it is to try to make
> it user-configurable.
I have no objection to always enable large file support. I just need a
consistent ino_t both on configure time and build time.
_______________________________________________________
- PHO - http://cielonegro.org/
OpenPGP public key: 1024D/1A86EF72
Fpr: 5F3E 5B5F 535C CE27 8254 4D1A 14E7 9CA7 1A86 EF72
pgpnwClYUoL8F.pgp
Description: PGP signature