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  <meiss...@linux.vnet.ibm.com>

        * 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.

-- 
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meiss...@linux.vnet.ibm.com     fax +1 (978) 399-6899
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
+# <http://www.gnu.org/licenses/>.
+
+# 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
+# <http://www.gnu.org/licenses/>.
+
+# 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
+# <http://www.gnu.org/licenses/>.
+
+# 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

Reply via email to