From patchwork Sun Feb 13 23:13:46 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: 83020 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 19248B7126 for ; Mon, 14 Feb 2011 10:13:56 +1100 (EST) Received: (qmail 16750 invoked by alias); 13 Feb 2011 23:13:54 -0000 Received: (qmail 16741 invoked by uid 22791); 13 Feb 2011 23:13:52 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_HI, TW_CX, TW_UX, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 13 Feb 2011 23:13:48 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 13 Feb 2011 15:13:46 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by fmsmga002.fm.intel.com with ESMTP; 13 Feb 2011 15:13:47 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id C10DC180902; Sun, 13 Feb 2011 15:13:46 -0800 (PST) Date: Sun, 13 Feb 2011 15:13:46 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [x32] PATCH: Add --enable-x32 Message-ID: <20110213231346.GA23368@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline 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 Hi, I checked this patch into x32 branch so that we can build x32 libraries. H.J. ---- From d67b431e781beec86e2ea153ffd9c57de61be9ae Mon Sep 17 00:00:00 2001 From: H.J. Lu Date: Sun, 13 Feb 2011 08:24:30 -0800 Subject: [PATCH 1/3] Add --enable-x32. --- gcc/ChangeLog.x32 | 9 +++++++++ gcc/config.gcc | 13 +++++++++++-- gcc/config/i386/t-linuxx32 | 17 +++++++++++++++++ gcc/configure | 15 +++++++++++++-- gcc/configure.ac | 5 +++++ 5 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 gcc/config/i386/t-linuxx32 diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32 index 4160ca9..7aeeba5 100644 --- a/gcc/ChangeLog.x32 +++ b/gcc/ChangeLog.x32 @@ -1,3 +1,12 @@ +2011-02-13 H.J. Lu + + * config.gcc: Support --enable-x32 for x86 Linux targets. + + * configure.ac: Support --enable-x32. + * configure: Regenerated. + + * config/i386/t-linuxx32: New. + 2011-02-12 H.J. Lu PR target/47715 diff --git a/gcc/config.gcc b/gcc/config.gcc index 54b822e..44c33df 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1256,7 +1256,11 @@ 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" - tmake_file="${tmake_file} i386/t-linux64" + if test x$enable_x32 = xyes; then + tmake_file="${tmake_file} i386/t-linuxx32" + else + tmake_file="${tmake_file} i386/t-linux64" + fi need_64bit_hwint=yes need_64bit_isa=yes case X"${with_cpu}" in @@ -1293,7 +1297,12 @@ 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 - tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules" + if test x$enable_x32 = xyes; then + tmake_file="${tmake_file} i386/t-linuxx32" + else + tmake_file="${tmake_file} i386/t-linux64" + fi + tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules" ;; i[34567]86-pc-msdosdjgpp*) xm_file=i386/xm-djgpp.h diff --git a/gcc/config/i386/t-linuxx32 b/gcc/config/i386/t-linuxx32 new file mode 100644 index 0000000..a4741e1 --- /dev/null +++ b/gcc/config/i386/t-linuxx32 @@ -0,0 +1,17 @@ +# To support i386, x86-64 and x32 libraries, the directory structrue +# should be: +# +# /lib has i386 libraries. +# /lib64 has x86-64 libraries. +# /lib32 has x32 libraries. + +MULTILIB_OPTIONS = m64/m32/mx32 +MULTILIB_DIRNAMES = 64 32 x32 +MULTILIB_OSDIRNAMES = ../lib64 ../lib ../lib32 + +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 91fad33..d678648 100755 --- a/gcc/configure +++ b/gcc/configure @@ -871,6 +871,7 @@ enable_gather_detailed_mem_stats enable_build_with_cxx with_stabs enable_multilib +enable_x32 enable___cxa_atexit enable_decimal_float enable_fixed_point @@ -1572,6 +1573,7 @@ Optional Features: --enable-gather-detailed-mem-stats enable detailed memory allocation stats gathering --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-__cxa_atexit enable __cxa_atexit for C++ --enable-decimal-float={no,yes,bid,dpd} enable decimal float extension to C. Selecting 'bid' @@ -6874,6 +6876,15 @@ fi +# With x32 support +# Check whether --enable-x32 was given. +if test "${enable_x32+set}" = set; then : + enableval=$enable_x32; +else + enable_x32=no +fi + + # Enable __cxa_atexit for C++. # Check whether --enable-__cxa_atexit was given. if test "${enable___cxa_atexit+set}" = set; then : @@ -17505,7 +17516,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17508 "configure" +#line 17519 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17611,7 +17622,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17614 "configure" +#line 17625 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 0c065e0..74fe079 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -606,6 +606,11 @@ AC_ARG_ENABLE(multilib, [], [enable_multilib=yes]) AC_SUBST(enable_multilib) +# With x32 support +AC_ARG_ENABLE(x32, +[ --enable-x32 enable x32 library support for multiple ABIs], +[], [enable_x32=no]) + # Enable __cxa_atexit for C++. AC_ARG_ENABLE(__cxa_atexit, [ --enable-__cxa_atexit enable __cxa_atexit for C++],