apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Re: AC_CHECK_LIB issues under maintainer mode (Was: Re: Tagging 2.4.29 / 2.5.0-{alpha/beta?} today)
Date Sun, 15 Oct 2017 14:03:42 GMT
Hi Jim,

Am 13.10.2017 um 17:51 schrieb Jim Jagielski:
> Let's recall what is really happening...
> 
> In maintainer mode, the build system sets -Werror and -Wstrict-prototypes.
> This means that functions which lack strict prototypes will "fail".
> 
> Now note that AC_CHECK_LIB does not worry about generating
> function calls w/ prototypes, so, for example, when checking
> for luaL_newstate, it will fail *even if the function exists*!
> In fact, this is how I 1st observed the issue: mod_lua was
> no longer being included.
> 
> The long and short is that under maintainer mode, we cannot
> expect AC_CHECK_LIB to being correct any longer, because
> the combination of -Werror and -Wstrict-prototypes means
> that any and all functions looked for/checked for using
> AC_CHECK_LIB will NOT be found, due to warnings which are
> now fatal errors during configure time, even if those
> functions DO exist.
> 
> PS: CCing dev@apr since APR also uses AC_CHECK_LIB

I has a look at this. autoconf does generate a line they call a 
prototype, but it is not a strict prototype (there's no type information 
for the function arguments):

/* 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 luaL_newstate ();
int
main ()
{
return luaL_newstate ();
   ;
   return 0;
}

Directly before the "int main" there's the broken prototype line

char luaL_newstate ();

And in fact the compiler would also complain about

int
main ()

due to the missing "void" for the arguments.

Of all the flags we set in maintainer mode, the combination that lets 
the compiler fail is:

-Wstrict-prototypes
-Werror

It fails for me also when using GCC (from 4.1.2 to 7.1.0)! So I think a 
clang-specific solution is incomplete.

Why is this happening now? The "-Werror" was backported last December in 
r1772330, which was a backport of r1702948 from trunk (May 2015). Maybe 
people haven't used maintainer mode since then?

Regards,

Rainer

Mime
View raw message