Project

General

Profile

Bug #536

Build failed on CentOS 6.5

Added by Pavel Kopchyk over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
build
Target version:
Start date:
03.03.2014
Due date:
Estimated time:
Affected version:
5.1.2
Resolution:
Fixed

Description

Hi,

I try to build Current Release: 5.1.2 on CentOS 6.5.

rpmbuild --ba strongswan.spec

...
+ cd strongswan-5.1.2
+ LANG=C
+ export LANG
+ unset DISPLAY
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -I/usr/lib/gfortran/modules'
+ export FFLAGS
+ ./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i686-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-static --with-ipsec-script=strongswan --sysconfdir=/etc/strongswan --with-ipsecdir=/usr/libexec/strongswan --with-ipseclibdir=/usr/lib/strongswan --enable-openssl --enable-md4 --enable-xauth-eap --enable-eap-md5 --enable-eap-gtc --enable-eap-tls --enable-eap-ttls --enable-eap-peap --enable-eap-mschapv2 --enable-sqlite --enable-eap-radius --enable-curl --enable-eap-identity --disable-scripts
...

 strongSwan will be built with the following plugins
-----------------------------------------------------
libstrongswan: curl sqlite aes des rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf gmp xcbc cmac hmac
libcharon:     socket-default stroke updown eap-identity eap-md5 eap-gtc eap-mschapv2 eap-radius eap-tls eap-ttls eap-peap xauth-generic xauth-eap
libhydra:      attr kernel-netlink resolve
libtnccs:     

+ make -s -j16
/var/build/rpmbuild/BUILD/strongswan-5.1.2/missing: line 81: aclocal-1.13: command not found
WARNING: 'aclocal-1.13' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make: *** [aclocal.m4] Error 127
error: Bad exit status from /var/build/rpmbuild/tmp/rpm-tmp.wpSkEI (%build)

RPM build errors:
    Bad exit status from /var/build/rpmbuild/tmp/rpm-tmp.wpSkEI (%build)

I add to %build section autoreconf -f -i

...
+ cd strongswan-5.1.2
+ LANG=C
+ export LANG
+ unset DISPLAY
+ autoreconf -f -i
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4/config'.
libtoolize: copying file `m4/config/libtool.m4'
libtoolize: copying file `m4/config/ltoptions.m4'
libtoolize: copying file `m4/config/ltsugar.m4'
libtoolize: copying file `m4/config/ltversion.m4'
libtoolize: copying file `m4/config/lt~obsolete.m4'
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -I/usr/lib/gfortran/modules'
+ export FFLAGS
+ ./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i686-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-static --with-ipsec-script=strongswan --sysconfdir=/etc/strongswan --with-ipsecdir=/usr/libexec/strongswan --with-ipseclibdir=/usr/lib/strongswan --enable-openssl --enable-md4 --enable-xauth-eap --enable-eap-md5 --enable-eap-gtc --enable-eap-tls --enable-eap-ttls --enable-eap-peap --enable-eap-mschapv2 --enable-sqlite --enable-eap-radius --enable-curl --enable-eap-identity --disable-scripts
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
...
checking for sem_timedwait... yes
checking for gettid... no
checking for SYS_gettid... yes
checking for qsort_r... yes
./configure: line 19248: syntax error near unexpected token `fi'
./configure: line 19248: `fi'
error: Bad exit status from /var/build/rpmbuild/tmp/rpm-tmp.InNZfm (%build)

RPM build errors:
    Bad exit status from /var/build/rpmbuild/tmp/rpm-tmp.InNZfm (%build)

Problem:

./configure: line 19248: syntax error near unexpected token `fi'
./configure: line 19248: `fi'

less ./configure

19220 #define HAVE_QSORT_R_BSD /**/
19221 _ACEOF
19222 
19223 else
19224   $as_echo "$as_me: failed program was:" >&5
19225 sed 's/^/| /' conftest.$ac_ext >&5
19226 
19227         { $as_echo "$as_me:$LINENO: result: no" >&5
19228 $as_echo "no" >&6; };
19229                          { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
19230 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
19231 { { $as_echo "$as_me:$LINENO: error: qsort_r has unknown semantics
19232 See \`config.log' for more details." >&5
19233 $as_echo "$as_me: error: qsort_r has unknown semantics
19234 See \`config.log' for more details." >&2;}
19235    { (exit 1); exit 1; }; }; }
19236 fi
19237 
19238 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19239 
19240 fi
19241 
19242 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19243                 CFLAGS="$save_CFLAGS" 
19244 
19245 else
19246 
19247 
19248 fi
19249 
19250 
19251 
19252 
19253 
19254 
19255 
19256 
19257 
19258 for ac_func in prctl mallinfo getpass closefrom getpwnam_r getgrnam_r getpwuid_r
19259 do
19260 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`

