aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-02-20 01:11:51 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2003-02-20 01:11:51 +0000
commit11856278b8c4f85d2d084d4b6f51f9ef906e8f51 (patch)
tree3b3aa12497747542aeb21e282afe7127b35304fa
parentc85dca2816cc564fcdaead75be5ea07b8b2b5493 (diff)
downloadgcc-11856278b8c4f85d2d084d4b6f51f9ef906e8f51.zip
gcc-11856278b8c4f85d2d084d4b6f51f9ef906e8f51.tar.gz
gcc-11856278b8c4f85d2d084d4b6f51f9ef906e8f51.tar.bz2
libtool.m4 (LD): Append -melf* option to LD on IRIX with GNU ld.
* libtool.m4 (LD): Append -melf* option to LD on IRIX with GNU ld. * ltconfig: Handle it. * ltcf-cxx.sh: Use with_gnu_ld passed as a shell variable instead of auto-detecting it. From-SVN: r63148
-rw-r--r--ChangeLog5
-rw-r--r--libtool.m414
-rw-r--r--ltcf-cxx.sh17
-rwxr-xr-xltconfig14
4 files changed, 40 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 7023f18..89c49c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2003-02-19 Alexandre Oliva <aoliva@redhat.com>
+ * libtool.m4 (LD): Append -melf* option to LD on IRIX with GNU ld.
+ * ltconfig: Handle it.
+ * ltcf-cxx.sh: Use with_gnu_ld passed as a shell variable instead of
+ auto-detecting it.
+
* ltcf-cxx.sh: Replace $linker_flags with $compiler_flags wherever
it is used as argument to $CC.
* ltcf-gcj.sh: Likewise.
diff --git a/libtool.m4 b/libtool.m4
index 99149ff..ff738c7 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -144,6 +144,19 @@ case $host in
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
@@ -155,6 +168,7 @@ case $host in
LD="${LD-ld} -64"
;;
esac
+ fi
fi
rm -rf conftest*
;;
diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh
index c239ee1..9059b1a0 100644
--- a/ltcf-cxx.sh
+++ b/ltcf-cxx.sh
@@ -68,11 +68,16 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev
# Set up default GNU C++ configuration
# Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
- egrep 'GNU ld' > /dev/null; then
- with_gnu_ld=yes
-
+ # archiving commands below assume that GNU ld is being used. The
+ # assumption here is that the linker is going to be the same as that
+ # used by the C compiler. For the purposes of GCC, this is ok, but
+ # if someone uses g++ along with a non-GNU C compiler that doesn't
+ # use GNU ld, we may lose. This is ok for the toolchain tree, since
+ # the only users of ltcf-cxx.sh are libstdc++-v3 and libjava,
+ # anyway, and those use both gcc and g++, so the settings are bound
+ # to be the same.
+
+ if test "$with_gnu_ld" = yes; then
archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
@@ -92,7 +97,6 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev
whole_archive_flag_spec=
fi
else
- with_gnu_ld=no
wlarc=
# A generic and very simple default shared library creation
@@ -110,7 +114,6 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev
else
with_gcc=no
- with_gnu_ld=no
wlarc=
fi
diff --git a/ltconfig b/ltconfig
index 68be49b..bfd7688 100755
--- a/ltconfig
+++ b/ltconfig
@@ -1186,6 +1186,11 @@ hpux9* | hpux10* | hpux11*)
;;
irix5* | irix6*)
+ if test "$with_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ if
version_type=irix
need_lib_prefix=no
need_version=no
@@ -1197,9 +1202,12 @@ irix5* | irix6*)
;;
*)
case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
esac
;;