libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

solaris archive_cmds change for sun CC c++ compiler


From: Peter O'Gorman
Subject: solaris archive_cmds change for sun CC c++ compiler
Date: Tue, 19 Jul 2005 13:32:07 +0900
User-agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)

Hi,
On all versions of sun's compiler that I looked at, using c++ features (e.g. cout!) requires adding -lCstd -lCrun and -lc to the link line. This means that any library linking with -no-undefined fails to link properly with this compiler. I have added these libraries to the archive_cmds. While I was looking there, I saw an output_verbose_link_cmd that removes all the objects from the list, thus making it useless, so I removed the -nolib and set the output_verbose_link_cmd to 'echo'.

Okay for all branches? (having been suitably changed for 2.0/HEAD, of course).

Peter
Index: ChangeLog
2005-07-18  Peter O'Gorman  <address@hidden>

        * libtool.m4 (CXX, archive_cmds) [sun]: Add -lCstd, -lCrun
        and -lc to archive_cmds for c++ builds.
        Reported by Albert Chin-A-Young <address@hidden>

from  Peter Breitenlohner  <address@hidden>
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.96
diff -u -3 -p -u -r1.314.2.96 libtool.m4
--- libtool.m4 8 Jul 2005 15:03:15 -0000 1.314.2.96
+++ libtool.m4 19 Jul 2005 00:45:35 -0000
@@ -3476,9 +3476,9 @@ case $host_os in
       CC*)
        # Sun C++ 4.2, 5.x and Centerline C++
        _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib 
-h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects 
$compiler_flags'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} 
-h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects -lCstd 
-lCrun -lc $compiler_flags'
        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > 
$lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo 
"local: *; };" >> $lib.exp~
-       $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o 
$lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm 
$lib.exp'
+       $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib 
$predep_objects $libobjs $deplibs $postdep_objects -lCstd -lCrun -lc 
$compiler_flags~$rm $lib.exp'
 
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -3498,15 +3498,7 @@ case $host_os in
        esac
        _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
-       # Commands to make compiler produce verbose output that lists
-       # what "hidden" libraries, object files and flags are used when
-       # linking a shared library.
-       #
-       # There doesn't appear to be a way to prevent this compiler from
-       # explicitly linking system object files so we need to strip them
-       # from the output so that they don't get included in the library
-       # dependencies.
-       output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 
2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in 
conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; 
done; echo $list'
+       output_verbose_link_cmd='echo'
 
        # Archives containing C++ object files must be created using
        # "CC -xar", where "CC" is the Sun C++ compiler.  This is

reply via email to

[Prev in Thread] Current Thread [Next in Thread]