re PR libstdc++/25472 (--disable-hosted-libstdcxx does not work)
authorBenjamin Kosnik <bkoz@redhat.com>
Sun, 18 Dec 2005 08:08:07 +0000 (08:08 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Sun, 18 Dec 2005 08:08:07 +0000 (08:08 +0000)
2005-12-17  Benjamin Kosnik  <bkoz@redhat.com>

        * src/io-inst.cc: Separate instantiations into...
        * src/ios-inst.cc: .. this.
        * src/iostream-inst.cc: ... and this.
        * src/Makefile.am (sources): Update.
        * src/Makefile.in: Regenerate.

2005-12-17  Benjamin Kosnik  <bkoz@redhat.com>

PR libstdc++/25472
        * include/c_std/std_cstdlib.h: Fix for freestanding.

2005-12-17  Benjamin Kosnik  <bkoz@redhat.com>

* testsuite/libstdc++-dg/normal.exp: Rename to..
* testsuite/libstdc++-dg/conformance.exp: ... this.

From-SVN: r108743

libstdc++-v3/ChangeLog
libstdc++-v3/include/c_std/std_cstdlib.h
libstdc++-v3/src/Makefile.am
libstdc++-v3/src/Makefile.in
libstdc++-v3/src/io-inst.cc [deleted file]
libstdc++-v3/src/ios-inst.cc [new file with mode: 0644]
libstdc++-v3/src/iostream-inst.cc [new file with mode: 0644]
libstdc++-v3/testsuite/libstdc++-dg/conformance.exp [new file with mode: 0644]
libstdc++-v3/testsuite/libstdc++-dg/normal.exp [deleted file]

index 2599c135ec54046cd33c4fd45cb328dd5e19f2b8..638a77133a022f802a536dc0a21f5c13f03a9de6 100644 (file)
@@ -1,3 +1,21 @@
+2005-12-17  Benjamin Kosnik  <bkoz@redhat.com>
+
+        * src/io-inst.cc: Separate instantiations into...
+        * src/ios-inst.cc: .. this.
+        * src/iostream-inst.cc: ... and this.
+        * src/Makefile.am (sources): Update.
+        * src/Makefile.in: Regenerate. 
+
+2005-12-17  Benjamin Kosnik  <bkoz@redhat.com>
+       
+       PR libstdc++/25472
+        * include/c_std/std_cstdlib.h: Fix for freestanding.
+
+2005-12-17  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * testsuite/libstdc++-dg/normal.exp: Rename to..
+       * testsuite/libstdc++-dg/conformance.exp: ... this.
+
 2005-12-17  Paolo Carlini  <pcarlini@suse.de>
 
        * include/bits/stl_vector.h (vector(const vector&)): Use
index b5c47fa2d44c0026d9b24b9b886754e79204ae8a..2139092f57d6d600e661238d36645f2c2c81c90b 100644 (file)
 #include <bits/c++config.h>
 #include <cstddef>
 
-#if _GLIBCXX_HOSTED
-/* The C standard does not require a freestanding implementation to
-   provide <stdlib.h>.  However, the C++ standard does still require
-   <cstdlib> -- but only the functionality mentioned in
-   [lib.support.start.term].  */
+#if !_GLIBCXX_HOSTED
+// The C standard does not require a freestanding implementation to
+// provide <stdlib.h>.  However, the C++ standard does still require
+// <cstdlib> -- but only the functionality mentioned in
+// [lib.support.start.term].
+
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+
+namespace std
+{
+  extern "C" void abort(void);
+  extern "C" int atexit(void (*)());
+  extern "C" void exit(int);
+} // namespace std
+
+#else
+
 #include <stdlib.h>
-#endif
 
 // Get rid of those macros defined in <stdlib.h> in lieu of real functions.
 #undef abort
 
 namespace std
 {
-#if _GLIBCXX_HOSTED
   using ::div_t;
   using ::ldiv_t;
 
@@ -132,16 +143,7 @@ namespace std
 
   inline ldiv_t
   div(long __i, long __j) { return ldiv(__i, __j); }
-#else
-  /* Provide the minimal set of definitions required of a freestanding
-     implementation.  */
-  #define EXIT_SUCCESS 0
-  #define EXIT_FAILURE 1
-  extern "C" void abort(void);
-  extern "C" int atexit(void (*)());
-  extern "C" void exit(int);
-#endif
-}
+} // namespace std
 
 #if _GLIBCXX_USE_C99
 
