[strongSwan-dev] minimum gcc version

Tobias Brunner tobias at strongswan.org
Tue Oct 11 09:57:32 CEST 2022

Hi Ken,

> libtool: compile:  gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I../.. 
> -I../../src/libstrongswan -DIPSEC_DIR=\"/usr/local/libexec/ipsec\" 
> -DIPSEC_LIB_DIR=\"/usr/local/lib/ipsec\" 
> -DPLUGINDIR=\"/usr/local/lib/ipsec/plugins\" 
> -DSTRONGSWAN_CONF=\"/usr/local/etc/strongswan.conf\" -Wno-format 
> -Wno-format-security -Wno-implicit-fallthrough 
> -Wno-missing-field-initializers -Wno-pointer-sign -Wno-sign-compare 
> -Wno-type-limits -Wno-unused-parameter -g -O2 -include 
> /code/strongswan-5.9.8/config.h -MT asn1/asn1.lo -MD -MP -MF 
> asn1/.deps/asn1.Tpo -c asn1/asn1.c  -fPIC -DPIC -o asn1/.libs/asn1.o
> asn1/asn1.c:32:1: error: initializer element is not constant
> asn1/asn1.c:33:1: error: initializer element is not constant
> asn1/asn1.c:34:1: error: initializer element is not constant
> Our configure is pretty simple (with no errors):
> ./configure --enable-openssl --enable-eap-identity --enable-eap-mschapv2
> our gcc --version is:
> gcc (Linaro GCC 4.7-2013.02-01) 4.7.3 20130205
> I assume it's the gcc version the is causing out trouble (which would be 
> troublesome to update), but the configure didn't complain and was 
> wondering what the minimum version is needed.

The actual trigger is `-std=gnu11`, which is checked for and added by 
newer versions of Autoconf.  This causes the errors seen above in GCC 
versions before 5.x.  You can avoid it by passing CFLAGS="-std=gnu90" to 
configure, see [1] for details.


[1] https://github.com/strongswan/strongswan/discussions/1258

More information about the Dev mailing list