coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] build: speed up configure for releases


From: Eric Blake
Subject: Re: [PATCH] build: speed up configure for releases
Date: Tue, 20 Mar 2012 12:08:29 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

On 03/20/2012 10:35 AM, Eric Blake wrote:
> On 03/17/2012 03:34 AM, Jim Meyering wrote:
>> Since I rarely configure without using a cache, I suspect
>> that the speed difference will be negligible for me.
>>
>> On the other hand, for most people, even a speed-up of just
>> a few seconds would probably be welcome.
>>
>> How about a compromise: leave the code there, but guard it with
>> some new envvar setting that is normally off.
>> Then add something to my-distcheck so that for at least one
>> ./configure run it is enabled.  That will preserve the safety net
>> *and* save most people the cost of those added tests.
> 
> Cool idea - I'm playing with an m4_syscmd wrapper that conditionally
> invokes the macro based on the current environment of the autoconf
> process, as well as the counterpart to cfg.mk that sets the envvar.

Hmm; we haven't used GNULIB_POSIXCHECK in quite some time.  Using
GNULIB_POSIXCHECK inside the gnulib directory currently spits out
several warnings on existing gnulib modules; most, if not all, are
probably spurious.  And limiting the check to just coreutils source
code, by doing:

./configure --enable-gcc-warnings
make
make -C src clean
make CFLAGS=-DGNULIB_POSIXCHECK=1 -k

generated 1337 lines of errors where we used a function without a gnulib
module.  Each of those lines calls out the culprit, but you can filter
it down to the specific module complaints, using:

make CFLAGS=-DGNULIB_POSIXCHECK=1 -k 2>&1 \
  | sed -n '/.* error:/ s///p' | sort -u

to come up with this list:

 call to 'access' declared with attribute warning: the access function
is a security risk - use the gnulib module faccessat instead [-Werror]
 call to 'euidaccess' declared with attribute warning: the euidaccess
function is a security risk - use the gnulib module faccessat instead
[-Werror]
 call to 'fdatasync' declared with attribute warning: fdatasync is
unportable - use gnulib module fdatasync for portability [-Werror]
 call to 'fdopen' declared with attribute warning: fdopen on native
Windows platforms is not POSIX compliant - use gnulib module fdopen for
portability [-Werror]
 call to 'fprintf' declared with attribute warning: fprintf is not
always POSIX compliant - use gnulib module fprintf-posix for portable
POSIX compliance [-Werror]
 call to 'ftruncate' declared with attribute warning: ftruncate is
unportable - use gnulib module ftruncate for portability [-Werror]
 call to 'getlogin' declared with attribute warning: getlogin is
unportable - use gnulib module getlogin for portability [-Werror]
 call to 'ioctl' declared with attribute warning: ioctl does not
portably work on sockets - use gnulib module ioctl for portability [-Werror]
 call to 'isatty' declared with attribute warning: isatty has
portability problems on native Windows - use gnulib module isatty for
portability [-Werror]
 call to 'mkfifo' declared with attribute warning: mkfifo is not
portable - use gnulib module mkfifo for portability [-Werror]
 call to 'mknod' declared with attribute warning: mknod is not portable
- use gnulib module mknod for portability [-Werror]
 call to 'pipe' declared with attribute warning: pipe is unportable -
use gnulib module pipe-posix for portability [-Werror]
 call to 'printf' declared with attribute warning: printf is not always
POSIX compliant - use gnulib module printf-posix for portable POSIX
compliance [-Werror]
 call to 'rpl_fseek' declared with attribute warning: fseek cannot
handle files larger than 4 GB on 32-bit platforms - use fseeko function
for handling of large files [-Werror]
 call to 'setlocale' declared with attribute warning: setlocale works
differently on native Windows - use gnulib module setlocale for
portability [-Werror]
 call to 'sprintf' declared with attribute warning: sprintf is not
always POSIX compliant - use gnulib module sprintf-posix for portable
POSIX compliance [-Werror]
 call to 'strchr' declared with attribute warning: strchr cannot work
correctly on character strings in some multibyte locales - use mbschr if
you care about internationalization [-Werror]
 call to 'strcspn' declared with attribute warning: strcspn cannot work
correctly on character strings in multibyte locales - use mbscspn if you
care about internationalization [-Werror]
 call to 'strncat' declared with attribute warning: strncat is
unportable - use gnulib module strncat for portability [-Werror]
 call to 'strpbrk' declared with attribute warning: strpbrk is
unportable - use gnulib module strpbrk for portability [-Werror]
 call to 'strrchr' declared with attribute warning: strrchr cannot work
correctly on character strings in some multibyte locales - use mbsrchr
if you care about internationalization [-Werror]
 call to 'strspn' declared with attribute warning: strspn cannot work
correctly on character strings in multibyte locales - use mbsspn if you
care about internationalization [-Werror]
 call to 'waitpid' declared with attribute warning: waitpid is
unportable - use gnulib module sys_wait for portability [-Werror]

There's probably some real bugs in there, where pulling in additional
gnulib modules is the right thing to do.  But this is not globally true
- for example, the warning for sprintf suggests using sprintf-posix, but
that drags in a lot of baggage, and we are confident that our particular
uses of sprintf don't tickle the particular portability bugs that only
the full-blown sprintf-posix module works around.

In other words, before GNULIB_POSIXCHECK is even worthwhile to leave on,
we would first have to figure out a way to make gnulib suppress
particular warnings, according to what we have audited as being safe.

I have figured out how to make configure.ac conditionalize whether
GNULIB_POSIXCHECK will even work, based on whether $GNULIB_POSIXCHECK is
set in the environment at the time of the 'autoreconf', but I'm not sure
whether it's worth enabling the framework in 'make my-distcheck' unless
we also enable 'CFLAGS=-DGNULIB_POSIXCHECK=1', after first silencing the
above error messages.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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