Commit f7be2549 by Benjamin Kosnik Committed by Benjamin Kosnik

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
parent e2a6476e
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> 2002-09-07 Jakub Jelinek <jakub@redhat.com>
* config/locale/generic/messages_members.cc: Add specialization for * config/locale/generic/messages_members.cc: Add specialization for
......
// Locale support -*- C++ -*- // 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 // 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 // software; you can redistribute it and/or modify it under the
...@@ -33,20 +33,6 @@ ...@@ -33,20 +33,6 @@
// Information as gleaned from /usr/include/ctype.h // 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 struct ctype_base
{ {
// Non-standard typedefs. // Non-standard typedefs.
......
...@@ -195,9 +195,17 @@ I. What is an ABI? What's covered? What's not? ...@@ -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. gcc-3.1.x tools, will meet the requirements above.
- What configure options impact symbol versioning? - 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 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 In particular, libstdc++-v3/acinclude.m4 has a macro called
GLIBCPP_ENABLE_SYMVERS that defaults to yes (or the argument passed GLIBCPP_ENABLE_SYMVERS that defaults to yes (or the argument passed
in via --enable-symvers=foo). At that point, the macro attempts to in via --enable-symvers=foo). At that point, the macro attempts to
...@@ -281,22 +289,28 @@ III. Versioning ...@@ -281,22 +289,28 @@ III. Versioning
IV. Testing ABI changes IV. Testing ABI changes
Currently, there are formal tests for changes in the libstdc++ ABI, Testing for GNU C++ ABI changes is composed of two distinct areas:
and in addition informal testing procedures. Work to develop these testing the C++ compiler (g++) for compiler changes, and testing the
tests is ongoing. C++ library (libstdc++) for library changes.
There is a formal method for checking the compiler parts of the C++ Testing the C++ compiler ABI can be done various ways.
ABI, donated by Intel. More information can be obtained
One.
Intel ABI checker. More information can be obtained
<a href="http://developer.intel.com/software/products/opensource/">here.</a> <a href="http://developer.intel.com/software/products/opensource/">here.</a>
Also, it seems as if some members of the open source community are Two.
working on C++ ABI testers for the compiler. It is yet unspecified if The second is yet unreleased, but has been announced on the gcc
these tools will be freely available, and able to be included in a GNU mailing list. It is yet unspecified if these tools will be freely
project. Please contact Mark Mitchell (mark@codesoucery.com) for more available, and able to be included in a GNU project. Please contact
details, and current status. 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. One.
(Brendan Kehoe, Jeff Law suggestion to run 'make check-c++' two ways, (Brendan Kehoe, Jeff Law suggestion to run 'make check-c++' two ways,
...@@ -310,11 +324,12 @@ Two. ...@@ -310,11 +324,12 @@ Two.
Use the 'make check-abi' rule in the libstdc++-v3 Makefile. Use the 'make check-abi' rule in the libstdc++-v3 Makefile.
This is a proactive check the library ABI. Currently, exported symbol This is a proactive check the library ABI. Currently, exported symbol
names are checked against a last known good baseline. Currently, this names that are either weak or defined are checked against a last known
baseline is keyed off of 3.2.0 binaries, as this was the last time the good baseline. Currently, this baseline is keyed off of 3.2.0
.so number was incremented. In addition, all exported names are binaries, as this was the last time the .so number was incremented. In
demangled, and the exported objects are checked to make sure they are addition, all exported names are demangled, and the exported objects
the same size as the same object in the baseline. 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 In the future, more tests should be added. In particular, vtable
information, offsets of data members in class objects, and other 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 ...@@ -329,7 +344,8 @@ Another approach might be to use the -fdump-class-hierarchy flag to
get information. get information.
(See g++/7470 on how this was used to find bugs.) (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 V. Issues not directly addressed, and possible suggestions
...@@ -340,7 +356,7 @@ 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 --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 - directory-level versioning
......
...@@ -45,6 +45,37 @@ options</a></h1> ...@@ -45,6 +45,37 @@ options</a></h1>
</p> </p>
</dd> </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. This option can
change the library ABI.
</p>
</dd>
<dt><code>--enable-version-specific-runtime-libs </code></dt>
<dd><p>Specify that run-time libraries should be installed in the
compiler-specific subdirectory (i.e.,
<code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
instead of <code>${libdir}</code>. This option is useful if you
intend to use several versions of gcc in parallel. In addition,
libstdc++'s include files will be installed in
<code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
unless you also specify
<code>--with-gxx-include-dir=<em>dirname</em></code> during configuration.
</p>
</dd>
<dt><code>--with-gxx-include-dir=&lt;include-files dir&gt;</code></dt>
<dd><p>Adds support for named libstdc++ include directory. For instance,
the following puts all the libstdc++ headers into a directory
called &quot;2.97-20001008&quot; instead of the usual
&quot;g++-v3&quot;.
</p>
<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> <dt><code>--enable-debug </code></dt>
<dd><p>The configure script will automatically detect the highest <dd><p>The configure script will automatically detect the highest
level of optimization that the compiler in use can use. level of optimization that the compiler in use can use.
...@@ -59,11 +90,11 @@ options</a></h1> ...@@ -59,11 +90,11 @@ options</a></h1>
<dt><code>--enable-cstdio </code></dt> <dt><code>--enable-cstdio </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code> <dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
(described next). (described next). This option can change the library ABI.
</p> </p>
</dd> </dd>
<dt><code>--enable-cstdio=LIB </code></dt> <dt><code>--enable-cstdio=OPTION </code></dt>
<dd><p>Select a target-specific I/O package. As of libstdc++-v3 <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 snapshot 3.0.96, the choices are 'libio' to specify the GNU
I/O package (from I/O package (from
...@@ -74,21 +105,13 @@ options</a></h1> ...@@ -74,21 +105,13 @@ options</a></h1>
</p> </p>
</dd> </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> <dt><code>--enable-clocale </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code> <dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
(described next). (described next). This option can change the library ABI.
</p> </p>
</dd> </dd>
<dt><code>--enable-clocale=MODEL </code></dt> <dt><code>--enable-clocale=OPTION </code></dt>
<dd><p>Select a target-specific underlying locale package. The <dd><p>Select a target-specific underlying locale package. The
choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
(IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets, (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
...@@ -96,37 +119,15 @@ options</a></h1> ...@@ -96,37 +119,15 @@ options</a></h1>
library (langinfo/iconv/gettext) (from <a library (langinfo/iconv/gettext) (from <a
href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
library), or 'generic' to use a generic &quot;C&quot; library), or 'generic' to use a generic &quot;C&quot;
abstraction which consists of &quot;C&quot; locale info. The abstraction which consists of &quot;C&quot; locale info.
default is 'generic'.
</p> </p>
</dd>
<dt><code>--enable-c99 </code></dt> <p>As part of the configuration process, the "C" library is
<dd><p>The &quot;long long&quot; type was introduced in C99, along probed both for sufficient vintage, and installed locale
with many other functions for wide characters, and math data. If either of these elements are not present, the C++
classification macros, etc. If enabled, all C99 functions not locale model default to 'generic.' On glibc-based systems of
specified by the C++ standard will be put into <code>namespace version 2.2.5 and above with installed locale files, 'gnu' is
__gnu_cxx</code>, and then all these names will automatically selected.
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> </p>
</dd> </dd>
...@@ -140,43 +141,22 @@ options</a></h1> ...@@ -140,43 +141,22 @@ options</a></h1>
<dt><code>--enable-threads </code></dt> <dt><code>--enable-threads </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code> <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
(described next). (described next). This option can change the library ABI.
</p> </p>
</dd> </dd>
<dt><code>--enable-threads=LIB </code></dt> <dt><code>--enable-threads=OPTION </code></dt>
<dd><p>Select a threading library. A full description is given in the <dd><p>Select a threading library. A full description is given in the
general <a href="http://gcc.gnu.org/install/configure.html">compiler general <a href="http://gcc.gnu.org/install/configure.html">compiler
configuration instructions</a>. configuration instructions</a>.
</p> </p>
</dd> </dd>
<dt><code>--enable-version-specific-runtime-libs </code></dt>
<dd><p>Specify that run-time libraries should be installed in the
compiler-specific subdirectory (i.e.,
<code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
instead of <code>${libdir}</code>. This option is useful if you
intend to use several versions of gcc in parallel. In addition,
libstdc++'s include files will be installed in
<code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
unless you also specify
<code>--with-gxx-include-dir=<em>dirname</em></code> during configuration.
</p>
</dd>
<dt><code>--with-gxx-include-dir=&lt;include-files dir&gt;</code></dt>
<dd><p>Adds support for named libstdc++ include directory. For instance,
the following puts all the libstdc++ headers into a directory
called &quot;2.97-20001008&quot; instead of the usual
&quot;g++-v3&quot;.
</p>
<pre>
--with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre> </dd>
<dt><code>--enable-cxx-flags=FLAGS</code></dt> <dt><code>--enable-cxx-flags=FLAGS</code></dt>
<dd><p>With this option, you can pass a string of -f (functionality) <dd><p>With this option, you can pass a string of -f (functionality)
flags to the compiler to use when building libstdc++. FLAGS flags to the compiler to use when building libstdc++. This
is a quoted string of options, like option can change the library ABI. FLAGS is a quoted string of
options, like
</p> </p>
<pre> <pre>
--enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre> --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
...@@ -202,13 +182,44 @@ options</a></h1> ...@@ -202,13 +182,44 @@ options</a></h1>
</p> </p>
</dd> </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> <dt><code>--enable-c-mbchar </code>[default]</dt>
<dd><p>Certain template specializations are required for wide <dd><p>Certain template specializations are required for wide
character conversion support. This is tricky and currently character conversion support. This is tricky and currently
changing rapidly, and can cause problems on new platforms. changing rapidly, and can cause problems on new platforms.
Disabling wide character specializations is useful for initial Disabling wide character specializations is useful for initial
porting steps, but builds only a subset of what is required by 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> </p>
</dd> </dd>
......
...@@ -92,18 +92,28 @@ ...@@ -92,18 +92,28 @@
<dl> <dl>
<dt> linux </dt> <dt> linux </dt>
<dd>If you are using gcc 3.1 or later on linux, and are using <dd>If gcc 3.1.0 or later on is being used on linux, an attempt
the gnu locale model (enabled by default for sufficient will be made to use "C" library functionality necessary for C++
versions of glibc), the following locales are used and tested named locale support.
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 <p>
underlying "C" library locale information installed will mean The configure option --enable-clocale can be used force a
that C++ named locales for the above regions will not work: particular behavior.
because of this, the libstdc++ testsuite will not pass the </p>
named locale tests. If this isn't an issue, don't worry about
it. If named locales are needed, the underlying locale <p>
information must be installed. Note that rebuilding libstdc++ If the 'gnu' locale model is being used, the following locales
after locales are installed is not necessary. 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 <p> To install
support for locales, do only one of the following: </p> support for locales, do only one of the following: </p>
...@@ -250,7 +260,7 @@ ...@@ -250,7 +260,7 @@
</p> </p>
<pre> <pre>
lib/ lib/
include/g++-v3/ include/c++/<em>gcc-version</em>
backward/ backward/
bits/ bits/
<em>cpu-vendor-os</em>/bits/ <em>cpu-vendor-os</em>/bits/
...@@ -272,6 +282,22 @@ ...@@ -272,6 +282,22 @@
<a href="faq/index.html#2_4">FAQ 2.4</a> for which files to examine. <a href="faq/index.html#2_4">FAQ 2.4</a> for which files to examine.
</p> </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 /> <hr />
<h2><a name="usage">Using the library</a></h2> <h2><a name="usage">Using the library</a></h2>
......
...@@ -67,4 +67,19 @@ namespace std ...@@ -67,4 +67,19 @@ namespace std
basic_istream<wchar_t>& basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&); getline(basic_istream<wchar_t>&, wstring&);
#endif #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 } // namespace std
...@@ -56,24 +56,54 @@ struct symbol_info ...@@ -56,24 +56,54 @@ struct symbol_info
}; };
bool 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; bool ret = true;
const char tab = '\t';
// Check to see if symbol_infos are compatible. // Check to see if symbol_infos are compatible.
ret &= lhs.type == rhs.type; if (lhs.type != rhs.type)
ret &= lhs.name == rhs.name; {
ret &= lhs.size == rhs.size; 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. // 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; return ret;
} }
bool
operator!=(const symbol_info& lhs, const symbol_info& rhs)
{ return !(lhs == rhs); }
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& os, symbol_info& si) operator<<(std::basic_ostream<_CharT, _Traits>& os, symbol_info& si)
...@@ -188,7 +218,7 @@ typedef std::deque<std::string> symbol_names; ...@@ -188,7 +218,7 @@ typedef std::deque<std::string> symbol_names;
typedef __gnu_cxx::hash_map<const char*, symbol_info> symbol_infos; typedef __gnu_cxx::hash_map<const char*, symbol_info> symbol_infos;
void void
collect_symbol_data(const char* file, symbol_infos& symbols, create_symbol_data(const char* file, symbol_infos& symbols,
symbol_names& names) symbol_names& names)
{ {
// Parse list of symbols in file into vectors of symbol_info. // Parse list of symbols in file into vectors of symbol_info.
...@@ -213,6 +243,21 @@ collect_symbol_data(const char* file, symbol_infos& symbols, ...@@ -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) int main(int argc, char** argv)
{ {
...@@ -275,8 +320,8 @@ int main(int argc, char** argv) ...@@ -275,8 +320,8 @@ int main(int argc, char** argv)
symbol_names baseline_names; symbol_names baseline_names;
symbol_infos test_symbols; symbol_infos test_symbols;
symbol_names test_names; symbol_names test_names;
collect_symbol_data(baseline_file, baseline_symbols, baseline_names); create_symbol_data(baseline_file, baseline_symbols, baseline_names);
collect_symbol_data(test_file, test_symbols, test_names); create_symbol_data(test_file, test_symbols, test_names);
// Basic sanity check. (Was: error checking, what's that?) // Basic sanity check. (Was: error checking, what's that?)
const symbol_names::size_type baseline_size = baseline_names.size(); const symbol_names::size_type baseline_size = baseline_names.size();
...@@ -323,28 +368,31 @@ int main(int argc, char** argv) ...@@ -323,28 +368,31 @@ int main(int argc, char** argv)
vector<symbol_pair> incompatible; vector<symbol_pair> incompatible;
for (size_t i = 0; i < shared_size; ++i) for (size_t i = 0; i < shared_size; ++i)
{ {
symbol_info binfo = baseline_symbols[shared_names[i].first.c_str()]; symbol_info base = baseline_symbols[shared_names[i].first.c_str()];
symbol_info tinfo = test_symbols[shared_names[i].second.c_str()]; symbol_info test = test_symbols[shared_names[i].second.c_str()];
if (binfo != tinfo) if (!check_compatible(base, test))
incompatible.push_back(symbol_pair(binfo, tinfo)); incompatible.push_back(symbol_pair(base, test));
} }
// Output data. // Report results.
cout << test_names.size() << " added symbols " << endl; cout << test_names.size() << " added symbols " << endl;
for (size_t j = 0; j < test_names.size() ; ++j) 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; cout << missing_names.size() << " missing symbols " << endl;
for (size_t j = 0; j < missing_names.size() ; ++j) 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; cout << incompatible.size() << " incompatible symbols " << endl;
for (size_t j = 0; j < incompatible.size() ; ++j) for (size_t j = 0; j < incompatible.size() ; ++j)
{ {
cout << "baseline symbol_info:" << endl; // First, report name.
cout << incompatible[j].first << endl; const symbol_info& base = incompatible[j].first;
cout << "test symbol_info:" << endl; const symbol_info& test = incompatible[j].second;
cout << incompatible[j].second << endl; report_symbol_info(test, j + 1);
// Second, report reason or reasons incompatible.
check_compatible(base, test, true);
} }
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment