Subject: pkg/24413: Fix for 2004Q4 devel/libtool-base to work with Solaris
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <tdamato@odu.edu>
List: netbsd-bugs
Date: 02/13/2004 14:44:09
>Number:         24413
>Category:       pkg
>Synopsis:       Fix for 2004Q4 devel/libtool-base to work with Solaris
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 13 14:45:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Tony D'Amato
>Release:        N/A
>Organization:
Old Dominion University
>Environment:
SunOS krypto 5.8 Generic_108528-23 sun4u sparc SUNW,Sun-Blade-100
>Description:
We're creating binaries to run on our Solaris 8 clients using NetBSD pkgsrc (specifically, the frozen 2003Q4 version). We're using the lang/gcc3 package to pick up the SPARC optimizations. On occasion, we're run into the issue when creating shared libraries using Sun's /usr/ccs/bin/ld which causes missing symbols (like __floatdidf for example). After some research, this is due to a dependency on libgcc.a, which had the missing symbols.

Since devel/libtool-base appears (to me) to be a fork of GNU libtool, I looked in the GNU libtool CVS for a fix, and I found the following patch added to devel/libtool/patches took care of the problem. Basically, what it does is use 'gcc -shared' instead of '$LD -G' to create shared libraries on Solaris. Share and enjoy!
>How-To-Repeat:

>Fix:

*** ltcf-c.sh.orig     2001/06/04 19:22:15     1.1.2.37
--- ltcf-c.sh     2001/06/04 19:32:48     1.1.2.38
***************
*** 513,523 ****
   
    solaris*)
      no_undefined_flag=' -z defs'
!     # $CC -shared without GNU ld will not create a library from C++
!     # object files and a static libstdc++, better avoid it by now
!     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
!     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
!               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs
$deplibs $linker_flags~$rm $lib.exp'
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_shlibpath_var=no
      case $host_os in
--- 513,527 ----
   
    solaris*)
      no_undefined_flag=' -z defs'
!     if test "$with_gcc" = yes; then
!       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
!       archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
!                   $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
!     else
!       archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
!       archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
!                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
!     fi
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_shlibpath_var=no
      case $host_os in

>Release-Note:
>Audit-Trail:
>Unformatted: