summaryrefslogtreecommitdiff
path: root/libtool.m4
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@gcc.gnu.org>2002-11-20 16:18:53 +0100
committerAndreas Jaeger <aj@gcc.gnu.org>2002-11-20 16:18:53 +0100
commit3b75d2378c76887747a4c2cbdc0ddf793db56468 (patch)
treed61573405a2e44a99338ab463a2d060f3c70e9ee /libtool.m4
parent6d1d1db0447e3ef7ca9019487668923b7cffe865 (diff)
downloadgcc-3b75d2378c76887747a4c2cbdc0ddf793db56468.tar.gz
libtool.m4 (libtool_flags): Add patch from libtool CVS...
* libtool.m4 (libtool_flags): Add patch from libtool CVS: Support linking of 32-bit libraries with ld on the x86-64, ppc64, s390x and sparc64 GNU/Linux systems. From-SVN: r59304
Diffstat (limited to 'libtool.m4')
-rw-r--r--libtool.m442
1 files changed, 42 insertions, 0 deletions
diff --git a/libtool.m4 b/libtool.m4
index 3f452bcba28..99149ffe140 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -175,6 +175,48 @@ ia64-*-hpux*)
rm -rf conftest*
;;
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"