configopts.html: Change grouping.

2002-09-09  Benjamin Kosnik  <bkoz@redhat.com>

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

From-SVN: r56979
This commit is contained in:
Benjamin Kosnik 2002-09-09 20:26:42 +00:00 committed by Benjamin Kosnik
parent e2a6476ec7
commit f7be254940
7 changed files with 293 additions and 174 deletions

View File

@ -1,3 +1,20 @@
2002-09-09 Benjamin Kosnik <bkoz@redhat.com>
* 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 <jakub@redhat.com>
* config/locale/generic/messages_members.cc: Add specialization for

View File

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

View File

@ -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
<a href="http://developer.intel.com/software/products/opensource/">here.</a>
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

View File

@ -45,109 +45,12 @@ options</a></h1>
</p>
</dd>
<dt><code>--enable-debug </code></dt>
<dd><p>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:
<code>make CXXFLAGS='-g -O0' all</code>
</p>
</dd>
<dt><code>--enable-cstdio </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
(described next).
</p>
</dd>
<dt><code>--enable-cstdio=LIB </code></dt>
<dd><p>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
<a href="http://sources.redhat.com/glibc/">glibc</a>, the
GNU C library), or 'stdio' to use a generic &quot;C&quot;
abstraction. The default is 'stdio'. A longer explanation
is <a href="explanations.html#cstdio">here</a>.
</p>
</dd>
<dt><code>--enable-sjlj-exceptions </code></dt>
<dd><p>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.
</p>
</dd>
<dt><code>--enable-clocale </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
(described next).
</p>
</dd>
<dt><code>--enable-clocale=MODEL </code></dt>
<dd><p>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 <a
href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
library), or 'generic' to use a generic &quot;C&quot;
abstraction which consists of &quot;C&quot; locale info. The
default is 'generic'.
</p>
</dd>
<dt><code>--enable-c99 </code></dt>
<dd><p>The &quot;long long&quot; 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 <code>namespace
__gnu_cxx</code>, and then all these names will
be injected into namespace std, so that C99 functions can be
used &quot;as if&quot; 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.
</p>
</dd>
<dt><code>--enable-long-long </code></dt>
<dd><p>The &quot;long long&quot; type was introduced in C99. It is
provided as a GNU extension to C++98 in g++. This flag builds
support for &quot;long long&quot; 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 &quot;C&quot;
headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
or add appropriate compile-time flags to all compile lines to
allow &quot;C&quot; 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).
</p>
</dd>
<dt><code>--enable-cheaders=OPTION </code></dt>
<dd><p>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.
</p>
</dd>
<dt><code>--enable-threads </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
(described next).
</p>
</dd>
<dt><code>--enable-threads=LIB </code></dt>
<dd><p>Select a threading library. A full description is given in the
general <a href="http://gcc.gnu.org/install/configure.html">compiler
configuration instructions</a>.
should be used instead, as they significantly reduce both
runtime memory usage and executable size. This option can
change the library ABI.
</p>
</dd>
@ -173,10 +76,87 @@ options</a></h1>
<pre>
--with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre> </dd>
<dt><code>--enable-debug </code></dt>
<dd><p>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:
<code>make CXXFLAGS='-g -O0' all</code>
</p>
</dd>
<dt><code>--enable-cstdio </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
(described next). This option can change the library ABI.
</p>
</dd>
<dt><code>--enable-cstdio=OPTION </code></dt>
<dd><p>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
<a href="http://sources.redhat.com/glibc/">glibc</a>, the
GNU C library), or 'stdio' to use a generic &quot;C&quot;
abstraction. The default is 'stdio'. A longer explanation
is <a href="explanations.html#cstdio">here</a>.
</p>
</dd>
<dt><code>--enable-clocale </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
(described next). This option can change the library ABI.
</p>
</dd>
<dt><code>--enable-clocale=OPTION </code></dt>
<dd><p>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 <a
href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
library), or 'generic' to use a generic &quot;C&quot;
abstraction which consists of &quot;C&quot; locale info.
</p>
<p>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.
</p>
</dd>
<dt><code>--enable-cheaders=OPTION </code></dt>
<dd><p>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.
</p>
</dd>
<dt><code>--enable-threads </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
(described next). This option can change the library ABI.
</p>
</dd>
<dt><code>--enable-threads=OPTION </code></dt>
<dd><p>Select a threading library. A full description is given in the
general <a href="http://gcc.gnu.org/install/configure.html">compiler
configuration instructions</a>.
</p>
</dd>
<dt><code>--enable-cxx-flags=FLAGS</code></dt>
<dd><p>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
</p>
<pre>
--enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
@ -202,13 +182,44 @@ options</a></h1>
</p>
</dd>
<dt><code>--enable-c99 </code></dt>
<dd><p>The &quot;long long&quot; 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 <code>namespace
__gnu_cxx</code>, and then all these names will
be injected into namespace std, so that C99 functions can be
used &quot;as if&quot; 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.
</p>
</dd>
<dt><code>--enable-c-mbchar </code>[default]</dt>
<dd><p>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.
</p>
</dd>
<dt><code>--enable-long-long </code></dt>
<dd><p>The &quot;long long&quot; type was introduced in C99. It is
provided as a GNU extension to C++98 in g++. This flag builds
support for &quot;long long&quot; 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 &quot;C&quot;
headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
or add appropriate compile-time flags to all compile lines to
allow &quot;C&quot; 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.
</p>
</dd>

