Add --with-abi= support to x86_64-*-*
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 3 Apr 2012 02:56:34 +0000 (02:56 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 3 Apr 2012 02:56:34 +0000 (19:56 -0700)
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.

From-SVN: r186099

gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/biarchx32.h [new file with mode: 0644]

index 8a341dd..5c4e04e 100644 (file)
@@ -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.
index c30bb24..3eb2c70 100644 (file)
@@ -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 (file)
index 0000000..69d6722
--- /dev/null
@@ -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