@@ -198,21 +200,24 @@ namespace __gnu_cxx
 namespace std
 {
 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
-  using __gnu_cxx::lldiv_t;
+  using ::__gnu_cxx::lldiv_t;
 #endif
-  using __gnu_cxx::_Exit;
-  using __gnu_cxx::abs;
+  using ::__gnu_cxx::_Exit;
+  using ::__gnu_cxx::abs;
 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
-  using __gnu_cxx::llabs;
-  using __gnu_cxx::div;
-  using __gnu_cxx::lldiv;
+  using ::__gnu_cxx::llabs;
+  using ::__gnu_cxx::div;
+  using ::__gnu_cxx::lldiv;
 #endif
-  using __gnu_cxx::atoll;
-  using __gnu_cxx::strtof;
-  using __gnu_cxx::strtoll;
-  using __gnu_cxx::strtoull;
-  using __gnu_cxx::strtold;
+  using ::__gnu_cxx::atoll;
+  using ::__gnu_cxx::strtof;
+  using ::__gnu_cxx::strtoll;
+  using ::__gnu_cxx::strtoull;
+  using ::__gnu_cxx::strtold;
 }
-#endif
+
+#endif // _GLIBCXX_USE_C99
+
+#endif // !_GLIBCXX_HOSTED
 
 #endif
index 113f2dc0d3184c01f3c9472e4b181090c8cb33b8..b7cc1dd89ecde99d15017a26530c2f8774d97b5a 100644 (file)
@@ -144,7 +144,8 @@ sources = \
        concept-inst.cc \
        fstream-inst.cc \
        ext-inst.cc \
-       io-inst.cc \
+       ios-inst.cc \
+       iostream-inst.cc \
        istream-inst.cc \
        istream.cc \
        locale-inst.cc \
index f285e898e68872d7b2d96ca2734105718d5f63e2..c3a9d6efdf7bae52a1e3366541dc881949d68b11 100644 (file)
@@ -70,11 +70,11 @@ am__objects_3 = bitmap_allocator.lo pool_allocator.lo mt_allocator.lo \
        list.lo locale.lo locale_init.lo locale_facets.lo \
        localename.lo stdexcept.lo strstream.lo tree.lo \
        allocator-inst.lo concept-inst.lo fstream-inst.lo ext-inst.lo \
-       io-inst.lo istream-inst.lo istream.lo locale-inst.lo \
-       locale-misc-inst.lo misc-inst.lo ostream-inst.lo \
-       sstream-inst.lo streambuf-inst.lo streambuf.lo string-inst.lo \
-       valarray-inst.lo wlocale-inst.lo wstring-inst.lo \
-       $(am__objects_1) $(am__objects_2)
+       ios-inst.lo iostream-inst.lo istream-inst.lo istream.lo \
+       locale-inst.lo locale-misc-inst.lo misc-inst.lo \
+       ostream-inst.lo sstream-inst.lo streambuf-inst.lo streambuf.lo \
+       string-inst.lo valarray-inst.lo wlocale-inst.lo \
+       wstring-inst.lo $(am__objects_1) $(am__objects_2)
 am_libstdc___la_OBJECTS = $(am__objects_3)
 libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@@ -334,7 +334,8 @@ sources = \
        concept-inst.cc \
        fstream-inst.cc \
        ext-inst.cc \
-       io-inst.cc \
+       ios-inst.cc \
+       iostream-inst.cc \
        istream-inst.cc \
        istream.cc \
        locale-inst.cc \
