[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
--whole-archive with pgcc
From: |
Peter O'Gorman |
Subject: |
--whole-archive with pgcc |
Date: |
Thu, 24 Feb 2005 13:20:04 +0900 |
User-agent: |
Mozilla Thunderbird 1.0 (Macintosh/20041206) |
Hi,
Jeff tells me that this fixes the problem, okay to apply to branch-1-5 and
forward port later?
Thanks,
Peter
--
Peter O'Gorman - http://www.pogma.com
Index: ChangeLog
2005-02-24 Peter O'Gorman <address@hidden>
* libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): The Portland group's
compiler does not pass --whole-archive. Move gnu ld check for
the flag to the top so it can be overridden.
(AC_LIBTOOL_LANG_CXX_CONFIG): Unset whole_archive_flag_spec for
the portland group's c++ compiler too.
Reported by Jeff Squyres <address@hidden>
from Alexandre Duret-Lutz <address@hidden>,
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.67
diff -u -3 -p -u -r1.314.2.67 libtool.m4
--- libtool.m4 3 Feb 2005 15:01:20 -0000 1.314.2.67
+++ libtool.m4 24 Feb 2005 04:18:09 -0000
@@ -3178,6 +3178,7 @@ case $host_os in
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
;;
cxx)
# Compaq C++
@@ -5137,7 +5138,8 @@ ifelse([$1],[CXX],[
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
extract_expsyms_cmds=
-
+ # Just being paranoid about ensuring that cc_basename is set.
+ cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
case $host_os in
cygwin* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
@@ -5156,7 +5158,28 @@ ifelse([$1],[CXX],[
if test "$with_gnu_ld" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
-
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec,
$1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
# See if GNU ld supports shared libraries.
case $host_os in
aix3* | aix4* | aix5*)
@@ -5266,8 +5289,12 @@ EOF
linux*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
- case $CC,$host_cpu in
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ ;;
pgf77* | pgf90* ) # Portland Group f77 and f90
compilers
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
tmp_addflag=' -fpic' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
@@ -5277,14 +5304,7 @@ EOF
tmp_addflag=' -nofor_main' ;;
esac
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs
$deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
+
if test $supports_anon_versioning = yes; then
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" >
$output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
@@ -5308,16 +5328,11 @@ $echo "local: *; };" >> $output_objdir/$
;;
esac
- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec,
$1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
- --whole-archive with pgcc,
Peter O'Gorman <=