BUT manual build works (no problem):

tar -xf strongswan-5.1.2.tar.bz2
cd strongswan-5.1.2
./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i686-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-static --with-ipsec-script=strongswan --sysconfdir=/etc/strongswan --with-ipsecdir=/usr/libexec/strongswan --with-ipseclibdir=/usr/lib/strongswan --enable-openssl --enable-md4 --enable-xauth-eap --enable-eap-md5 --enable-eap-gtc --enable-eap-tls --enable-eap-ttls --enable-eap-peap --enable-eap-mschapv2 --enable-sqlite --enable-eap-radius --enable-curl --enable-eap-identity --disable-scripts
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
...
config.status: creating src/pki/man/pki---verify.1
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

 strongSwan will be built with the following plugins
-----------------------------------------------------
libstrongswan: curl sqlite aes des rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf gmp xcbc cmac hmac
libcharon:     socket-default stroke updown eap-identity eap-md5 eap-gtc eap-mschapv2 eap-radius eap-tls eap-ttls eap-peap xauth-generic xauth-eap
libhydra:      attr kernel-netlink resolve
libtnccs:     

make -s -j16 -l32

Making all in src
Making all in .
Making all in include
Making all in libstrongswan
Making all in .
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/libstrongswan -DIPSEC_DIR=\"/usr/libexec/strongswan\" -DIPSEC_LIB_DIR=\"/usr/lib/strongswan\" -DPLUGINDIR=\"/usr/lib/strongswan/plugins\" -DSTRONGSWAN_CONF=\"/etc/strongswan/strongswan.conf\" -g -O2 -Wall -Wno-format -Wno-format-security -Wno-pointer-sign -include /home/kopchyk/rpmbuild/BUILD/strongswan-5.1.2/config.h -MT library.lo -MD -MP -MF .deps/library.Tpo -c library.c  -fPIC -DPIC -o .libs/library.o
...
Making all in man
libtool: link: gcc -g -O2 -Wall -Wno-format -Wno-format-security -Wno-pointer-sign -include /home/kopchyk/rpmbuild/BUILD/strongswan-5.1.2/config.h -o .libs/pki pki.o command.o commands/gen.o commands/issue.o commands/keyid.o commands/pub.o commands/req.o commands/self.o commands/print.o commands/signcrl.o commands/pkcs7.o commands/verify.o  ../../src/libstrongswan/.libs/libstrongswan.so -Wl,-rpath -Wl,/usr/lib/strongswan
Making all in man
Making all in conf
Making all in init
Making all in testing

strongswan-init.patch (5.34 KB) strongswan-init.patch Pavel Kopchyk, 05.03.2014 12:01

Associated revisions

Revision af15c71b (diff)
Added by Tobias Brunner over 6 years ago

configure: Fix autoreconf with older autotools

Older autoconf versions (e.g. on CentOS 6.5) produce an empty else block
for the removed empty argument, which the shell then trips over when
executing ./configure.

Fixes #536.

History

#1 Updated by Tobias Brunner over 6 years ago

  • Tracker changed from Issue to Bug
  • Category set to build
  • Status changed from New to Resolved
  • Assignee set to Tobias Brunner
  • Target version set to 5.1.3
  • Affected version set to 5.1.2
  • Resolution set to Fixed

rpmbuild --ba strongswan.spec

...
/var/build/rpmbuild/BUILD/strongswan-5.1.2/missing: line 81: aclocal-1.13: command not found

Is there a reason why this happens? Does rpmbuild modify any of the build files that come with the tarball? (configure.ac? any of the m4 macros?)

