From patchwork Wed May 23 22:36:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 161041 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 D2513B6FFC for ; Thu, 24 May 2012 08:37:27 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1338417448; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Received:Date:From:To: Subject:Message-ID:Mail-Followup-To:MIME-Version:Content-Type: Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=MDRh3dRFp0hZQ8A5T4oU3RjR12A=; b=EcQquzjVqFmmXUU B2kZnwSiDr2KgVKX0x3s9kD+ny39eElwBB3ZcQvbFfN/5R3D9VsLOFa2u+adA1MJ nhZyGKVvqGErCx0yYldtULuXrkLOzaD4S4WKPYySpLV/hbhqrahkQBdkOJ5hmdBF 0KhZq5y7/6f4sb8rjeJt59VPhnsc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-Content-Scanned:x-cbid:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=XEikP0j+XPXmFy/vCFDVZOEfjcYladABkbbhZqQrGI2RzxDY7UZspdcFQeStq+ ZDoYWaZjCk2VNOM1iXEJ4e+LGMRfr+rgq1ppxSk+PZNrRMUxrGavDLsjrPTSpGmi aq9wdqwk+8hsNffipu+CamCtcSHOLybEdmL75TOgNUT2Y=; Received: (qmail 20716 invoked by alias); 23 May 2012 22:37:19 -0000 Received: (qmail 20272 invoked by uid 22791); 23 May 2012 22:37:11 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, TW_JL X-Spam-Check-By: sourceware.org Received: from e33.co.us.ibm.com (HELO e33.co.us.ibm.com) (32.97.110.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 May 2012 22:36:50 +0000 Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 23 May 2012 16:36:48 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 23 May 2012 16:36:19 -0600 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 0C99019D8051 for ; Wed, 23 May 2012 16:36:06 -0600 (MDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4NMaIXx188072 for ; Wed, 23 May 2012 16:36:18 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4NMaIkS023140 for ; Wed, 23 May 2012 16:36:18 -0600 Received: from ibm-tiger.the-meissners.org ([9.33.37.223]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q4NMaHMn023095; Wed, 23 May 2012 16:36:18 -0600 Received: by ibm-tiger.the-meissners.org (Postfix, from userid 500) id 15B24413CB; Wed, 23 May 2012 18:36:15 -0400 (EDT) Date: Wed, 23 May 2012 18:36:15 -0400 From: Michael Meissner To: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, bergner@vnet.ibm.com Subject: [PATCH] Add powerpc64-linux configuration options Message-ID: <20120523223615.GA24175@ibm-tiger.the-meissners.org> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, bergner@vnet.ibm.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12052322-2398-0000-0000-000006E44ABB X-IsSubscribed: yes 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 powerpc64-linux systems that run on IBM servers, the 32-bit software emulation library is not built with the Red Hat and SUSE distributions, but the FSF sources still list it as a multilib. This patch adds a configuration option (--disable-ppc64-swfloat) to disable building this library. We've also seen some performance issues where building the multilibs with the -mstrict-align option causes slow downs. I vaguelly recall adding this option in the 1995 time frame, because the 603, 604 systems of the day did not handle unaligned accesses in little endian mode, and maybe some of the other embedded chips did not handle unaligned accesses at all. This patch also adds an option (--disable-ppc64-strict-align) to disable building the multilibs with -mstrict-align. I have bootstrapped the compiler with and without the changes, and there are no differences. Is it ok to apply? An alternative would be for the powerpc64-linux case, should we just delete the software floating emulation multilib and stop using the -mstrict-align, since Linux only runs in big endian mode. The software emulation multilib would be built for other powerpc varients and -mstrict-align would be used there as well. 2012-05-23 Michael Meissner * configure.ac (--disable-ppc64-swfloat): New configure switches for powerpc64-linux to disable building multlibs for 32-bit software floating point emulation, and to remove the -mstrict-align option from the multilib options. (--disable-ppc64-strict-align): Likewise. * config.gcc (powerpc64-linux): Likewise. * configure: Regenerate. * config/rs6000/t-linux64-noalign: New configuration files for enabling and disabling building the libraries with -mstrict-align. * config/rs6000/t-linux64-align: Likewise. * config/rs6000/t-linux64-noswflt: New configuration file to disable building the 32-bit software floating point emulation library. * config/rs6000/t-linux64 (MULTILIB_EXTRA_OPTS): Move to t-linux64-align and t-linux64-noalign. * doc/install.texi (--disable-ppc64-swfloat): Document. (--dsiable-ppc64-strict-align): Likewise. Index: gcc/doc/install.texi =================================================================== --- gcc/doc/install.texi (revision 187805) +++ gcc/doc/install.texi (working copy) @@ -1423,6 +1423,21 @@ defaulted to o32. Currently, this option only affects sparc-linux, powerpc-linux, x86-linux, mips-linux and s390-linux. +@item --disable-ppc64-swfloat +This option disables building the 32-bit software floating point +libraries for powerpc64-linux. + +@item --disable-ppc64-strict-align +This option disables building the libraries with the +@option{-mstrict-align} option on powerpc64-linux. +@ifnothtml +@xref{RS/6000 and PowerPC Options,, RS/6000 and PowerPC Options, gcc, +Using the GNU Compiler Collection (GCC)}, +@end ifnothtml +@ifhtml +See ``RS/6000 and PowerPC Options'' in the main manual +@end ifhtml + @item --enable-secureplt This option enables @option{-msecure-plt} by default for powerpc-linux. @ifnothtml Index: gcc/configure =================================================================== --- gcc/configure (revision 187805) +++ gcc/configure (working copy) @@ -893,6 +893,8 @@ with_multilib_list enable_rpath with_libiconv_prefix enable_sjlj_exceptions +enable_ppc64_swfloat +enable_ppc64_strict_align enable_secureplt enable_leading_mingw64_underscores enable_cld @@ -1592,6 +1594,11 @@ Optional Features: --disable-rpath do not hardcode runtime library paths --enable-sjlj-exceptions arrange to use setjmp/longjmp exception handling + --disable-ppc64-swfloat disable building 32-bit software floating point + libraries on 64-bit PowerPC Linux systems + --disable-ppc64-strict-align + disable building multilibs with -mstrict-align on + 64-bit PowerPC Linux systems --enable-secureplt enable -msecure-plt by default for PowerPC --enable-leading-mingw64-underscores enable leading underscores on 64 bit mingw targets @@ -11507,6 +11514,18 @@ case "$LIBINTL" in *$LIBICONV*) LIBICONV= ;; esac +# Check whether --enable-ppc64-swfloat was given. +if test "${enable_ppc64_swfloat+set}" = set; then : + enableval=$enable_ppc64_swfloat; +fi + + +# Check whether --enable-ppc64-strict-align was given. +if test "${enable_ppc64_strict_align+set}" = set; then : + enableval=$enable_ppc64_strict_align; +fi + + # Check whether --enable-secureplt was given. if test "${enable_secureplt+set}" = set; then : enableval=$enable_secureplt; @@ -17967,7 +17986,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17970 "configure" +#line 17989 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18073,7 +18092,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18076 "configure" +#line 18095 "configure" #include "confdefs.h" #if HAVE_DLFCN_H Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 187805) +++ gcc/configure.ac (working copy) @@ -1585,6 +1585,18 @@ case "$LIBINTL" in *$LIBICONV*) LIBICONV= ;; esac +AC_ARG_ENABLE(ppc64-swfloat, +[AS_HELP_STRING([--disable-ppc64-swfloat], + [disable building 32-bit software floating point libraries + on 64-bit PowerPC Linux systems])], +[], []) + +AC_ARG_ENABLE(ppc64-strict-align, +[AS_HELP_STRING([--disable-ppc64-strict-align], + [disable building multilibs with -mstrict-align on 64-bit + PowerPC Linux systems])], +[], []) + AC_ARG_ENABLE(secureplt, [AS_HELP_STRING([--enable-secureplt], [enable -msecure-plt by default for PowerPC])], Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 187805) +++ gcc/config.gcc (working copy) @@ -2002,7 +2002,16 @@ powerpc-*-linux* | powerpc64-*-linux*) tm_file="${tm_file} rs6000/default64.h" fi tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h glibc-stdint.h" - tmake_file="$tmake_file rs6000/t-linux64" + if test x${enable_ppc64_strict_align} = xno; then + tmake_file="$tmake_file rs6000/t-linux64-noalign" + else + tmake_file="$tmake_file rs6000/t-linux64-align" + fi + if test x${enable_ppc64_swfloat} = xno; then + tmake_file="$tmake_file rs6000/t-linux64-noswflt" + else + tmake_file="$tmake_file rs6000/t-linux64" + fi extra_options="${extra_options} rs6000/linux64.opt" ;; *) Index: gcc/config/rs6000/t-linux64-noalign =================================================================== --- gcc/config/rs6000/t-linux64-noalign (revision 0) +++ gcc/config/rs6000/t-linux64-noalign (revision 0) @@ -0,0 +1,22 @@ +#rs6000/t-l64-noalign + +# 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. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Disable building multilibs with -mstrict-align +MULTILIB_EXTRA_OPTS = fPIC Index: gcc/config/rs6000/t-linux64-noswflt =================================================================== --- gcc/config/rs6000/t-linux64-noswflt (revision 0) +++ gcc/config/rs6000/t-linux64-noswflt (revision 0) @@ -0,0 +1,36 @@ +#rs6000/t-linux64-noswflt + +# 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. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# On Debian, Ubuntu and other derivative distributions, the 32bit libraries +# are found in /lib32 and /usr/lib32, /lib64 and /usr/lib64 are symlinks to +# /lib and /usr/lib, while other distributions install libraries into /lib64 +# and /usr/lib64. The LSB does not enforce the use of /lib64 and /usr/lib64, +# it doesn't tell anything about the 32bit libraries on those systems. Set +# MULTILIB_OSDIRNAMES according to what is found on the target. + +# Clone of t-linux64 without the software floating point libraries +# MULTILIB_EXTRA_OPTS is set in t-linux64-noalign or t-linux64-align + +MULTILIB_OPTIONS = m64/m32 +MULTILIB_DIRNAMES = 64 32 +MULTILIB_EXCEPTIONS = +MULTILIB_EXCLUSIONS = +MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) +MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT) Index: gcc/config/rs6000/t-linux64-align =================================================================== --- gcc/config/rs6000/t-linux64-align (revision 0) +++ gcc/config/rs6000/t-linux64-align (revision 0) @@ -0,0 +1,22 @@ +#rs6000/t-l64-align + +# 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. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Enable building multilibs with -mstrict-align +MULTILIB_EXTRA_OPTS = fPIC mstrict-align Index: gcc/config/rs6000/t-linux64 =================================================================== --- gcc/config/rs6000/t-linux64 (revision 187805) +++ gcc/config/rs6000/t-linux64 (working copy) @@ -1,7 +1,7 @@ #rs6000/t-linux64 # Copyright (C) 2002, 2003, 2004, 2006, 2007, -# 2009, 2011 Free Software Foundation, Inc. +# 2009, 2011, 2012 Free Software Foundation, Inc. # # This file is part of GCC. # @@ -26,9 +26,10 @@ # it doesn't tell anything about the 32bit libraries on those systems. Set # MULTILIB_OSDIRNAMES according to what is found on the target. +# MULTILIB_EXTRA_OPTS is set in t-linux64-noalign or t-linux64-align + MULTILIB_OPTIONS = m64/m32 msoft-float MULTILIB_DIRNAMES = 64 32 nof -MULTILIB_EXTRA_OPTS = fPIC mstrict-align MULTILIB_EXCEPTIONS = m64/msoft-float MULTILIB_EXCLUSIONS = m64/!m32/msoft-float MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof