Subject: pkg/24413: Fix for 2004Q4 devel/libtool-base to work with Solaris
To: None <>
From: None <>
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
>Originator:     Tony D'Amato
>Release:        N/A
Old Dominion University
SunOS krypto 5.8 Generic_108528-23 sun4u sparc SUNW,Sun-Blade-100
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!


***     2001/06/04 19:22:15
---     2001/06/04 19:32:48
*** 513,523 ****
      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'
      case $host_os in
--- 513,527 ----
      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
      case $host_os in