This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFA] libstdc++/22203, aka PowerPC vs numeric_limits<integer>::traps
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 04 Nov 2005 20:54:02 +0100
- Subject: Re: [RFA] libstdc++/22203, aka PowerPC vs numeric_limits<integer>::traps
- References: <436A598F.2040007@suse.de>
Paolo Carlini wrote:
>That would require a bit of configury, likely a new empty
>config/cpu/generic/cpu_defines.h, included by c++config.h (and therefore
>by std_limits.h), and specialized in config/cpu/powerpc/, not a big
>deal, overall.
>
>
The below is what I tested on i686-pc-linux-gnu and
powerpc64-unknown-linux-gnu,
also checking of course that the special cpu_defines.h is selected on
powerpc.
Paolo.
///////////////////
2005-11-05 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/22203
* include/bits/c++config: Include cpu_defines.h.
* include/Makefile.am: Add cpu_defines.h to host_headers.
* configure.host: Add cpu_defines_dir.
* configure.ac: Use it.
* config/cpu/powerpc/cpu_defines.h: New.
* config/cpu/generic/cpu_defines.h: Likewise.
* configure: Regenerate.
* Makefile.in: Likewise.
* include/Makefile.in: Likewise.
* libmath/Makefile.in: Likewise.
* libsupc++/Makefile.in: Likewise.
* po/Makefile.in: Likewise.
* src/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise.
Index: include/bits/c++config
===================================================================
--- include/bits/c++config (revision 106499)
+++ include/bits/c++config (working copy)
@@ -34,6 +34,9 @@
// Pick up any OS-specific definitions.
#include <bits/os_defines.h>
+// Pick up any CPU-specific definitions.
+#include <bits/cpu_defines.h>
+
// Debug mode support. Debug mode basic_string is not allowed to be
// associated with std, because of locale and exception link
// dependence.
Index: include/Makefile.am
===================================================================
--- include/Makefile.am (revision 106499)
+++ include/Makefile.am (working copy)
@@ -618,7 +618,8 @@
${host_srcdir}/ctype_noninline.h \
${host_srcdir}/os_defines.h \
${glibcxx_srcdir}/$(ATOMIC_WORD_SRCDIR)/atomic_word.h \
- ${glibcxx_srcdir}/$(ABI_TWEAKS_SRCDIR)/cxxabi_tweaks.h
+ ${glibcxx_srcdir}/$(ABI_TWEAKS_SRCDIR)/cxxabi_tweaks.h \
+ ${glibcxx_srcdir}/$(CPU_DEFINES_SRCDIR)/cpu_defines.h
# Non-installed host_header files.
COMPATIBILITY_H = config/abi/compatibility.h
Index: configure.host
===================================================================
--- configure.host (revision 106499)
+++ configure.host (working copy)
@@ -39,6 +39,9 @@
# atomic_word_dir location of atomic_word.h
# defaults to generic.
#
+# cpu_defines_dir location of cpu_defines.h
+# defaults to generic.
+#
# It possibly modifies the following variables:
#
# OPT_LDFLAGS extra flags to pass when linking the library, of
@@ -64,6 +67,7 @@
c_model=c_std
c_compatibility=no
atomic_word_dir=cpu/generic
+cpu_defines_dir=cpu/generic
# HOST-SPECIFIC OVERRIDES
# Set any CPU-dependent bits.
@@ -123,6 +127,14 @@
;;
esac
+# Set specific CPU overrides for cpu_defines_dir. Most can just use generic.
+# THIS TABLE IS SORTED. KEEP IT THAT WAY.
+case "${host_cpu}" in
+ powerpc*)
+ cpu_defines_dir=cpu/powerpc
+ ;;
+esac
+
# Now look for the file(s) usually tied to a CPU model, and make
# default choices for those if they haven't been explicitly set
# already.
Index: configure.ac
===================================================================
--- configure.ac (revision 106499)
+++ configure.ac (working copy)
@@ -284,10 +284,12 @@
# Propagate the target-specific source directories through the build chain.
ATOMICITY_SRCDIR=config/${atomicity_dir}
ATOMIC_WORD_SRCDIR=config/${atomic_word_dir}
+CPU_DEFINES_SRCDIR=config/${cpu_defines_dir}
OS_INC_SRCDIR=config/${os_include_dir}
ABI_TWEAKS_SRCDIR=config/${abi_tweaks_dir}
AC_SUBST(ATOMICITY_SRCDIR)
AC_SUBST(ATOMIC_WORD_SRCDIR)
+AC_SUBST(CPU_DEFINES_SRCDIR)
AC_SUBST(ABI_TWEAKS_SRCDIR)
AC_SUBST(OS_INC_SRCDIR)
Index: config/cpu/powerpc/cpu_defines.h
===================================================================
--- config/cpu/powerpc/cpu_defines.h (revision 0)
+++ config/cpu/powerpc/cpu_defines.h (revision 0)
@@ -0,0 +1,36 @@
+// Specific definitions for generic platforms -*- C++ -*-
+
+// Copyright (C) 2005 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library 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 2, or (at your option)
+// any later version.
+
+// This library 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 this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_CPU_DEFINES
+#define _GLIBCXX_CPU_DEFINES 1
+
+// Integral divide instructions don't trap on PowerPC.
+#define __glibcxx_integral_traps false
+
+#endif
Index: config/cpu/generic/cpu_defines.h
===================================================================
--- config/cpu/generic/cpu_defines.h (revision 0)
+++ config/cpu/generic/cpu_defines.h (revision 0)
@@ -0,0 +1,33 @@
+// Specific definitions for generic platforms -*- C++ -*-
+
+// Copyright (C) 2005 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library 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 2, or (at your option)
+// any later version.
+
+// This library 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 this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_CPU_DEFINES
+#define _GLIBCXX_CPU_DEFINES 1
+
+#endif