[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#7074) back-ldap module compilation issue with gcc 4.6.1

Full_Name: Stéphane PAQUOT
Version: 2.4.26
OS: Windows (MingW)
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (


I am actually compiling backend modules for openldap 2.4.26 with MingW (gcc
version 4.6.1, GNU make 3.81, GNU libtool 2.4, GNU automake 1.11.1, GNU autoconf
An issue occurs when compiling back-ldap module.

The GNU tools used are the following :
        host-triplet:   i686-pc-mingw32
        shell:          /bin/sh
        compiler:               gcc
        compiler flags:         -O3 -s -mms-bitfields -march=i386 -mtune=i686
        linker:         c:/mingw/mingw32/bin/ld.exe (gnu? yes)
        libtool:        (GNU libtool) 2.4
        automake:       automake (GNU automake) 1.11.1
        autoconf:       autoconf (GNU Autoconf) 2.68

The command line to compile openldap 2.4.26 is the following

./configure --prefix=/software/openldap \
        --enable-slapd \
        --enable-modules \
        --enable-rewrite \
        --enable-bdb=mod \
        --enable-hdb=mod \
        --enable-ldap=mod \
        --enable-sql=mod \
	--enable-monitor=mod \
        --enable-accesslog=mod \
        --enable-auditlog=mod \
        --enable-rwm=mod \
	--enable-syncprov=mod \
        --with-odbc=odbc32 \
        --with-tls=openssl \

Here are the compilation flags :
LDFLAGS="-I/software/openssl/lib -I/software/berkeleydb/berkeleydb-5.2/lib"
LIBS="-lodbc32 -lws2_32"

All backends modules and overlays compile fine but when compiling backend
back-ldap as a module, the following compile error occurs : error: initializer
element is not constant.

$ make
/bin/sh ../../../libtool --tag=disable-static --mode=compile gcc -g -O2
 -I../../../include        -I../../../include -I.. -I./.. 
nclude -I/software/berkeleydb/berkeleydb-5.2/include   -DSLAPD_IMPORT -c

 gcc -g -O2 -std=c89 -I../../../include -I../../../include -I.. -I./..
re/openssl/include -I/software/berkeleydb/berkeleydb-5.2/include -DSLAPD_IMPORT
-c chain.c  -DDLL_EXPORT -DPIC -o .libs/chain.o
chain.c:1273:3: error: initializer element is not constant
chain.c:1273:3: error: (near initialization for 'chainocs[1].co_table')
make: *** [chain.lo] Error 1

gcc 4.6.1 complains about 

static ConfigOCs chainocs[] = {
        { "( OLcfgOvOc:3.1 "
                "NAME 'olcChainConfig' "
                "DESC 'Chain configuration' "
                "SUP olcOverlayConfig "
                "MAY ( "
                        "olcChainingBehavior $ "
                        "olcChainCacheURI $ "
                        "olcChainMaxReferralDepth $ "
                        "olcChainReturnError "
                        ") )",
                Cft_Overlay, chaincfg, NULL, chain_cfadd },
        { "( OLcfgOvOc:3.2 "
                "NAME 'olcChainDatabase' "
                "DESC 'Chain remote server configuration' "
                "AUXILIARY )",
                Cft_Misc, olcDatabaseDummy, chain_ldadd
                , NULL, chain_lddel
        { NULL, 0, NULL}

I try to solve this problem but I'm a little stuck. When back-ldap is not
compiled as a module, no problem, slapd compiles fine with this backend

Best regards and many thanks to you.

Stéphane PAQUOT
Database Administrator (Sybase, Oracle, MS SQL Server, MySQL).
France, Paris.