This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]