diff mbox

[x32] PATCH: Properly check __x86_64__ and __LP64__ in i386/morestack.S

Message ID AANLkTinVSP9Y1mB9e+fRov9uwChn49BgbEiWaqRC2Jmt@mail.gmail.com
State New
Headers show

Commit Message

H.J. Lu Feb. 14, 2011, 3:01 p.m. UTC
On Sun, Feb 13, 2011 at 3:17 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> I am checking this patch into x32 branch to compile i386/morestack.S
> for x32.
>
> H.J.
> ---
> From f0440a5aa8fcac7fb1e4630cbbbb743d56365bb5 Mon Sep 17 00:00:00 2001
> From: H.J. Lu <hjl.tools@gmail.com>
> Date: Sun, 13 Feb 2011 14:58:23 -0800
> Subject: [PATCH 2/3] Properly check __x86_64__ and __LP64__ in i386/morestack.S.
>
> ---
>  gcc/ChangeLog.x32              |    5 +++++
>  libgcc/config/i386/morestack.S |    8 ++++----
>  2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32
> index 7aeeba5..dda2a10 100644
> --- a/gcc/ChangeLog.x32
> +++ b/gcc/ChangeLog.x32
> @@ -1,5 +1,10 @@
>  2011-02-13  H.J. Lu  <hongjiu.lu@intel.com>
>
> +       * config/i386/morestack.S: Properly check __x86_64__ and
> +       __LP64__.
> +
> +2011-02-13  H.J. Lu  <hongjiu.lu@intel.com>
> +
>        * config.gcc: Support --enable-x32 for x86 Linux targets.
>
>        * configure.ac: Support --enable-x32.
> diff --git a/libgcc/config/i386/morestack.S b/libgcc/config/i386/morestack.S
> index 10fa1fd..44a11ae 100644
> --- a/libgcc/config/i386/morestack.S
> +++ b/libgcc/config/i386/morestack.S
> @@ -477,7 +477,7 @@ __morestack:
>        .section .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
>        .type   DW.ref.__gcc_personality_v0, @object
>  DW.ref.__gcc_personality_v0:
> -#ifndef __x86_64
> +#ifndef __LP64___
>        .align 4
>        .size   DW.ref.__gcc_personality_v0, 4
>        .long   __gcc_personality_v0
> @@ -488,7 +488,7 @@ DW.ref.__gcc_personality_v0:
>  #endif
>  #endif
>
> -#ifdef __x86_64__
> +#if defined __x86_64__ && defined __LP64__
>
>  # This entry point is used for the large model.  With this entry point
>  # the upper 32 bits of %r10 hold the argument size and the lower 32
> @@ -521,7 +521,7 @@ __morestack_large_model:
>        .size   __morestack_large_model, . - __morestack_large_model
>  #endif
>
> -#endif /* __x86_64__ */
> +#endif /* __x86_64__ && __LP64__ */
>
>  # Initialize the stack test value when the program starts or when a
>  # new thread starts.  We don't know how large the main stack is, so we
> @@ -576,7 +576,7 @@ __stack_split_initialize:
>
>        .section        .ctors.65535,"aw",@progbits
>
> -#ifndef __x86_64__
> +#ifndef __LP64___
>        .align  4
>        .long   __stack_split_initialize
>        .long   __morestack_load_mmap
> --
> 1.7.4
>
>


I checked in this to fix a typo.

H.J.
---
commit 23f41a82ff2c1d36d49b6d3c612e861a5af70dde
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Feb 14 06:57:20 2011 -0800

    Replace __LP64___ with __LP64__.

 	.long	__gcc_personality_v0
@@ -576,7 +576,7 @@ __stack_split_initialize:

 	.section	.ctors.65535,"aw",@progbits

-#ifndef __LP64___
+#ifndef __LP64__
 	.align	4
 	.long	__stack_split_initialize
 	.long	__morestack_load_mmap
diff mbox

Patch

diff --git a/libgcc/ChangeLog.x32 b/libgcc/ChangeLog.x32
index 27e9264..d980b39 100644
--- a/libgcc/ChangeLog.x32
+++ b/libgcc/ChangeLog.x32
@@ -1,3 +1,7 @@ 
+2011-02-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* config/i386/morestack.S: Replace __LP64___ with __LP64__.
+
 2011-02-13  H.J. Lu  <hongjiu.lu@intel.com>

 	* config/i386/morestack.S: Properly check __x86_64__ and
diff --git a/libgcc/config/i386/morestack.S b/libgcc/config/i386/morestack.S
index 44a11ae..4496e3d 100644
--- a/libgcc/config/i386/morestack.S
+++ b/libgcc/config/i386/morestack.S
@@ -477,7 +477,7 @@  __morestack:
 	.section .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_
personality_v0,comdat
 	.type	DW.ref.__gcc_personality_v0, @object
 DW.ref.__gcc_personality_v0:
-#ifndef __LP64___
+#ifndef __LP64__
 	.align 4
 	.size	DW.ref.__gcc_personality_v0, 4