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

Re: (ITS#4607) openldap doesn't compile in 64bit/Solaris10



Kurt D. Zeilenga wrote:
> Concur.  All the exposed symbols/macros should be prefixed with lutil_/LUTIL_.

In the meantime, one could add CFLAGS='-D_AVL_H' to the build
environment. See
http://groups.google.com/group/comp.unix.solaris/tree/browse_frm/thread/1aa8adbc92c3588a

BTW: sys/vnode.h including sys/avl.h has been recognized as a bug:
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6419029

Norbert

> 
> At 09:01 AM 8/7/2006, norbert+lists.openldap-bugs@burgundy.dyndns.org wrote:
> 
>> fbertels@ixis-cib.com wrote:
>>> Full_Name: Frank Bertels
>>> Version: 2.3.24
>>> OS: Solaris 10
>>> URL: ftp://ftp.openldap.org/incoming/
>>> Submission from: (NULL) (84.14.112.200)
>>>
>>>
>>> Hi, 
>>>
>>> it seems that there exist a big issue concerning compiling in 64bit on Solaris
>>> 10 with SUN Studio 11 (and gcc, too):
>>>
>>> I tried the following (the machine has all actual patches installed, meaning,
>>> OS, header, Studio - state of 04.July 2006 - checked with 'smpatch' command and
>>> search for Studio patches on sunsolve):
>>> With SUN Studio 11:
>>> At first I installed the BerkelyDB in 64bit in /usr/local/BerkeleyDB.4.4 and
>>> openssl in /usr/local/openssl-0.9.7i without any problems. Then (in bash):
>>> # cd /tmp
>>> # gtar xvzf openldap-stable-20060606.tgz
>>> # cd openldap-2.3.24
>>> # CC="/opt/SUNWspro/bin/cc"
>>> # test `isainfo -k` != amd64 && opt="-fast "
>>> # CFLAGS="${opt}-xarch=`isainfo -k | sed s/sparc//`"
>>> # CPPFLAGS="-I/usr/local/openssl/include -I/usr/local/BerkeleyDB.4.4/include"
>>> # LDFLAGS="-L/usr/local/openssl/lib -R/usr/local/openssl/lib \
>>>            -L/usr/local/BerkeleyDB.4.4/lib -R/usr/local/BerkeleyDB.4.4/lib"
>>> # export CC CFLAGS CPPFLAGS LDFLAGS
>>> # ./configure --prefix=/usr/local/openldap --disable-ipv6
>>> .....
>>> ....
>>> # make depend
>>> ...
>>> ...
>>> # make
>>> ...
>>>   Entering subdirectory librewrite
>>> rm -f version.c
>>> ../../build/mkversion -v "2.3.24" librewrite.a > version.c
>>> /opt/SUNWspro/bin/cc -fast -xarch=v9 -I../../include -I../../include  
>>> -I/usr/local/openssl/include -I/usr/local/BerkeleyDB.4.4/include 
>>> -I/usr/local/openssl/include -I/usr/local/BerkeleyDB.4.4/include -c  config.c
>>> "../../include/avl.h", line 86: identifier redeclared: avl_insert
>>>         current : function(pointer to pointer to struct avlnode {pointer to void
>>> avl_data, array[2] of pointer to struct avlnode {..} avl_link, array[2] of char
>>> avl_bits, signed char avl_bf}, pointer to void, pointer to function(..)
>>> returning int, pointer to function(..) returning int) returning int
>>>         previous: function(pointer to struct avl_tree {pointer to struct
>>> avl_node {..} avl_root, pointer to function(..) returning int avl_compar,
>>> unsigned long avl_offset, unsigned long avl_numnodes, unsigned long avl_size},
>>> pointer to void, unsigned long) returning void : "/usr/include/sys/avl.h", line
>>> 154
>>> "../../include/avl.h", line 92: identifier redeclared: avl_find
>>>         current : function(pointer to struct avlnode {pointer to void avl_data,
>>> array[2] of pointer to struct avlnode {..} avl_link, array[2] of char avl_bits,
>>> signed char avl_bf}, pointer to const void, pointer to function(..) returning
>>> int) returning pointer to void
>>>         previous: function(pointer to struct avl_tree {pointer to struct
>>> avl_node {..} avl_root, pointer to function(..) returning int avl_compar,
>>> unsigned long avl_offset, unsigned long avl_numnodes, unsigned long avl_size},
>>> pointer to void, pointer to unsigned long) returning pointer to void :
>>> "/usr/include/sys/avl.h", line 146
>>> cc: acomp failed for config.c
>>> *** Error code 2
>>> make: Fatal error: Command failed for target `config.o'
>>> Current working directory /tmp/openldap-2.3.24/libraries/librewrite
>>> *** Error code 1
>>> The following command caused the error:
>>> for i in liblutil  liblber  liblunicode  libldap libldap_r  librewrite ; do     
>>>        \
>>>         echo "  Entering subdirectory $i";              \
>>>         ( cd $i; make  all );           \
>>>         if test $? != 0 ; then exit 1; fi ;     \
>>>         echo " ";                                                              
>>> \
>>> done
>>> make: Fatal error: Command failed for target `all-common'
>>> Current working directory /tmp/openldap-2.3.24/libraries
>>> *** Error code 1
>>> The following command caused the error:
>>> for i in include libraries clients servers tests doc ; do               \
>>>         echo "  Entering subdirectory $i";              \
>>>         ( cd $i; make  all );           \
>>>         if test $? != 0 ; then exit 1; fi ;     \
>>>         echo " ";                                                              
>>> \
>>> done
>>> make: Fatal error: Command failed for target `all-common'
>>>
>>> What appears to be happening is that OpenLDAP's mkdep script is asking the 
>>> compiler for its dependencies, and /usr/include/sys/avl.h and avl_impl.h 
>>> get listed before OpenLDAP's local ../../include/avl.h. Hence the 
>>> conflicting types error. 
>>> I tried with gcc, too, and got the same error.
>>> The code from this package compiles fine under Solaris 9 sparc with gcc 3.4.2. 
>>> The resulting Makefiles only show a dependency on ../../include/avl.h whereas
>>> under Solaris  10 they show a dependency from ../../include/avl.h and
>>> /usr/include/sys/avl.h
>>> So this seems to be a specific problem with Solartis 10. 
>>> The default CPPFLAGS only include the local OpenLDAP header, 
>>> so somewhere along the way /usr/include/sys is being injected.
>> I ran into the same problem on Solaris 10, update 1, x86.
>>
>> The inclusion tree is as follows:
>> "rewrite-int.h"
>> "ac/socket.h"
>>  <sys/socket.h>
>>   <netinet/in.h>
>>    <sys/stream.h>
>>     <sys/vnode.h>
>>      <sys/avl.h>
>> BTW: on Solaris 10 SPARC, vnode.h does not include avl.h!
>>
>>
>>> Suggestions on what can be changed to get this package compiled would be 
>>> appreciated. 
>> Giving all identifiers in OpenLDAP's avl implementation a unique prefix
>> should probably work.
>>
>> Norbert
>>
>>> Regards
>>>
>>> Frank
>