We still did not have whole_archive_flag_spec right for Solaris.
The whole issue is pretty simple to really solve though: no `$wl'
for Solaris cc/CC/f77/f90/f95 compilers, always `-Wl,' for GCC.
To increase the chance of being correct this time, I have tested
these compilers:[1]. And I have reread most threads of the last 18
months that dealt with Solaris, to make sure there was no report
that disproved this solution.
OK to apply to both branches?
Apologies to Yuri for the huge delay, and thanks to him for both his
patience and insistence to fix this. :-)
Cheers,
Ralf
[1]
GCC-2.95
GCC-4.0.1
cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-14 2004/02/20
CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-22 2005/04/29
cc: Sun C 5.5 Patch 112760-18 2005/06/14
CC: Sun C++ 5.5 Patch 113817-15 2005/10/25
cc: Sun C 5.5 Patch 112760-18 2005/06/14
CC: Sun C++ 5.5 Patch 113817-15 2005/10/25
cc: Sun C 5.6 2004/07/15
CC: Sun C++ 5.6 2004/07/15
cc: Sun C 5.7 Patch 117836-05 2005/10/05
CC: Sun C++ 5.7 Patch 117830-05 2005/12/12
cc: Sun C 5.8 2005/10/13
CC: Sun C++ 5.8 2005/10/13
f77: Sun WorkShop 6 update 2 FORTRAN 77 5.3 Patch 111691-07 2004/04/23
f90: Sun WorkShop 6 update 2 Fortran 95 6.2 Patch 111690-10 2003/08/28
f90: Sun Fortran 95 7.1 Patch 112762-16 2005/10/25
f90: Sun Fortran 95 8.0 2004/07/15
f90: Sun Fortran 95 8.1 Patch 117834-03 2005/06/15
* libltdl/m4/libtool.m4 [ solaris ] (_LT_LINKER_SHLIBS)
(_LT_LANG_CXX_CONFIG) < whole_archive_flag_spec >:
Fix this once and for all, for both the SUN compiler suite
(cc/CC/f77/f90/f95) and GCC.
Reported by Yuri Pukhalsky <[EMAIL PROTECTED]>.
* libltdl/m4/libtool.m4 [ solaris ] (_LT_LINKER_SHLIBS)
(_LT_LANG_CXX_CONFIG) < whole_archive_flag_spec >:
Fix this once and for all, for both the SUN compiler suite
(cc/CC/f77/f90/f95) and GCC.
Reported by Yuri Pukhalsky <[EMAIL PROTECTED]>.
Index: libltdl/m4/libtool.m4
===
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.58
diff -u -r1.58 libtool.m4
--- libltdl/m4/libtool.m4 21 Jan 2006 16:44:41 - 1.58
+++ libltdl/m4/libtool.m4 3 Feb 2006 13:42:11 -
@@ -4714,17 +4714,16 @@
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convenience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z
defaultextract' ;;
- *)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for
conv in $convenience\"\"; do test -n \"$conv\" &&
new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"`
${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z
${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z
defaultextract'
+ fi
+ ;;
esac
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
@@ -5936,15 +5935,10 @@
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convenience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convenience library names through
- # without $wl.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z
${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" &&
new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"`
${wl}-z ${wl}defaultextract'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z
allextract$convenience -z defaultextract'
;;
esac
_LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -5991,6 +5985,12 @@
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+