From patchwork Mon Feb 21 21:06:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 83877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 53B39B7175 for ; Tue, 22 Feb 2011 08:06:53 +1100 (EST) Received: (qmail 10688 invoked by alias); 21 Feb 2011 21:06:50 -0000 Received: (qmail 10674 invoked by uid 22791); 21 Feb 2011 21:06:48 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, TW_CX, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Feb 2011 21:06:42 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 21 Feb 2011 13:06:40 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by azsmga001.ch.intel.com with ESMTP; 21 Feb 2011 13:06:40 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id DC6F61802A7; Mon, 21 Feb 2011 13:06:39 -0800 (PST) Date: Mon, 21 Feb 2011 13:06:39 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [x32] PATCH: Add --enable-ia32 Message-ID: <20110221210639.GA2772@intel.com> Reply-To: "H.J. Lu" References: <20110213231346.GA23368@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110213231346.GA23368@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Sun, Feb 13, 2011 at 03:13:46PM -0800, H.J. Lu wrote: > Hi, > > I checked this patch into x32 branch so that we can build x32 libraries. > I checked this patch into x32 branch so that we can disable ia32 libraries. H.J. --- From 53cdb22776f119902289cd25bda774b18eb30185 Mon Sep 17 00:00:00 2001 From: H.J. Lu Date: Mon, 21 Feb 2011 13:03:39 -0800 Subject: [PATCH] Add --enable-ia32. --- gcc/ChangeLog.x32 | 9 +++++++++ gcc/config.gcc | 24 ++++++++++++++++++------ gcc/config/i386/t-linux64-x32 | 34 ++++++++++++++++++++++++++++++++++ gcc/configure | 15 +++++++++++++-- gcc/configure.ac | 5 +++++ 5 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 gcc/config/i386/t-linux64-x32 diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32 index 364851c..b1e6753 100644 --- a/gcc/ChangeLog.x32 +++ b/gcc/ChangeLog.x32 @@ -1,3 +1,12 @@ +2011-02-21 H.J. Lu + + * config.gcc: Support --enable-ia32 for x86 Linux targets. + + * configure.ac: Support --enable-ia32. + * configure: Regenerated. + + * config/i386/t-linux64-x32: New. + 2011-02-20 H.J. Lu * longlong.h (count_leading_zeros): Use long long builtin for diff --git a/gcc/config.gcc b/gcc/config.gcc index 6496914..ab5a7ed 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1257,11 +1257,17 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i if test x$enable_targets = xall; then tm_file="${tm_file} i386/x86-64.h i386/linux64.h" tm_defines="${tm_defines} TARGET_BI_ARCH=1" - if test x$enable_x32 = xyes; then + case x${enable_x32}${enable_ia32} in + xyesyes) tmake_file="${tmake_file} i386/t-linuxx32" - else + ;; + xyesno) + tmake_file="${tmake_file} i386/t-linux64-x32" + ;; + *) tmake_file="${tmake_file} i386/t-linux64" - fi + ;; + esac need_64bit_hwint=yes need_64bit_isa=yes case X"${with_cpu}" in @@ -1298,11 +1304,17 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu) x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h" ;; x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;; esac - if test x$enable_x32 = xyes; then + case x${enable_x32}${enable_ia32} in + xyesyes) tmake_file="${tmake_file} i386/t-linuxx32" - else + ;; + xyesno) + tmake_file="${tmake_file} i386/t-linux64-x32" + ;; + *) tmake_file="${tmake_file} i386/t-linux64" - fi + ;; + esac tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules" ;; i[34567]86-pc-msdosdjgpp*) diff --git a/gcc/config/i386/t-linux64-x32 b/gcc/config/i386/t-linux64-x32 new file mode 100644 index 0000000..3a4d1de --- /dev/null +++ b/gcc/config/i386/t-linux64-x32 @@ -0,0 +1,34 @@ +# Copyright (C) 2011 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. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# To support x86-64 and x32 libraries, the directory structrue +# should be: +# +# /lib64 has x86-64 libraries. +# /libx32 has x32 libraries. +# +MULTILIB_OPTIONS = m64/mx32 +MULTILIB_DIRNAMES = 64 x32 +MULTILIB_OSDIRNAMES = ../lib64 ../libx32 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + +EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o \ + crtbeginT.o crtprec32.o crtprec64.o crtprec80.o \ + crtfastmath.o diff --git a/gcc/configure b/gcc/configure index d678648..0f2cb9f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -872,6 +872,7 @@ enable_build_with_cxx with_stabs enable_multilib enable_x32 +enable_ia32 enable___cxa_atexit enable_decimal_float enable_fixed_point @@ -1574,6 +1575,7 @@ Optional Features: --enable-build-with-cxx build with C++ compiler instead of C compiler --enable-multilib enable library support for multiple ABIs --enable-x32 enable x32 library support for multiple ABIs + --enable-ia32 enable ia32 library support for multiple ABIs --enable-__cxa_atexit enable __cxa_atexit for C++ --enable-decimal-float={no,yes,bid,dpd} enable decimal float extension to C. Selecting 'bid' @@ -6885,6 +6887,15 @@ else fi +# With ia32 support +# Check whether --enable-ia32 was given. +if test "${enable_ia32+set}" = set; then : + enableval=$enable_ia32; +else + enable_ia32=yes +fi + + # Enable __cxa_atexit for C++. # Check whether --enable-__cxa_atexit was given. if test "${enable___cxa_atexit+set}" = set; then : @@ -17516,7 +17527,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17519 "configure" +#line 17530 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17622,7 +17633,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17625 "configure" +#line 17636 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 74fe079..50d6a30 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -611,6 +611,11 @@ AC_ARG_ENABLE(x32, [ --enable-x32 enable x32 library support for multiple ABIs], [], [enable_x32=no]) +# With ia32 support +AC_ARG_ENABLE(ia32, +[ --enable-ia32 enable ia32 library support for multiple ABIs], +[], [enable_ia32=yes]) + # Enable __cxa_atexit for C++. AC_ARG_ENABLE(__cxa_atexit, [ --enable-__cxa_atexit enable __cxa_atexit for C++],