]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: set correct linker ABI flags on mips64 linux.
authorSteve Ellcey <sellcey@mips.com>
Mon, 19 Aug 2013 21:35:28 +0000 (14:35 -0700)
committerGary V. Vaughan <gary@gnu.org>
Fri, 23 Aug 2013 08:43:25 +0000 (15:43 +0700)
m4/libtool.m4 (_LT_ENABLE_LOCK): Select the n32 or n64 ABI when
linking to match the ABI produced with the user's compiler flags.

Co-authored-by: Gary V. Vaughan <gary@gnu.org>
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
m4/libtool.m4

index 8f97c5c9ca25cb22d5e641f6df7d1b0c093b7681..4418a1c3ab9f7211e66b84f960dfcab55655e693 100644 (file)
@@ -1309,6 +1309,38 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+       emul="${emul}32"
+       ;;
+      *64-bit*)
+       emul="${emul}64"
+       ;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+       emul="${emul}btsmip"
+       ;;
+      *LSB*)
+       emul="${emul}ltsmip"
+       ;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+       emul="${emul}n32"
+       ;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out what ABI is being produced by ac_compile, and set linker