diff --git a/libstdc++-v3/src/io-inst.cc b/libstdc++-v3/src/io-inst.cc
deleted file mode 100644 (file)
index c6f59d6..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-// Explicit instantiation file.
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
-// 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.
-
-//
-// ISO C++ 14882:
-//
-
-#include <ios>
-#include <iomanip>
-
-namespace std
-{
-  // basic_ios
-  template class basic_ios<char>;
-#ifdef _GLIBCXX_USE_WCHAR_T
-  template class basic_ios<wchar_t>;
-#endif
-
-  // iomanip
-  template class _Setfill<char>;
-  template _Setfill<char> setfill(char);
-#ifdef _GLIBCXX_USE_WCHAR_T
-  template class _Setfill<wchar_t>;
-  template _Setfill<wchar_t> setfill(wchar_t);
-#endif
-
-  // iostream
-  template class basic_iostream<char>;
-#ifdef _GLIBCXX_USE_WCHAR_T
-  template class basic_iostream<wchar_t>; 
-#endif
-} // namespace std
diff --git a/libstdc++-v3/src/ios-inst.cc b/libstdc++-v3/src/ios-inst.cc
new file mode 100644 (file)
index 0000000..83996f9
--- /dev/null
@@ -0,0 +1,44 @@
+// Explicit instantiation file.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 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.
+
+//
+// ISO C++ 14882:
+//
+
+#include <ios>
+
+namespace std
+{
+  template class basic_ios<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template class basic_ios<wchar_t>;
+#endif
+}
diff --git a/libstdc++-v3/src/iostream-inst.cc b/libstdc++-v3/src/iostream-inst.cc
new file mode 100644 (file)
index 0000000..9f389e6
--- /dev/null
@@ -0,0 +1,49 @@
+// Explicit instantiation file.
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 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.
+
+//
+// ISO C++ 14882:
+//
+
+#include <iostream>
+#include <iomanip>
+
+namespace std
+{
+  template class _Setfill<char>;
+  template _Setfill<char> setfill(char);
+  template class basic_iostream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  template class _Setfill<wchar_t>;
+  template _Setfill<wchar_t> setfill(wchar_t);
+  template class basic_iostream<wchar_t>; 
+#endif
+}
diff --git a/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp b/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp
new file mode 100644 (file)
index 0000000..21bc3c1
--- /dev/null
@@ -0,0 +1,99 @@
+# Functional and regression tests in C++ for libstdc++.
+
+# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+#
+# This program 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 of the License, or
+# (at your option) any later version.
+# 
+# This program 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 program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  
+
+# libstdc++-v3 testsuite that uses the 'dg.exp' driver.
+
+# Initialization.
+dg-init
+
+# Build the support objects.
+v3-build_support
+
+set tests [list]
+
+# If there is a "testsuite_files" file, use it.
+#
+# This is a workaround for problems reported with using:
+#
+#   runtest normal.exp="`cat testsuite_files`"
+#
+# See:
+#  http://gcc.gnu.org/ml/libstdc++/2005-03/msg00278.html
+# for discussion of the problem.
+#
+# If that worked consistently, we could modify "make check" to
+# pass that option, and then remove this code.
+if {[info exists blddir]} {
+    set tests_file "${blddir}/testsuite/testsuite_files"
+}
+if {[info exists tests_file] && [file exists $tests_file]} {
+    set f [open $tests_file]
+    while { ! [eof $f] } {
+       set t [gets $f]
+       if { [string length "$t"] != 0 } {
+           lappend tests ${srcdir}/${t}
+       }
+    } 
+    close $f
+} else {
+    # Find directories that might have tests.
+    set subdirs [glob "$srcdir/\[0-9\]\[0-9\]*"]
+    foreach d [glob "$srcdir/\[a-z\]*"] {
+       if {[file isdirectory $d]} { 
+           lappend subdirs $d
+       }
+    }
+    # Find all the tests.
+    foreach s $subdirs {
+       set subdir_tests [find $s *.cc]
+       set subdir_tests_c [find $s *.c]
+       foreach e $subdir_tests_c {
+           lappend subdir_tests $e
+       }
+
+       # Filter out tests that should not be run.
+       foreach t $subdir_tests {
+           # The DejaGNU "find" procedure sometimes returns a list 
+           # containing an empty string, when it should really return
+           # an empty list.
+           if { $t == "" } {
+               continue
+           }
+           # Filter out:
+           # 1. interactive tests.
+           # 2. performance tests.
+           # 3. wchar_t tests, if not supported.
+           # 4. thread tests, if not supported. 
+           if { [string first _xin $t] == -1
+                && [string first performance $t] == -1
+                && (${v3-wchar_t} || [string first wchar_t $t] == -1) 
+                && (${v3-threads} || [string first thread $t] == -1) } {
+               lappend tests $t
+           }
+       }
+    }
+}
+set tests [lsort $tests]
+
+# Main loop.
+global DEFAULT_CXXFLAGS
+global PCH_CXXFLAGS
+dg-runtest $tests "" "$DEFAULT_CXXFLAGS $PCH_CXXFLAGS"
+
+# All done.
+dg-finish
diff --git a/libstdc++-v3/testsuite/libstdc++-dg/normal.exp b/libstdc++-v3/testsuite/libstdc++-dg/normal.exp
deleted file mode 100644 (file)
index 21bc3c1..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-# Functional and regression tests in C++ for libstdc++.
-
-# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-#
-# This program 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 of the License, or
-# (at your option) any later version.
-# 
-# This program 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 program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  
-
-# libstdc++-v3 testsuite that uses the 'dg.exp' driver.
-
-# Initialization.
-dg-init
-
-# Build the support objects.
-v3-build_support
-
-set tests [list]
-
-# If there is a "testsuite_files" file, use it.
-#
-# This is a workaround for problems reported with using:
-#
-#   runtest normal.exp="`cat testsuite_files`"
-#
-# See:
-#  http://gcc.gnu.org/ml/libstdc++/2005-03/msg00278.html
-# for discussion of the problem.
-#
-# If that worked consistently, we could modify "make check" to
-# pass that option, and then remove this code.
-if {[info exists blddir]} {
-    set tests_file "${blddir}/testsuite/testsuite_files"
-}
-if {[info exists tests_file] && [file exists $tests_file]} {
-    set f [open $tests_file]
-    while { ! [eof $f] } {
-       set t [gets $f]
-       if { [string length "$t"] != 0 } {
-           lappend tests ${srcdir}/${t}
-       }
-    } 
-    close $f
-} else {
-    # Find directories that might have tests.
-    set subdirs [glob "$srcdir/\[0-9\]\[0-9\]*"]
-    foreach d [glob "$srcdir/\[a-z\]*"] {
-       if {[file isdirectory $d]} { 
-           lappend subdirs $d
-       }
-    }
-    # Find all the tests.
-    foreach s $subdirs {
-       set subdir_tests [find $s *.cc]
-       set subdir_tests_c [find $s *.c]
-       foreach e $subdir_tests_c {
-           lappend subdir_tests $e
-       }
-
-       # Filter out tests that should not be run.
-       foreach t $subdir_tests {
-           # The DejaGNU "find" procedure sometimes returns a list 
-           # containing an empty string, when it should really return
-           # an empty list.
-           if { $t == "" } {
-               continue
-           }
-           # Filter out:
-           # 1. interactive tests.
-           # 2. performance tests.
-           # 3. wchar_t tests, if not supported.
-           # 4. thread tests, if not supported. 
-           if { [string first _xin $t] == -1
-                && [string first performance $t] == -1
-                && (${v3-wchar_t} || [string first wchar_t $t] == -1) 
-                && (${v3-threads} || [string first thread $t] == -1) } {
-               lappend tests $t
-           }
-       }
-    }
-}
-set tests [lsort $tests]
-
-# Main loop.
-global DEFAULT_CXXFLAGS
-global PCH_CXXFLAGS
-dg-runtest $tests "" "$DEFAULT_CXXFLAGS $PCH_CXXFLAGS"
-
-# All done.
-dg-finish