Autoreconf race condition?

Jan Synacek jsynacek at
Tue May 22 10:20:06 UTC 2012

Hello all!

I've run into a problem when I was trying to build tftp (master branch) package locally.

    ~/work/tftp$ fedpkg local
    config.status: creating MCONFIG
    config.status: creating aconfig.h
    configure: WARNING: unrecognized options: --disable-dependency-tracking
    + make -j4
    rm -f aconfig.h
    echo \#define VERSION \"tftp-hpa `cat version`\" > version.h
    make -C  lib
    make -C  common
    make[1]: Entering directory `/home/jsynacek/work/tftp/tftp-hpa-5.2/common'
    gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
    --param=ssp-buffer-size=4  -m64 -mtune=generic -W -Wall -Wpointer-arith
    -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes
    -Wmissing-declarations -Wnested-externs -Winline -Wwrite-strings -Wundef
    -Wshadow -Wsign-compare -pipe -fno-strict-aliasing
    -I/home/jsynacek/work/tftp/tftp-hpa-5.2 -c tftpsubs.c
    make[1]: Entering directory `/home/jsynacek/work/tftp/tftp-hpa-5.2/lib'
    make[1]: Nothing to be done for `all'.
    make[1]: Leaving directory `/home/jsynacek/work/tftp/tftp-hpa-5.2/lib'
    In file included from tftpsubs.h:41:0,
                    from tftpsubs.c:34:
    /home/jsynacek/work/tftp/tftp-hpa-5.2/config.h:21:73: fatal error: aconfig.h: No
    such file or directory
    compilation terminated.

Notice the execution of rm -f aconfig.h *after* make. The spec doesn't seem to
be wrong:

    make %{?_smp_mflags}

And here is the corresponding part from the build log:

    CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4  -m64 -mtune=gen
    CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4  -m64 -mtune
    FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4  -m64 -mtune=gen
    LDFLAGS="${LDFLAGS:--Wl,-z,relro }"; export LDFLAGS;
    ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu \
            --program-prefix= \
            --disable-dependency-tracking \
            --prefix=/usr \
            --exec-prefix=/usr \
            --bindir=/usr/bin \
            --sbindir=/usr/sbin \
            --sysconfdir=/etc \
            --datadir=/usr/share \
            --includedir=/usr/include \
            --libdir=/usr/lib64 \
            --libexecdir=/usr/libexec \
            --localstatedir=/var \
            --sharedstatedir=/var/lib \
            --mandir=/usr/share/man \
    make -j4

I also noticed a rather weird comment in the Makefile:

    # Adding "configure" to the dependencies serializes this with running
    # autoconf, because there are apparently race conditions between
    # autoconf and autoheader. configure aclocal.m4
    rm -f aconfig.h

This part also seems to be causing my problem. Adding configure to the
dependencies apparently does not help.

I don't really know what the root cause of my problem is. I looks like a race
condition between some of the autotools, but I'm not really sure.

The problem goes away when I add sleep 1 between autoreconf and %configure in
the spec file.

Any ideas?

Jan Synacek
Software Engineer, BaseOS team Brno, Red Hat

More information about the devel mailing list