Re: Patch for mips64 libtool.m4

2013-08-23 Thread Steve Ellcey
On Fri, 2013-08-23 at 11:56 -0700, Brooks Moses wrote:
> On 08/19/2013 02:35 PM, Steve Ellcey wrote:
> > A user was trying to build the buildroot product for mips64 with the 
> > -mabi=64
> > option and ran into a libtool problem when building libiscsi because it 
> > calls
> > the linker via libtool and the linker was defaulting to the n32 ABI instead 
> > of
> > the 64 bit ABI.  This patch to libtool.m4 checks for the correct ABI to use
> > like IA64, AIX, and other platforms already do and passes the correct 
> > emulation
> > mode into the linker.
> [...]
> > +mips64*-*linux*)
> [...]
> > +LD="${LD} -m ${emul}"
> 
> A minor review comment: That should probably be ${LD-ld} to provide a 
> default linker name if $LD is not specified, to be consistent all the 
> other cases in this section.
> 
> - Brooks

Yes, you are right and Gary made that change for me before he checked it
in.

Steve Ellcey
sell...@mips.com





Re: Patch for mips64 libtool.m4

2013-08-23 Thread Steve Ellcey
On Fri, 2013-08-23 at 15:50 +0700, Gary V. Vaughan wrote:

> Thanks for the patch.  Applied.
> 
> I took the liberty of writing a ChangeLog entry for you, correcting some
> syntax standards violations flagged by 'make syntax-check', and then massaging
> a little to match the surrounding code better.  Please pull the latest 
> revision
> and check that I didn't break your patch in the process.
> 
> Cheers,

Thanks for fixing it up for me.  It looks good to me and works fine.

Steve Ellcey





Re: Patch for mips64 libtool.m4

2013-08-23 Thread Gary V. Vaughan
Hi Steve,

On Aug 20, 2013, at 4:35 AM, Steve Ellcey  wrote:

> A user was trying to build the buildroot product for mips64 with the -mabi=64
> option and ran into a libtool problem when building libiscsi because it calls
> the linker via libtool and the linker was defaulting to the n32 ABI instead of
> the 64 bit ABI.  This patch to libtool.m4 checks for the correct ABI to use
> like IA64, AIX, and other platforms already do and passes the correct 
> emulation
> mode into the linker.
> 
> I am hoping someone can review this patch and check it in to libtool, though
> the list appears very quiet lately.

Thanks for the patch.  Applied.

I took the liberty of writing a ChangeLog entry for you, correcting some
syntax standards violations flagged by 'make syntax-check', and then massaging
a little to match the surrounding code better.  Please pull the latest revision
and check that I didn't break your patch in the process.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


signature.asc
Description: Message signed with OpenPGP using GPGMail


Patch for mips64 libtool.m4

2013-08-19 Thread Steve Ellcey
A user was trying to build the buildroot product for mips64 with the -mabi=64
option and ran into a libtool problem when building libiscsi because it calls
the linker via libtool and the linker was defaulting to the n32 ABI instead of
the 64 bit ABI.  This patch to libtool.m4 checks for the correct ABI to use
like IA64, AIX, and other platforms already do and passes the correct emulation
mode into the linker.

I am hoping someone can review this patch and check it in to libtool, though
the list appears very quiet lately.

Steve Ellcey
sell...@mips.com


diff --git a/m4/libtool.m4 b/m4/libtool.m4
index d7013c5..c9465ee 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1307,6 +1307,36 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
+mips64*-*linux*)
+  # Find out which ABI we are using.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+emul="elf"
+case `/usr/bin/file conftest.o` in
+  *32-bit*)
+   emul="${emul}32"
+   ;;
+  *64-bit*)
+   emul="${emul}64"
+   ;;
+esac
+case `/usr/bin/file conftest.o` in
+  *MSB*)
+   emul="${emul}btsmip"
+   ;;
+  *LSB*)
+   emul="${emul}ltsmip"
+   ;;
+esac
+case `/usr/bin/file conftest.o` in
+  *N32*)
+   emul="${emul}n32"
+   ;;
+esac
+LD="${LD} -m ${emul}"
+  fi
+  ;;
+
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.