The problem with calling autoreconf on CentOS 6.5 is that the packaged autotools are pretty old. And apparently an empty last argument for AC_CHECK_FUNC (source:configure.ac@1d252e9dec#L532) produces that empty else block that the shell doesn't like. With newer autoconf versions no else block is generated, which is why the unmodified sources compile fine. The associated patch removes the empty argument and should fix the issue.

But you should definitely try to determine why calling autoreconf would be required in the first place.

#2 Updated by Pavel Kopchyk over 6 years ago

Patch work for me. Thanks!

After a little investigation, I found out that the problem originate after applying the patch strongswan-init.patch (in fact I do rebuild strongswan-5.1.1-4.el6.src.rpm from EPEL with additional parameters and strongswan-init.patch).

The same thing happens if I use only this (af15c71b) patch (without strongswan-init.patch and without calling autoreconf).

rpmbuild --bb strongswan.spec

...
+ cd /var/build/rpmbuild/BUILD
+ rm -rf strongswan-5.1.2
+ /usr/bin/bzip2 -dc /var/build/rpmbuild/SOURCES/strongswan-5.1.2.tar.bz2
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd strongswan-5.1.2
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #1 (strongswan-5.1.2-001-fix-autoreconf.patch):'
Patch #1 (strongswan-5.1.2-001-fix-autoreconf.patch):
+ /bin/cat /var/build/rpmbuild/SOURCES/strongswan-5.1.2-001-fix-autoreconf.patch
+ /usr/bin/patch -p1 --fuzz=0
patching file configure.ac
+ exit 0
Executing(%build): /bin/sh -e /var/build/rpmbuild/tmp/rpm-tmp.nv7ej2
+ umask 022
+ cd /var/build/rpmbuild/BUILD
+ cd strongswan-5.1.2
...
+ ./configure ...
...
config.status: executing libtool commands

 strongSwan will be built with the following plugins
-----------------------------------------------------
libstrongswan: curl sqlite aes des rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf gmp xcbc cmac hmac
libcharon:     socket-default stroke updown eap-identity eap-md5 eap-gtc eap-mschapv2 eap-radius eap-tls eap-ttls eap-peap xauth-generic xauth-eap
libhydra:      attr kernel-netlink resolve
libtnccs:     

+ make
/var/build/rpmbuild/BUILD/strongswan-5.1.2/missing: line 81: aclocal-1.13: command not found
WARNING: 'aclocal-1.13' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make: *** [aclocal.m4] Error 127
error: Bad exit status from /var/build/rpmbuild/tmp/rpm-tmp.nv7ej2 (%build)

RPM build errors:
    Bad exit status from /var/build/rpmbuild/tmp/rpm-tmp.nv7ej2 (%build)

#3 Updated by Tobias Brunner over 6 years ago

The problem is that the source tarball was created on a recent Ubuntu host (i.e. in aclocal.m4 am__api_version is set to 1.13). So when make runs and detects that configure.ac got changed (due to my patch or strongswan-init.patch) it tries to recreate the build files using the program versions noted in the build files. This usually makes sense, as it should only happen during development, and if multiple versions of autotools are installed, you want the same version to get used when the files are updated. In your case, however, this won't work as that particular version of aclocal is not available.

Calling autoreconf -f avoids this issue as it uses the autotools that are currently installed on your system to recreate all the build files.

I saw that the .spec file actually calls autoreconf before executing configure, but unfortunately without -f, leaving files such as aclocal.m4 unchanged. You should probably report this problem to the package maintainer (along with my patch).

#4 Updated by Pavel Šimerda over 6 years ago

Hi Pavel,

pity you didn't start a Fedora/EPEL bugzilla as well as the very same Strongswan package is in EPEL. I ran into the same problem when updating the EPEL build:

http://koji.fedoraproject.org/koji/buildinfo?buildID=504524
http://kojipkgs.fedoraproject.org//work/tasks/3930/6633930/build.log

By the way, the strongswan-init.patch is there only to support EPEL6 and thus CentOS 6 among others. I was going to remove the patch and just install a complete initscript which would remove one reason to rebuild the configure script but now there's another, see issue #538.

For now I'll add the patch to the rawhide build.

#6 Updated by Tobias Brunner over 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF