summaryrefslogtreecommitdiff
path: root/libtool.m4
diff options
context:
space:
mode:
authoraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-20 15:18:53 +0000
committeraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-20 15:18:53 +0000
commit4b695c231a57896d5d4292f8fe2d71bd99bca5ed (patch)
treed61573405a2e44a99338ab463a2d060f3c70e9ee /libtool.m4
parent825da84bab258c28c4342c5d4cb0a1bb7522fbde (diff)
downloadgcc-4b695c231a57896d5d4292f8fe2d71bd99bca5ed.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59304 138bc75d-0d04-0410-961f-82ee72b054a4
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"