bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_SYS_LARGEFILE and old OSX framework


From: Yann Diorcet
Subject: AC_SYS_LARGEFILE and old OSX framework
Date: Wed, 30 Oct 2013 13:38:47 +0100

 I notice an issue with autoconf when i'm using an old osx framework (or
old version)
: -mmacosx-version-min < 10.6

When we use AC_SYS_LARGEFILE the autoconf add
# define _DARWIN_USE_64_BIT_INODE 1
in the config.h

due to


 AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],
[/* Enable large inode numbers on Mac OS X 10.5.  */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif])
fi

in specific.m4

This may cause segmentation fault on generated file (certainly linked to a
different struct stat)

The default behaviour of OSX sdk is:

#  else /* default */
#    if __DARWIN_ONLY_64_BIT_INO_T
#      define __DARWIN_64_BIT_INO_T 1
#    elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) &&
((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1060) ||
__DARWIN_UNIX03 == 0
#      define __DARWIN_64_BIT_INO_T 0
#    else /* default */
#      define __DARWIN_64_BIT_INO_T 1
#    endif /* __DARWIN_ONLY_64_BIT_INO_T */
#  endif

Forcing the value _DARWIN_USE_64_BIT_INODE overrides this.

For example with glib 2.30.3 with -mmacosx-version-min 10.4
A call to g_key_file_load_from_file with an existing regular file return an
error
"Not a regular file". (st_mode&0xF000 = 0x9000)
And sometimes it works ...
But if i remove _DARWIN_USE_64_BIT_INODE from config.h
All works correctly.

Maybe we have to check the -mmacosx-version-min version before forcing (or
not forcing at all)

Here another thread talking about this issue:
https://github.com/joyent/node/issues/2061


-- 
*Diorcet Yann**
*


reply via email to

[Prev in Thread] Current Thread [Next in Thread]