diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c6ee01407ee..787792ad612 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,20 @@ +2002-09-09 Benjamin Kosnik + + * docs/html/configopts.html: Change grouping. Note ABI impacts. + Update information for locale model defaults. + * docs/html/install.html: Update include directory + information. + Update testing information. + Update linux issues for named locales. + * docs/html/abi.txt: Fix typos. + Add more info. + + * src/misc-inst.cc: Add missing instantiations. + + * testsuite/abi_check.cc: Make output results more verbose. + + * config/os/gnu-linux/ctype_base.h: Remove shadow headers injections. + 2002-09-07 Jakub Jelinek * config/locale/generic/messages_members.cc: Add specialization for diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h index 50a5f797a4c..a431f971c9b 100644 --- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h +++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h @@ -1,6 +1,6 @@ // Locale support -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2002 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 @@ -33,20 +33,6 @@ // Information as gleaned from /usr/include/ctype.h -#if _GLIBCPP_USE_SHADOW_HEADERS - using _C_legacy::_ISspace; - using _C_legacy::_ISprint; - using _C_legacy::_IScntrl; - using _C_legacy::_ISupper; - using _C_legacy::_ISlower; - using _C_legacy::_ISalpha; - using _C_legacy::_ISdigit; - using _C_legacy::_ISpunct; - using _C_legacy::_ISxdigit; - using _C_legacy::_ISalnum; - using _C_legacy::_ISgraph; -#endif - struct ctype_base { // Non-standard typedefs. diff --git a/libstdc++-v3/docs/html/abi.txt b/libstdc++-v3/docs/html/abi.txt index 957fbc0b3f5..770c3cf5974 100644 --- a/libstdc++-v3/docs/html/abi.txt +++ b/libstdc++-v3/docs/html/abi.txt @@ -195,9 +195,17 @@ I. What is an ABI? What's covered? What's not? gcc-3.1.x tools, will meet the requirements above. - What configure options impact symbol versioning? - There is only one: --enable-symvers. For more information see: + + It turns out that most of the configure options that change default + behavior will impact the mangled names of exported symbols, and thus + impact versioning and compatibility. + + For more information on configure options, including ABI impacts, see: http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html + There is one flag that explicitly deals with symbol versioning: + --enable-symvers. + In particular, libstdc++-v3/acinclude.m4 has a macro called GLIBCPP_ENABLE_SYMVERS that defaults to yes (or the argument passed in via --enable-symvers=foo). At that point, the macro attempts to @@ -281,22 +289,28 @@ III. Versioning IV. Testing ABI changes -Currently, there are formal tests for changes in the libstdc++ ABI, -and in addition informal testing procedures. Work to develop these -tests is ongoing. +Testing for GNU C++ ABI changes is composed of two distinct areas: +testing the C++ compiler (g++) for compiler changes, and testing the +C++ library (libstdc++) for library changes. -There is a formal method for checking the compiler parts of the C++ -ABI, donated by Intel. More information can be obtained +Testing the C++ compiler ABI can be done various ways. + +One. +Intel ABI checker. More information can be obtained here. -Also, it seems as if some members of the open source community are -working on C++ ABI testers for the compiler. It is yet unspecified if -these tools will be freely available, and able to be included in a GNU -project. Please contact Mark Mitchell (mark@codesoucery.com) for more -details, and current status. +Two. +The second is yet unreleased, but has been announced on the gcc +mailing list. It is yet unspecified if these tools will be freely +available, and able to be included in a GNU project. Please contact +Mark Mitchell (mark@codesourcery.com) for more details, and current +status. +Three. +Involves using the vlad.consistency test framework. This has also been +discussed on the gcc mailing lists. -To test the library, there are two methods: +Testing the C++ library ABI can also be done various ways. One. (Brendan Kehoe, Jeff Law suggestion to run 'make check-c++' two ways, @@ -310,11 +324,12 @@ Two. Use the 'make check-abi' rule in the libstdc++-v3 Makefile. This is a proactive check the library ABI. Currently, exported symbol -names are checked against a last known good baseline. Currently, this -baseline is keyed off of 3.2.0 binaries, as this was the last time the -.so number was incremented. In addition, all exported names are -demangled, and the exported objects are checked to make sure they are -the same size as the same object in the baseline. +names that are either weak or defined are checked against a last known +good baseline. Currently, this baseline is keyed off of 3.2.0 +binaries, as this was the last time the .so number was incremented. In +addition, all exported names are demangled, and the exported objects +are checked to make sure they are the same size as the same object in +the baseline. In the future, more tests should be added. In particular, vtable information, offsets of data members in class objects, and other @@ -329,7 +344,8 @@ Another approach might be to use the -fdump-class-hierarchy flag to get information. (See g++/7470 on how this was used to find bugs.) -Perhaps there are other Library ABI checkers. If so, please notify us. +Perhaps there are other C++ ABI checkers. If so, please notify +us. We'd like to know about them! V. Issues not directly addressed, and possible suggestions @@ -340,7 +356,7 @@ V. Issues not directly addressed, and possible suggestions --enable-version-specific-runtime-libs - - Alexandre Olva proposal to have extended name attributes, modify ld + - Alexandre Oliva proposal to have extended name attributes, modify ld - directory-level versioning diff --git a/libstdc++-v3/docs/html/configopts.html b/libstdc++-v3/docs/html/configopts.html index 296c509758f..47eb4637fbe 100644 --- a/libstdc++-v3/docs/html/configopts.html +++ b/libstdc++-v3/docs/html/configopts.html @@ -45,109 +45,12 @@ options

