diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-03 02:56:34 +0000 |
---|---|---|
committer | Andrew Pinski <apinski@cavium.com> | 2012-04-11 14:51:20 -0700 |
commit | f5833ca8455b7f570e89852aa2222c337dbe351c (patch) | |
tree | 6eba0691fe1592c8f55bbaa691796c23f285a21f | |
parent | 3b54efc4fc9d8e3205b7115fb7987353c5cacd36 (diff) | |
download | gcc-f5833ca8455b7f570e89852aa2222c337dbe351c.tar.gz |
Add --with-abi= support to x86_64-*-*
2012-04-02 H.J. Lu <hongjiu.lu@intel.com>
* config.gcc: Use i386/biarchx32.h instead of i386/biarch64.h
for --with-abi={x32|mx32} or --with-multilib-list=mx32.
(supported_defaults): Add abi for i[34567]86-*-* and x86_64-*-*.
* config/i386/biarchx32.h: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186099 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config.gcc | 25 | ||||
-rw-r--r-- | gcc/config/i386/biarchx32.h | 28 |
3 files changed, 59 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8a341dd06ed..5c4e04e87c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2012-04-02 H.J. Lu <hongjiu.lu@intel.com> + + * config.gcc: Use i386/biarchx32.h instead of i386/biarch64.h + for --with-abi={x32|mx32} or --with-multilib-list=mx32. + (supported_defaults): Add abi for i[34567]86-*-* and x86_64-*-*. + + * config/i386/biarchx32.h: New. + 2012-04-02 Anatoly Sokolov <aesok@post.ru> * config/arm/arm.h (PREFERRED_RELOAD_CLASS): Remove. diff --git a/gcc/config.gcc b/gcc/config.gcc index c30bb243fdd..3eb2c7002df 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -488,6 +488,10 @@ fi case ${target} in i[34567]86-*-*) + if test "x$with_abi" != x; then + echo "This target does not support --with-abi." + exit 1 + fi if test "x$enable_cld" = xyes; then tm_defines="${tm_defines} USE_IX86_CLD=1" fi @@ -497,7 +501,24 @@ i[34567]86-*-*) tm_file="vxworks-dummy.h ${tm_file}" ;; x86_64-*-*) - tm_file="i386/biarch64.h ${tm_file}" + case ${with_abi} in + "") + if test "x$with_multilib_list" = xmx32; then + tm_file="i386/biarchx32.h ${tm_file}" + else + tm_file="i386/biarch64.h ${tm_file}" + fi + ;; + 64 | m64) + tm_file="i386/biarch64.h ${tm_file}" + ;; + x32 | mx32) + tm_file="i386/biarchx32.h ${tm_file}" + ;; + *) + echo "Unknown ABI used in --with-abi=$with_abi" + exit 1 + esac if test "x$enable_cld" = xyes; then tm_defines="${tm_defines} USE_IX86_CLD=1" fi @@ -3138,7 +3159,7 @@ case "${target}" in ;; i[34567]86-*-* | x86_64-*-*) - supported_defaults="arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64" + supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64" for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do eval "val=\$with_$which" case ${val} in diff --git a/gcc/config/i386/biarchx32.h b/gcc/config/i386/biarchx32.h new file mode 100644 index 00000000000..69d672216ac --- /dev/null +++ b/gcc/config/i386/biarchx32.h @@ -0,0 +1,28 @@ +/* Make configure files to produce biarch compiler defaulting to x32 mode. + This file must be included very first, while the OS specific file later + to overwrite otherwise wrong defaults. + Copyright (C) 2012 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +<http://www.gnu.org/licenses/>. */ + +#define TARGET_64BIT_DEFAULT (OPTION_MASK_ISA_64BIT | OPTION_MASK_ABI_X32) +#define TARGET_BI_ARCH 2 |