From 914fef269a188d9d91c8a3a6c83c5965198b7c1e Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 20 Feb 2003 02:09:58 +0000 Subject: [PATCH] * 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. --- ChangeLog | 7 +++++++ libtool.m4 | 14 ++++++++++++++ ltcf-cxx.sh | 17 ++++++++++------- ltconfig | 2 +- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index e9f87acd17..29ced0e928 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2003-02-19 Alexandre Oliva + * 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. + +2003-02-19 Alexandre Oliva + * 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 3f452bcba2..eca1da32ec 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 c239ee1649..9059b1a002 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 5be608915e..7a4d63579f 100755 --- a/ltconfig +++ b/ltconfig @@ -1190,7 +1190,7 @@ irix5* | irix6*) version_type=linux else version_type=irix - if + fi version_type=irix need_lib_prefix=no need_version=no -- 2.11.0