-
--enable-debug
-

The configure script will automatically detect the highest - level of optimization that the compiler in use can use. - This --enable flag will disable all optimizations and instruct - the compiler to emit as much extra debugging information as it - can, for use inside GDB. Note this make command, executed in - the build directory, will do much the same thing, without the - configuration difference: - make CXXFLAGS='-g -O0' all -

-
- -
--enable-cstdio
-

This is an abbreviated form of '--enable-cstdio=stdio' - (described next). -

-
- -
--enable-cstdio=LIB
-

Select a target-specific I/O package. As of libstdc++-v3 - snapshot 3.0.96, the choices are 'libio' to specify the GNU - I/O package (from - glibc, the - GNU C library), or 'stdio' to use a generic "C" - abstraction. The default is 'stdio'. A longer explanation - is here. -

-
-
--enable-sjlj-exceptions

Forces old, set-jump/long-jump exception handling model. If at all possible, the new, frame unwinding exception handling routines - should be used instead, as they significantly reduce both runtime - memory usage and executable size. -

-
- -
--enable-clocale
-

This is an abbreviated form of '--enable-clocale=generic' - (described next). -

-
- -
--enable-clocale=MODEL
-

Select a target-specific underlying locale package. The - choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix - (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets, - 'gnu' to specify a model based on functionality from the GNU C - library (langinfo/iconv/gettext) (from glibc, the GNU C - library), or 'generic' to use a generic "C" - abstraction which consists of "C" locale info. The - default is 'generic'. -

-
- -
--enable-c99
-

The "long long" type was introduced in C99, along - with many other functions for wide characters, and math - classification macros, etc. If enabled, all C99 functions not - specified by the C++ standard will be put into namespace - __gnu_cxx, and then all these names will - be injected into namespace std, so that C99 functions can be - used "as if" they were in the C++ standard (as they - will eventually be in some future revision of the standard, - without a doubt). By default, C99 support is on, assuming the - configure probes find all the necessary functions and bits - necessary. -

-
- -
--enable-long-long
-

The "long long" type was introduced in C99. It is - provided as a GNU extension to C++98 in g++. This flag builds - support for "long long" into the library (specialized - templates and the like for iostreams). This option is on by default: - if enabled, users will have to either use the new-style "C" - headers by default (i.e., <cmath> not <math.h>) - or add appropriate compile-time flags to all compile lines to - allow "C" visibility of this feature (on GNU/Linux, - the flag is -D_ISOC99_SOURCE, which is added automatically via - CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE). -

-
- -
--enable-cheaders=OPTION
-

This allows the user to define what kind of C headers are - used. Options are: c, c_std, and c_shadow. These correspond - to the source directory's include/c, include/c_std, and - include/c_shadow directories. The default is c_std. -

-
- -
--enable-threads
-

This is an abbreviated form of '--enable-threads=yes' - (described next). -

-
- -
--enable-threads=LIB
-

Select a threading library. A full description is given in the - general compiler - configuration instructions. + should be used instead, as they significantly reduce both + runtime memory usage and executable size. This option can + change the library ABI.

@@ -173,10 +76,87 @@ options
    --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008
+
--enable-debug
+

The configure script will automatically detect the highest + level of optimization that the compiler in use can use. + This --enable flag will disable all optimizations and instruct + the compiler to emit as much extra debugging information as it + can, for use inside GDB. Note this make command, executed in + the build directory, will do much the same thing, without the + configuration difference: + make CXXFLAGS='-g -O0' all +

+
+ +
--enable-cstdio
+

This is an abbreviated form of '--enable-cstdio=stdio' + (described next). This option can change the library ABI. +

+
+ +
--enable-cstdio=OPTION
+

Select a target-specific I/O package. As of libstdc++-v3 + snapshot 3.0.96, the choices are 'libio' to specify the GNU + I/O package (from + glibc, the + GNU C library), or 'stdio' to use a generic "C" + abstraction. The default is 'stdio'. A longer explanation + is here. +

+
+ +
--enable-clocale
+

This is an abbreviated form of '--enable-clocale=generic' + (described next). This option can change the library ABI. +

+
+ +
--enable-clocale=OPTION
+

Select a target-specific underlying locale package. The + choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix + (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets, + 'gnu' to specify a model based on functionality from the GNU C + library (langinfo/iconv/gettext) (from glibc, the GNU C + library), or 'generic' to use a generic "C" + abstraction which consists of "C" locale info. +

+ +

As part of the configuration process, the "C" library is + probed both for sufficient vintage, and installed locale + data. If either of these elements are not present, the C++ + locale model default to 'generic.' On glibc-based systems of + version 2.2.5 and above with installed locale files, 'gnu' is + automatically selected. +

+
+ +
--enable-cheaders=OPTION
+

This allows the user to define what kind of C headers are + used. Options are: c, c_std, and c_shadow. These correspond + to the source directory's include/c, include/c_std, and + include/c_shadow directories. The default is c_std. +

+
+ +
--enable-threads
+

This is an abbreviated form of '--enable-threads=yes' + (described next). This option can change the library ABI. +

+
+ +
--enable-threads=OPTION
+

Select a threading library. A full description is given in the + general compiler + configuration instructions. +

+
+
--enable-cxx-flags=FLAGS

With this option, you can pass a string of -f (functionality) - flags to the compiler to use when building libstdc++. FLAGS - is a quoted string of options, like + flags to the compiler to use when building libstdc++. This + option can change the library ABI. FLAGS is a quoted string of + options, like

   --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'
@@ -202,13 +182,44 @@ options

+
--enable-c99
+

The "long long" type was introduced in C99, along + with many other functions for wide characters, and math + classification macros, etc. If enabled, all C99 functions not + specified by the C++ standard will be put into namespace + __gnu_cxx, and then all these names will + be injected into namespace std, so that C99 functions can be + used "as if" they were in the C++ standard (as they + will eventually be in some future revision of the standard, + without a doubt). By default, C99 support is on, assuming the + configure probes find all the necessary functions and bits + necessary. This option can change the library ABI. +

+
+
--enable-c-mbchar [default]

Certain template specializations are required for wide character conversion support. This is tricky and currently changing rapidly, and can cause problems on new platforms. Disabling wide character specializations is useful for initial porting steps, but builds only a subset of what is required by - ISO. By default, this option is on. + ISO. By default, this option is on. This option can change + the library ABI. +

+
+ +
--enable-long-long
+

The "long long" type was introduced in C99. It is + provided as a GNU extension to C++98 in g++. This flag builds + support for "long long" into the library (specialized + templates and the like for iostreams). This option is on by default: + if enabled, users will have to either use the new-style "C" + headers by default (i.e., <cmath> not <math.h>) + or add appropriate compile-time flags to all compile lines to + allow "C" visibility of this feature (on GNU/Linux, + the flag is -D_ISOC99_SOURCE, which is added automatically via + CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE). + This option can change the library ABI.

diff --git a/libstdc++-v3/docs/html/install.html b/libstdc++-v3/docs/html/install.html index 7c631086c27..20e2a0a366b 100644 --- a/libstdc++-v3/docs/html/install.html +++ b/libstdc++-v3/docs/html/install.html @@ -92,18 +92,28 @@
linux
-
If you are using gcc 3.1 or later on linux, and are using - the gnu locale model (enabled by default for sufficient - versions of glibc), the following locales are used and tested - in the libstdc++ testsuites: en_HK, en_US, fr_FR, fr_FR@euro, - de_DE, de_DE@euro, ja_JP.eucjp, and it_IT. Failure to have the - underlying "C" library locale information installed will mean - that C++ named locales for the above regions will not work: - because of this, the libstdc++ testsuite will not pass the - named locale tests. If this isn't an issue, don't worry about - it. If named locales are needed, the underlying locale - information must be installed. Note that rebuilding libstdc++ - after locales are installed is not necessary. +
If gcc 3.1.0 or later on is being used on linux, an attempt + will be made to use "C" library functionality necessary for C++ + named locale support. + +

+ The configure option --enable-clocale can be used force a + particular behavior. +

+ +

+ If the 'gnu' locale model is being used, the following locales + are used and tested in the libstdc++ testsuites: en_HK, en_US, + fr_FR, fr_FR@euro, de_DE, de_DE@euro, ja_JP.eucjp, and + it_IT. Failure to have the underlying "C" library locale + information installed will mean that C++ named locales for the + above regions will not work: because of this, the libstdc++ + testsuite will not pass the named locale tests. If this isn't an + issue, don't worry about it. If named locales are needed, the + underlying locale information must be installed. Note that + rebuilding libstdc++ after the "C" locales are installed is not + necessary. +

To install support for locales, do only one of the following:

@@ -250,7 +260,7 @@

    lib/
-   include/g++-v3/
+   include/c++/gcc-version
       backward/
       bits/
       cpu-vendor-os/bits/
@@ -272,6 +282,22 @@
       FAQ 2.4 for which files to examine.
    

+

In addition, there are some testing options that are mostly of + interest to library maintainers and system integrators. As such, + these tests may not work on all cpu and host combinations. These + options include, but are not necessarily limited to, the following: + +

The library ABI can be tested using

+
+   make check-abi
+ +

The library can also be tested using a bash script, instead of + the default dejagnu test harness

+
+   make check-script
+ or +
+   make check-script-install

Using the library

diff --git a/libstdc++-v3/src/misc-inst.cc b/libstdc++-v3/src/misc-inst.cc index 1500e45a721..ff899102009 100644 --- a/libstdc++-v3/src/misc-inst.cc +++ b/libstdc++-v3/src/misc-inst.cc @@ -67,4 +67,19 @@ namespace std basic_istream& getline(basic_istream&, wstring&); #endif + +#if 1 + // XXX + // 2002-05-24 These are no longer needed and should eventually be deleted. + template + string* + __uninitialized_fill_n_aux + (string*, size_t, string const &, __false_type); + + template + string* + __uninitialized_copy_aux::const_iterator, string *> + (vector::const_iterator, vector::const_iterator, + string*, __false_type); +#endif } // namespace std diff --git a/libstdc++-v3/testsuite/abi_check.cc b/libstdc++-v3/testsuite/abi_check.cc index 10c300c853d..fd030063d0c 100644 --- a/libstdc++-v3/testsuite/abi_check.cc +++ b/libstdc++-v3/testsuite/abi_check.cc @@ -56,24 +56,54 @@ struct symbol_info }; bool -operator==(const symbol_info& lhs, const symbol_info& rhs) +check_compatible(const symbol_info& lhs, const symbol_info& rhs, + bool verbose = false) { + using namespace std; bool ret = true; + const char tab = '\t'; // Check to see if symbol_infos are compatible. - ret &= lhs.type == rhs.type; - ret &= lhs.name == rhs.name; - ret &= lhs.size == rhs.size; + if (lhs.type != rhs.type) + { + ret = false; + if (verbose) + { + cout << tab << "incompatible types" << endl; + } + } + + if (lhs.name != rhs.name) + { + ret = false; + if (verbose) + { + cout << tab << "incompatible names" << endl; + } + } + + if (lhs.size != rhs.size) + { + ret = false; + if (verbose) + { + cout << tab << "incompatible sizes" << endl; + } + } // Expect something more sophisticated eventually. - ret &= lhs.version == rhs.version; + if (lhs.version != rhs.version) + { + ret = false; + if (verbose) + { + cout << tab << "incompatible versions" << endl; + } + } + return ret; } -bool -operator!=(const symbol_info& lhs, const symbol_info& rhs) -{ return !(lhs == rhs); } - template std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>& os, symbol_info& si) @@ -188,8 +218,8 @@ typedef std::deque symbol_names; typedef __gnu_cxx::hash_map symbol_infos; void -collect_symbol_data(const char* file, symbol_infos& symbols, - symbol_names& names) +create_symbol_data(const char* file, symbol_infos& symbols, + symbol_names& names) { // Parse list of symbols in file into vectors of symbol_info. // For 3.2.0 on x86/linux, this usually is @@ -213,6 +243,21 @@ collect_symbol_data(const char* file, symbol_infos& symbols, } } +void +report_symbol_info(const symbol_info& symbol, std::size_t n) +{ + using namespace std; + const char tab = '\t'; + cout << tab << n << endl; + cout << tab << "symbol"<< endl; + cout << tab << symbol.name << endl; + + // Add any other information to display here. + cout << tab << "demangled symbol"<< endl; + cout << tab << symbol.name_demangled << endl; + + cout << endl; +} int main(int argc, char** argv) { @@ -275,8 +320,8 @@ int main(int argc, char** argv) symbol_names baseline_names; symbol_infos test_symbols; symbol_names test_names; - collect_symbol_data(baseline_file, baseline_symbols, baseline_names); - collect_symbol_data(test_file, test_symbols, test_names); + create_symbol_data(baseline_file, baseline_symbols, baseline_names); + create_symbol_data(test_file, test_symbols, test_names); // Basic sanity check. (Was: error checking, what's that?) const symbol_names::size_type baseline_size = baseline_names.size(); @@ -323,28 +368,31 @@ int main(int argc, char** argv) vector incompatible; for (size_t i = 0; i < shared_size; ++i) { - symbol_info binfo = baseline_symbols[shared_names[i].first.c_str()]; - symbol_info tinfo = test_symbols[shared_names[i].second.c_str()]; - if (binfo != tinfo) - incompatible.push_back(symbol_pair(binfo, tinfo)); + symbol_info base = baseline_symbols[shared_names[i].first.c_str()]; + symbol_info test = test_symbols[shared_names[i].second.c_str()]; + if (!check_compatible(base, test)) + incompatible.push_back(symbol_pair(base, test)); } - // Output data. + // Report results. cout << test_names.size() << " added symbols " << endl; for (size_t j = 0; j < test_names.size() ; ++j) - cout << '\t' << test_names[j] << endl; + report_symbol_info(test_symbols[test_names[j].c_str()], j + 1); cout << missing_names.size() << " missing symbols " << endl; for (size_t j = 0; j < missing_names.size() ; ++j) - cout << '\t' << missing_names[j] << endl; + report_symbol_info(baseline_symbols[missing_names[j].c_str()], j + 1); cout << incompatible.size() << " incompatible symbols " << endl; for (size_t j = 0; j < incompatible.size() ; ++j) { - cout << "baseline symbol_info:" << endl; - cout << incompatible[j].first << endl; - cout << "test symbol_info:" << endl; - cout << incompatible[j].second << endl; + // First, report name. + const symbol_info& base = incompatible[j].first; + const symbol_info& test = incompatible[j].second; + report_symbol_info(test, j + 1); + + // Second, report reason or reasons incompatible. + check_compatible(base, test, true); } return 0;