From: "H.J. Lu" <hjl.tools@gmail.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, Uros Bizjak <ubizjak@gmail.com>
Subject: Re: PATCH [1/n]: Add initial -x32 support
Date: Tue, 07 Jun 2011 22:02:00 -0000 [thread overview]
Message-ID: <BANLkTi=yezuaUyjGxO6JNGBFx=w8BXB0QQ@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1106071916510.3034@digraph.polyomino.org.uk>
On Tue, Jun 7, 2011 at 12:17 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Tue, 7 Jun 2011, H.J. Lu wrote:
>
>> That is -mx32 takes the same default as -m64. It is the correct
>> behavior for -mx32.
>
> I think it's only right in the case where -m64 is the default, and the
> specs for the case where -m32 is the default need changing to handle -mx32
> properly.
>
I checked this patch into x32 branch.
Thanks.
--
H.J.
---
commit bf324611c9c9dcd844ecc883486f580fda114ffc
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Jun 7 13:05:57 2011 -0700
Pass proper x32 options to as, ld and compilers.
diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32
index 5655c61..38d63d8 100644
--- a/gcc/ChangeLog.x32
+++ b/gcc/ChangeLog.x32
@@ -1,5 +1,16 @@
2011-06-07 H.J. Lu <hongjiu.lu@intel.com>
+ * config/i386/gnu-user64.h (SPEC_64): Support x32.
+ (SPEC_32): Likewise.
+ (SPEC_X32): New.
+ (ASM_SPEC): Use SPEC_X32.
+ (LINK_SPEC): Likewise.
+
+ * config/i386/i386.h (OPT_ARCH64): Support x32.
+ (OPT_ARCH32): Likewise.
+
+2011-06-07 H.J. Lu <hongjiu.lu@intel.com>
+
* doc/invoke.texi: Use @option{} on -mx32, -m64 and -mx32.
2011-06-07 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index b99fb13..bb4b8da 100644
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -58,15 +58,18 @@ see the files COPYING3 and COPYING.RUNTIME
respectively. If not, see
#if TARGET_64BIT_DEFAULT
#define SPEC_32 "m32"
-#define SPEC_64 "!m32"
+#define SPEC_64 "m32|mx32:;"
+#define SPEC_X32 "mx32"
#else
-#define SPEC_32 "!m64"
+#define SPEC_32 "m64|mx32:;"
#define SPEC_64 "m64"
+#define SPEC_X32 "mx32"
#endif
#undef ASM_SPEC
-#define ASM_SPEC "%{" SPEC_32 ":%{!mx32:--32}} %{" \
- SPEC_64 ":%{!mx32:--64}} %{mx32:--x32} \
+#define ASM_SPEC "%{" SPEC_32 ":--32} \
+ %{" SPEC_64 ":--64} \
+ %{" SPEC_X32 ":--x32} \
%{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
#undef LINK_SPEC
@@ -76,9 +79,9 @@ see the files COPYING3 and COPYING.RUNTIME
respectively. If not, see
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{" SPEC_32 ":%{!mx32:-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
- %{" SPEC_64 ":%{!mx32:-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}} \
- %{mx32:-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \
+ %{" SPEC_32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \
+ %{" SPEC_64 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \
+ %{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \
%{static:-static}}"
/* Similar to standard GNU userspace, but adding -ffast-math support. */
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index f9270de..ec86e74 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -519,8 +519,8 @@ extern const char *host_detect_local_cpu (int
argc, const char **argv);
#define OPT_ARCH64 "!m32"
#define OPT_ARCH32 "m32"
#else
-#define OPT_ARCH64 "m64"
-#define OPT_ARCH32 "!m64"
+#define OPT_ARCH64 "m64|mx32"
+#define OPT_ARCH32 "m64|mx32:;"
#endif
/* Support for configure-time defaults of some command line options.
next prev parent reply other threads:[~2011-06-07 21:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-05 19:55 H.J. Lu
2011-06-06 15:47 ` Uros Bizjak
2011-06-07 15:47 ` Joseph S. Myers
2011-06-07 18:54 ` H.J. Lu
2011-06-07 19:19 ` Joseph S. Myers
2011-06-07 15:59 ` Joseph S. Myers
2011-06-07 19:11 ` H.J. Lu
2011-06-07 19:20 ` Joseph S. Myers
2011-06-07 22:02 ` H.J. Lu [this message]
2011-06-14 17:52 ` H.J. Lu
2011-07-05 14:42 ` PATCH [1/n] X32: " H.J. Lu
2011-07-05 15:21 ` Uros Bizjak
2011-07-05 17:59 ` H.J. Lu
2011-07-05 18:18 ` Uros Bizjak
2011-07-05 19:09 ` H.J. Lu
2011-07-05 19:09 ` Joseph S. Myers
2011-07-05 20:07 ` Uros Bizjak
2011-07-06 14:50 ` H.J. Lu
2011-07-06 15:03 ` Richard Guenther
2011-07-06 16:40 ` H.J. Lu
2011-07-07 13:03 ` H.J. Lu
2011-07-07 13:08 ` Uros Bizjak
2011-07-07 13:27 ` Paolo Bonzini
2011-07-07 15:10 ` H.J. Lu
2011-07-07 15:14 ` Uros Bizjak
2011-07-07 15:38 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTi=yezuaUyjGxO6JNGBFx=w8BXB0QQ@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=ubizjak@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).