diff mbox

PATCH: Backport x32 support to libtool

Message ID 20120303175416.GA4798@intel.com
State New
Headers show

Commit Message

H.J. Lu March 3, 2012, 5:54 p.m. UTC
Hi,

This patch backports x32 support to libtool:

http://git.savannah.gnu.org/cgit/libtool.git/commit/?id=88992fe6771ec3258bde1b03314ce579da0ac2d5

OK to install?

Thanks.


H.J.
---
ommit 0d8c092cac25c3bce5dbfc1981b84df91b3f6086
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Dec 12 13:03:14 2011 -0800

    Add x32 support to libtool.m4
    
    2011-12-12  H.J. Lu  <hongjiu.lu@intel.com>
    
    	* libtool.m4 (_LT_ENABLE_LOCK): Support x32.

Comments

H.J. Lu March 29, 2012, 2:34 p.m. UTC | #1
On Sat, Mar 3, 2012 at 9:54 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> This patch backports x32 support to libtool:
>
> http://git.savannah.gnu.org/cgit/libtool.git/commit/?id=88992fe6771ec3258bde1b03314ce579da0ac2d5
>
> OK to install?
>
> Thanks.
>
>
> H.J.
> ---
> ommit 0d8c092cac25c3bce5dbfc1981b84df91b3f6086
> Author: H.J. Lu <hjl.tools@gmail.com>
> Date:   Mon Dec 12 13:03:14 2011 -0800
>
>    Add x32 support to libtool.m4
>
>    2011-12-12  H.J. Lu  <hongjiu.lu@intel.com>
>
>        * libtool.m4 (_LT_ENABLE_LOCK): Support x32.
>
> diff --git a/ChangeLog.x32 b/ChangeLog.x32
> new file mode 100644
> index 0000000..b6e01ee
> --- /dev/null
> +++ b/ChangeLog.x32
> @@ -0,0 +1,3 @@
> +2011-12-12  H.J. Lu  <hongjiu.lu@intel.com>
> +
> +       * libtool.m4 (_LT_ENABLE_LOCK): Support x32.
> diff --git a/libtool.m4 b/libtool.m4
> index 67321a7..a7f99ac 100644
> --- a/libtool.m4
> +++ b/libtool.m4
> @@ -1232,7 +1232,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
>            LD="${LD-ld} -m elf_i386_fbsd"
>            ;;
>          x86_64-*linux*)
> -           LD="${LD-ld} -m elf_i386"
> +           case `/usr/bin/file conftest.o` in
> +             *x86-64*)
> +               LD="${LD-ld} -m elf32_x86_64"
> +               ;;
> +             *)
> +               LD="${LD-ld} -m elf_i386"
> +               ;;
> +           esac
>            ;;
>          ppc64-*linux*|powerpc64-*linux*)
>            LD="${LD-ld} -m elf32ppclinux"


Hi Ralf,

Can you review this patch?

Thanks.
diff mbox

Patch

diff --git a/ChangeLog.x32 b/ChangeLog.x32
new file mode 100644
index 0000000..b6e01ee
--- /dev/null
+++ b/ChangeLog.x32
@@ -0,0 +1,3 @@ 
+2011-12-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* libtool.m4 (_LT_ENABLE_LOCK): Support x32.
diff --git a/libtool.m4 b/libtool.m4
index 67321a7..a7f99ac 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -1232,7 +1232,14 @@  s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
 	    ;;
 	  ppc64-*linux*|powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"