On Mon, 2011-11-28 at 15:32 -0500, Ted Ts'o wrote:
> On Mon, Nov 28, 2011 at 07:37:53PM +0100, Svante Signell wrote:
> > 
> > Checking for HAVE_MSYNC helps because configure finds the stub and
> > decides it is not usable, see below.
> 
> Um, how does configure find the stub if you're just doing an
> 
> AC_CHECK_FUNCS(... msync ...)
> 
> That just checks if a function can link against msync() and not fail.
> It's not going to cause configure to go peering deeply into header
> files.  Are you proposing that we use some specific autoconf macro?
> If so, which macro?  Your patch just uses AC_CHECK_FUNCS, which
> doesn't have any kind of hueristic magic or artificial intelligence
> capabilities as far as I know....

Yes, it came as a surprise for me too:

On GNU/Linux
============
>From the build log:
checking for msync... yes

>From ./debian/BUILD-STD/config.log:
configure:10910: checking for msync
configure:10910: gcc -o conftest -D__NO_STRING_INLINES   conftest.c
-lblkid  >&5
configure:10910: $? = 0
configure:10910: result: yes

ON GNU/Hurd
===========
>From the build log:
checking for msync... no

>From ./debian/BUILD-STD/config.log:
configure:10910: checking for msync
configure:10910: gcc -o conftest -D__NO_STRING_INLINES   conftest.c
-lblkid  >&5
conftest.c:196:1: error: unknown type name 'choke'
conftest.c:199:1: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'int'
configure:10910: $? = 1
configure: failed program was:
| /* confdefs.h */
...
| #define HAVE_BACKTRACE 1
| /* end confdefs.h.  */
| /* Define msync to an innocuous variant, in case <limits.h> declares
msync.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define msync innocuous_msync
| 
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char msync (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
| 
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| 
| #undef msync
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char msync ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_msync || defined __stub___msync
| choke me
| #endif
| 
| int
| main ()
| {
| return msync ();
|   ;
|   return 0;
| }
configure:10910: result: no





-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to