Re: Unable to build ldap c-sdk on Solaris 9/10

Rich Megginson <[email protected]> Wed, 24 Feb 2010 08:08:52 -0700
Newsgroups gmane.comp.mozilla.devel.directory
Message-ID <[email protected]>
Please keep this thread on the newsgroup.

Ashwani Saxena wrote:
> Rich,
>
> You were correct, earlier the c-SDK was built using using -g but -O2 
> option using GNU GCC compiler. Today i build the same using both -g 
> and -O2 options, built my program referring updated c-SDK libraries 
> and tested SSL communictation.
>
> As a result it failed again and created the core dump. While analyzing 
> core file like earlier it didnt give much info. GNU GDB backtrace same 
> as i sent earlier. 
>
> Here I have few points where I required bit clarification.
>
> 1. Can I remove the dependency of libatomic.so file from 
> "mozilla\directory\c-sdk\config\autoconfig.mk <http://autoconfig.mk>" 
> file?
I don't know.  I'm not sure why it is there.
>
> 2. If I remove the dependency, does it affect in anyway?
I don't know.
>
> BY default autoconf.mk <http://autoconf.mk> file has following line of 
> code:
>
> /ULTRASPARC_FILTER_LIBRARY = libatomic.so
> DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@) -f 
> $(ULTRASPARC_FILTER_LIBRARY)/
>
> I made 2 changes it to below mentioned line to remove libatomic.so 
> dependency and facilitating to building all c-sdk ldap libraries.
>
> a) Added -L in $(notdir $@ as it was not there earlier. Without it 
> caused error.
> b) Removed "-f $(ULTRASPARC_FILTER_LIBRARY)" from line.
>
>  DSO_LDOPTS = -shared -Wl,-soname -Wl,-L$(notdir $@)
>
>
> 3. upgrage to Sun Forte comipler on Solaris. 
>   a) Is Sun Forte compiler is freeware?
I'll let someone from Sun answer that question.  It is free to use, I 
don't know if there are any restrictions on use in commercial products, 
or any restrictions on redistribution/sale of products built using it.
>   b) Which version of Sun Forte C/C++ compiler is recommended to build 
> Mozilla LDAP c-SDK (6.0.3)?
Whatever the latest version is.
>   c) Does Sun Forte compiler also provides ar, ld, ranlib and other 
> required dependencies required to build c-SDK.
Those either come with the operating system itself (/usr/bin/ccs? 
/usr/lib/ccs?  it's been a long time since I did anything with Solaris) 
or are provided with the compiler.
>
> 4. If I build c-SDK on Solaris 8, would that also be supported on 
> further releases i.e. Solaris 9, Solaris 10, etc.
I don't know.
>
>
>
> Regards,
> Ashwani Saxena
>
>
> On Tue, Feb 23, 2010 at 10:50 PM, Rich Megginson 
> <[email protected] <mailto:[email protected]>> wrote:
>
>     Ashwani Saxena wrote:
>
>         Rich,
>
>         Please find the comments below.
>
>
>
>         On Mon, Feb 22, 2010 at 9:54 PM, Rich Megginson
>         <[email protected] <mailto:[email protected]>> wrote:
>
>             Ashwani Saxena wrote:
>
>                 Rich,
>
>                 Thanks a lot for your quick response.
>
>                 BTW I was able to build c-sdk on both SOLARIS (sparc)
>                 9 and 10 finally :)
>
>                 After a long research i found that  It requires
>                 libatomic.so to be
>                 available in order to build c-sdk on SOLARIS.
>
>                 As claimed on WEB
>
>             link?
>
>         [ASH]
>          http://www.mozilla.org/projects/nspr/release-notes/nspr35.html
>
>
>     wow - those instructions are dated 1999.
>
>
>                 that libatomic.so file is part of NSPR but i dont
>                 see such file after i compiler NSS as NSPR.
>                 Fortunetely  I had iplanet
>                 server installed in the same machine and they provide
>                 this file. I
>                 placed the same file in required location and was able
>                 to build c-LDAP
>                 sdk.
>
>             Do you know which package provides libatomic.so?  I
>             believe you can use
>
>         the
>
>             pkgchk command.
>
>         [ASH] I ran pkgchk but it didnt give any information about
>         this file. I have
>
>         copied this file from installation directory of iplant server.
>
>
>     How do I find out if package pkgname is installed?
>     pkginfo pkgname
>
>     or
>
>     pkginfo | grep pkgname
>
>
>      How do I list all of the files/directories provided by a package?
>     pkgchk -v pkgname e.g.
>
>     pkgchk -v SUNWfoo
>
>      How do I find out which package provides a file/directory?
>
>     pkgchk -l -p /path/to/fileordirectory e.g.
>
>     pkgchk -l -p /usr/lib/sparcv9/libfoo.so
>
>
>                 I am using GUN GCC 3.4, Make 3.81 as per the
>                 prerequisite mentioned in
>                 http://www.mozilla.org/directory/csdk.html, not the
>                 one provided by
>                 Solaris.
>
>             That page has moved to https://wiki.mozilla.org/LDAP_C_SDK
>
>         [ASH] even in this page under "Obtaining Build Tools and
>         Setting Up Your
>
>         Environment" section for SOLARIS it says using GCC (instead of
>         the Sun/Forte
>         compiler).....
>
>
>     I guess it's not very clear that the section is "Solaris using GCC
>     (instead of the Sun/Forte compiler) "
>
>     I guess it should say "You are strongly encouraged to download and
>     use the free Forte compilers from Sun - however, if you are truly
>     committed to using GCC, you can if you are willing to jump through
>     several hoops"
>
>             GNU make is definitely a pre-requisite.  GNU GCC is not.
>              I'm glad you got
>             it to work, but I'm curious as to where and how
>             libatomic.so is used, and
>             where it comes from.
>
>         [ASH] This library was required to build
>         c-SDK->ldap->libraries (e.g
>
>         libldif, libssldap, etc....).
>         Once i ran command "CC=gcc CCC=g++ ./configure --with-nss"
>         from c-sdk, it
>         created autoconf.mk <http://autoconf.mk> file under config
>         folder and other required Makefile.
>
>         After that i ran "make" command from  c-sdk folder to create
>         c-SDK library
>         files.
>
>         Initilally it failed with following error:
>
>         ERROR:
>         /export/home/users/ashwani/mozldap-6.0.3/mozilla/directory/c-sdk/ldap/libraries/libldif
>         gcc -shared -Wl,-soname -Wl,libldif60.so -f libatomic.so    
>         -o libldif60.so
>         ./line64.o
>         ld: warning: option -o appears more than once, first setting taken
>         ld: fatal: file libldif60.so: unknown file type
>         ld: fatal: File processing errors. No output written to
>         libldif60.so
>
>         In order to fix this problem i made the following changes in
>         c-sdk->config->
>         autoconf.mk <http://autoconf.mk> file.
>
>         Change From :
>         DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@) -f
>         $(ULTRASPARC_FILTER_LIBRARY)
>         Change To:
>         DSO_LDOPTS = -shared -Wl,-soname -Wl,-L$(notdir $@) -f
>         /usr/local/lib/$(ULTRASPARC_FILTER_LIBRARY)
>
>         Where "ULTRASPARC_FILTER_LIBRARY" set to "libatomic.so" by
>         default. I added
>         "-L" before "$(notdir $@) " to avoid other errors. (Not sure
>         whether thats
>         correct or not.)
>
>         BUT atfer making all these changes i was able to build c-SDK
>         libraries.
>
>         NOW while testing LDAP connections i am able to test NON SSL
>         connections
>         successfully whereas while testing SSL connections, i get core
>         dump created.
>         There is no issue in codebase.
>
>         While debugging using GDB, i got the
>
>         CORE DUMP ERROR:
>         Program terminated with signal 11, Segmentation fault.
>         [New process 90516    ]
>         #0  0xff24278c in ?? () from ./libssldap60.so
>         (gdb)
>
>
>     Ok.  Did you compile with with -g and not -O2?  This stack trace
>     is not very helpful.
>
>     And it may be a lost cause.  Even though you have been successful
>     in compiling everything with gcc, there may still be runtime
>     problems such as this and others which can be avoided by using the
>     Sun Forte compilers.
>
>
>
>
>
>
>                 Build Instruction for Solaris also same with minor
>                 config changes
>                 required to consider libatomic.so file. If every
>                 dependency is in its
>                 place then build instructions as same.
>
>                 BUILD_ INSTRUCTIONS:
>                 ----------------------------
>                 cd mozilla/security/nss
>                 make nss_build_all
>
>                 This (make nss_build_all) will also build nspr and
>                 other dependent
>                 modules.
>
>                 cd mozilla/directory/c-sdk
>                 ./configure --with-nss [--enable-64bit]
>                 make
>
>
>                 Regards,
>                 Ashwani Saxena
>
>
>
>                 On Mon, Feb 22, 2010 at 9:17 PM, Rich Megginson
>                 <[email protected]
>                 <mailto:[email protected]>> wrote:
>
>                     ashwani saxena wrote:
>
>                         Hi Rich,
>
>                         This is with reference to :
>
>
>         http://www.mail-archive.com/[email protected]/msg00325.html
>
>                         I am trying building Mozilla LDAP c-sdk
>                         (6.0.3) on Solaris 9.
>
>                         I got the source code from following FTP
>                         locations.
>
>                         NSPR - 4.7.0.0 <http://4.7.0.0>:
>
>
>         ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7/src/nspr-4.7.tar.gz
>
>                         NSS – 3.12.0.0 <http://3.12.0.0>:
>
>
>         ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_12_RTM/src/nss
>
>                         -3.12.tar.gz
>
>                         C-SDK – 6.0.3:
>
>
>         ftp://ftp.mozilla.org/pub/mozilla.org/directory/c-sdk/releases/v6.0.3/src/mozlda
>
>                         p-6.0.3.tar.gz
>
>                         While building LDAP c-sdk, Initially I got the
>                         error (ld: fatal:
>                         Symbol referencing errors. No output written
>                         to libldif60.so) that I
>                         was able to resolve.
>
>                         Now I got the following error: (gcc:
>                         libatomic.so: No such file or
>                         directory)
>
>                         I goggled and found out the this library is
>                         part of NSPR but even
>                         though I was able to build NSPR, NSS
>                         successfully but I didn’t find
>                         this file.
>
>
>                         Please let me know how to resolve this issue.
>
>                     Please use the latest released versions of nspr,
>                     nss, and mozldap.
>
>                     You are using gcc?  What version of gcc?  What
>                     build instructions are
>
>         you
>
>                     following to build nspr and nss?  I don't know how
>                     to build on Solaris
>                     using
>                     gcc.  Ever since Sun released their compilers for
>                     free, I haven't even
>                     tried
>                     using gcc.
>
>
>                         Regards,
>                         Ashwani Saxena
>
>
>
>
>
>
>
>
>
>
>
>
>
> -- 
> Warm Regards,
> Ashwani Saxena
> +91 9886076920