View File

@ -92,18 +92,28 @@
<dl>
<dt> linux </dt>
<dd>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.
<dd>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.
<p>
The configure option --enable-clocale can be used force a
particular behavior.
</p>
<p>
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.
</p>
<p> To install
support for locales, do only one of the following: </p>
@ -250,7 +260,7 @@
</p>
<pre>
lib/
include/g++-v3/
include/c++/<em>gcc-version</em>
backward/
bits/
<em>cpu-vendor-os</em>/bits/
@ -272,6 +282,22 @@
<a href="faq/index.html#2_4">FAQ 2.4</a> for which files to examine.
</p>
<p> 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:
<p>The library ABI can be tested using</p>
<pre>
make check-abi</pre>
<p>The library can also be tested using a bash script, instead of
the default dejagnu test harness</p>
<pre>
make check-script</pre>
or
<pre>
make check-script-install</pre>
<hr />
<h2><a name="usage">Using the library</a></h2>

View File

@ -67,4 +67,19 @@ namespace std
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, 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>
(string*, size_t, string const &, __false_type);
template
string*
__uninitialized_copy_aux<vector<string>::const_iterator, string *>
(vector<string>::const_iterator, vector<string>::const_iterator,
string*, __false_type);
#endif
} // namespace std

View File

@ -56,23 +56,53 @@ 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;
// Expect something more sophisticated eventually.
ret &= lhs.version == rhs.version;
return ret;
if (lhs.type != rhs.type)
{
ret = false;
if (verbose)
{
cout << tab << "incompatible types" << endl;
}
}
bool
operator!=(const symbol_info& lhs, const symbol_info& rhs)
{ return !(lhs == rhs); }
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.
if (lhs.version != rhs.version)
{
ret = false;
if (verbose)
{
cout << tab << "incompatible versions" << endl;
}
}
return ret;
}
template<typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
@ -188,7 +218,7 @@ typedef std::deque<std::string> symbol_names;
typedef __gnu_cxx::hash_map<const char*, symbol_info> symbol_infos;
void
collect_symbol_data(const char* file, symbol_infos& symbols,
create_symbol_data(const char* file, symbol_infos& symbols,
symbol_names& names)
{
// Parse list of symbols in file into vectors of symbol_info.
@ -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<symbol_pair> 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;