Commit c9fd7c7b by Benjamin Kosnik

re PR libstdc++/52191 (abi_check should flag additions to released versions)

2012-02-21  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/52191
	* testsuite/util/testsuite_abi.cc (compare_symbols): Check new
	symbols added into the latest version. Mark tls entities as
	undesignated.

From-SVN: r184639
parent 19c0d7df
2012-02-21 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/52191
* testsuite/util/testsuite_abi.cc (compare_symbols): Check new
symbols added into the latest version. Mark tls entities as
undesignated.
2012-02-28 Jakub Jelinek <jakub@redhat.com> 2012-02-28 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/52414 PR bootstrap/52414
...@@ -37,7 +44,8 @@ ...@@ -37,7 +44,8 @@
2012-02-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2012-02-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR testsuite/52201 PR testsuite/52201
* testsuite/29_atomics/atomic/operators/pointer_partial_void.cc: Require atomic builtins. * testsuite/29_atomics/atomic/operators/pointer_partial_void.cc:
Require atomic builtins.
* testsuite/29_atomics/atomic/operators/51811.cc: Likewise. * testsuite/29_atomics/atomic/operators/51811.cc: Likewise.
2012-02-23 Jason Merrill <jason@redhat.com> 2012-02-23 Jason Merrill <jason@redhat.com>
...@@ -88,7 +96,7 @@ ...@@ -88,7 +96,7 @@
* testsuite/26_numerics/random/ * testsuite/26_numerics/random/
geometric_distribution/requirements/typedefs.cc: Ditto. geometric_distribution/requirements/typedefs.cc: Ditto.
2012-02-17 Benjamin Kosnik <bkoz@redhat.com> 2012-02-21 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/50349 PR libstdc++/50349
* config/abi/pre/gnu.ver: Only one local. * config/abi/pre/gnu.ver: Only one local.
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 // Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
using namespace std; using namespace std;
void void
symbol::init(string& data) symbol::init(string& data)
{ {
const char delim = ':'; const char delim = ':';
...@@ -119,9 +119,9 @@ symbol::print() const ...@@ -119,9 +119,9 @@ symbol::print() const
} }
cout << "version status: " << vers << endl; cout << "version status: " << vers << endl;
if (version_name.size() if (version_name.size()
&& (version_status == compatible || version_status == incompatible)) && (version_status == compatible || version_status == incompatible))
cout << version_name << endl; cout << version_name << endl;
string type_string; string type_string;
switch (type) switch (type)
...@@ -142,7 +142,7 @@ symbol::print() const ...@@ -142,7 +142,7 @@ symbol::print() const
type_string = "<default>"; type_string = "<default>";
} }
cout << "type: " << type_string << endl; cout << "type: " << type_string << endl;
if (type == object || type == tls) if (type == object || type == tls)
cout << "type size: " << size << endl; cout << "type size: " << size << endl;
...@@ -181,7 +181,7 @@ check_version(symbol& test, bool added) ...@@ -181,7 +181,7 @@ check_version(symbol& test, bool added)
known_versions.push_back("GLIBCXX_3.4.1"); known_versions.push_back("GLIBCXX_3.4.1");
known_versions.push_back("GLIBCXX_3.4.2"); known_versions.push_back("GLIBCXX_3.4.2");
known_versions.push_back("GLIBCXX_3.4.3"); known_versions.push_back("GLIBCXX_3.4.3");
known_versions.push_back("GLIBCXX_3.4.4"); known_versions.push_back("GLIBCXX_3.4.4");
known_versions.push_back("GLIBCXX_3.4.5"); known_versions.push_back("GLIBCXX_3.4.5");
known_versions.push_back("GLIBCXX_3.4.6"); known_versions.push_back("GLIBCXX_3.4.6");
known_versions.push_back("GLIBCXX_3.4.7"); known_versions.push_back("GLIBCXX_3.4.7");
...@@ -203,10 +203,10 @@ check_version(symbol& test, bool added) ...@@ -203,10 +203,10 @@ check_version(symbol& test, bool added)
known_versions.push_back("CXXABI_1.3.2"); known_versions.push_back("CXXABI_1.3.2");
known_versions.push_back("CXXABI_1.3.3"); known_versions.push_back("CXXABI_1.3.3");
known_versions.push_back("CXXABI_1.3.4"); known_versions.push_back("CXXABI_1.3.4");
known_versions.push_back("CXXABI_TM_1");
known_versions.push_back("CXXABI_1.3.5"); known_versions.push_back("CXXABI_1.3.5");
known_versions.push_back("CXXABI_1.3.6"); known_versions.push_back("CXXABI_1.3.6");
known_versions.push_back("CXXABI_LDBL_1.3"); known_versions.push_back("CXXABI_LDBL_1.3");
known_versions.push_back("CXXABI_TM_1");
} }
compat_list::iterator begin = known_versions.begin(); compat_list::iterator begin = known_versions.begin();
compat_list::iterator end = known_versions.end(); compat_list::iterator end = known_versions.end();
...@@ -220,13 +220,12 @@ check_version(symbol& test, bool added) ...@@ -220,13 +220,12 @@ check_version(symbol& test, bool added)
test.version_status = symbol::compatible; test.version_status = symbol::compatible;
else else
test.version_status = symbol::incompatible; test.version_status = symbol::incompatible;
// Check that added symbols aren't added in the base versions. // Check that added symbols are added in the latest pre-release version.
if (added bool latestp = (test.version_name == "GLIBCXX_3.4.17"
&& (test.version_name == known_versions[0] || test.version_name == "CXXABI_1.3.6"
|| test.version_name == "CXXABI_1.3" || test.version_name == "CXXABI_TM_1");
|| test.version_name == "GLIBCXX_LDBL_3.4" if (added && !latestp)
|| test.version_name == "CXXABI_LDBL_1.3"))
test.version_status = symbol::incompatible; test.version_status = symbol::incompatible;
// Check that long double compatibility symbols demangled as // Check that long double compatibility symbols demangled as
...@@ -241,8 +240,8 @@ check_version(symbol& test, bool added) ...@@ -241,8 +240,8 @@ check_version(symbol& test, bool added)
// Check for weak label. // Check for weak label.
if (it1 == end && it2 == end) if (it1 == end && it2 == end)
test.version_status = symbol::incompatible; test.version_status = symbol::incompatible;
// Check that // Check that
// GLIBCXX_3.4 // GLIBCXX_3.4
// GLIBCXX_3.4.5 // GLIBCXX_3.4.5
// version as compatible // version as compatible
...@@ -263,7 +262,7 @@ check_version(symbol& test, bool added) ...@@ -263,7 +262,7 @@ check_version(symbol& test, bool added)
return test.version_status == symbol::compatible; return test.version_status == symbol::compatible;
} }
bool bool
check_compatible(symbol& lhs, symbol& rhs, bool verbose) check_compatible(symbol& lhs, symbol& rhs, bool verbose)
{ {
bool ret = true; bool ret = true;
...@@ -276,7 +275,7 @@ check_compatible(symbol& lhs, symbol& rhs, bool verbose) ...@@ -276,7 +275,7 @@ check_compatible(symbol& lhs, symbol& rhs, bool verbose)
if (verbose) if (verbose)
cout << tab << "incompatible types" << endl; cout << tab << "incompatible types" << endl;
} }
if (lhs.name != rhs.name) if (lhs.name != rhs.name)
{ {
ret = false; ret = false;
...@@ -295,7 +294,7 @@ check_compatible(symbol& lhs, symbol& rhs, bool verbose) ...@@ -295,7 +294,7 @@ check_compatible(symbol& lhs, symbol& rhs, bool verbose)
} }
} }
if (lhs.version_name != rhs.version_name if (lhs.version_name != rhs.version_name
&& !check_version(lhs) && !check_version(rhs)) && !check_version(lhs) && !check_version(rhs))
{ {
ret = false; ret = false;
...@@ -334,7 +333,7 @@ get_symbol(const string& name, const symbols& s) ...@@ -334,7 +333,7 @@ get_symbol(const string& name, const symbols& s)
} }
} }
void void
examine_symbol(const char* name, const char* file) examine_symbol(const char* name, const char* file)
{ {
try try
...@@ -348,7 +347,7 @@ examine_symbol(const char* name, const char* file) ...@@ -348,7 +347,7 @@ examine_symbol(const char* name, const char* file)
} }
int int
compare_symbols(const char* baseline_file, const char* test_file, compare_symbols(const char* baseline_file, const char* test_file,
bool verbose) bool verbose)
{ {
// Input both lists of symbols into container. // Input both lists of symbols into container.
...@@ -377,7 +376,7 @@ compare_symbols(const char* baseline_file, const char* test_file, ...@@ -377,7 +376,7 @@ compare_symbols(const char* baseline_file, const char* test_file,
// duplicates. // duplicates.
// //
// The names added to missing_names are baseline names not found in // The names added to missing_names are baseline names not found in
// test names // test names
// -> symbols that have been deleted. // -> symbols that have been deleted.
// //
// The names added to added_names are test names not in // The names added to added_names are test names not in
...@@ -416,6 +415,9 @@ compare_symbols(const char* baseline_file, const char* test_file, ...@@ -416,6 +415,9 @@ compare_symbols(const char* baseline_file, const char* test_file,
typedef pair<symbol, symbol> symbol_pair; typedef pair<symbol, symbol> symbol_pair;
vector<symbol_pair> incompatible; vector<symbol_pair> incompatible;
// Fill out list of undesignated symbols.
vector<symbol> undesignated;
// Check missing names for compatibility. // Check missing names for compatibility.
for (size_t j = 0; j < missing_names.size(); ++j) for (size_t j = 0; j < missing_names.size(); ++j)
{ {
...@@ -440,11 +442,41 @@ compare_symbols(const char* baseline_file, const char* test_file, ...@@ -440,11 +442,41 @@ compare_symbols(const char* baseline_file, const char* test_file,
for (size_t l = 0; l < added_size; ++l) for (size_t l = 0; l < added_size; ++l)
{ {
symbol& stest = test[added_names[l]]; symbol& stest = test[added_names[l]];
stest.status = symbol::added;
if (!check_version(stest, true)) // Mark TLS as undesignated, remove from added.
incompatible.push_back(symbol_pair(stest, stest)); if (stest.type == symbol::tls)
{
stest.status = symbol::undesignated;
if (!check_version(stest, false))
incompatible.push_back(symbol_pair(stest, stest));
else
undesignated.push_back(stest);
}
else
{
stest.status = symbol::added;
if (!check_version(stest, true))
incompatible.push_back(symbol_pair(stest, stest));
}
} }
// Normalize added names and undesignated names.
const size_t undesignated_size = undesignated.size();
for (size_t l = 0; l < undesignated_size; ++l)
{
symbol& sundes = undesignated[l];
symbol_names::iterator end = added_names.end();
symbol_names::iterator it = find(added_names.begin(), end, sundes.name);
if (it != end)
{
// Found.
added_names.erase(it);
}
else
__throw_runtime_error(sundes.name.c_str());
}
// Report results. // Report results.
if (verbose && added_names.size()) if (verbose && added_names.size())
{ {
...@@ -455,7 +487,7 @@ compare_symbols(const char* baseline_file, const char* test_file, ...@@ -455,7 +487,7 @@ compare_symbols(const char* baseline_file, const char* test_file,
test[added_names[j]].print(); test[added_names[j]].print();
} }
} }
if (verbose && missing_names.size()) if (verbose && missing_names.size())
{ {
cout << endl << missing_names.size() << " missing symbols " << endl; cout << endl << missing_names.size() << " missing symbols " << endl;
...@@ -465,7 +497,21 @@ compare_symbols(const char* baseline_file, const char* test_file, ...@@ -465,7 +497,21 @@ compare_symbols(const char* baseline_file, const char* test_file,
baseline[missing_names[j]].print(); baseline[missing_names[j]].print();
} }
} }
if (verbose && undesignated.size())
{
cout << endl << undesignated.size() << " undesignated symbols " << endl;
for (size_t j = 0; j < undesignated.size() ; ++j)
{
// First, print index.
cout << j << endl;
// Second, report name.
symbol& s = undesignated[j];
s.print();
}
}
if (verbose && incompatible.size()) if (verbose && incompatible.size())
{ {
cout << endl << incompatible.size() << " incompatible symbols " << endl; cout << endl << incompatible.size() << " incompatible symbols " << endl;
...@@ -478,16 +524,17 @@ compare_symbols(const char* baseline_file, const char* test_file, ...@@ -478,16 +524,17 @@ compare_symbols(const char* baseline_file, const char* test_file,
symbol& sbase = incompatible[j].first; symbol& sbase = incompatible[j].first;
symbol& stest = incompatible[j].second; symbol& stest = incompatible[j].second;
stest.print(); stest.print();
// Second, report reason or reasons incompatible. // Third, report reason or reasons incompatible.
check_compatible(sbase, stest, true); check_compatible(sbase, stest, true);
} }
} }
cout << "\n\t\t=== libstdc++-v3 check-abi Summary ===" << endl; cout << "\n\t\t=== libstdc++-v3 check-abi Summary ===" << endl;
cout << endl; cout << endl;
cout << "# of added symbols:\t\t " << added_names.size() << endl; cout << "# of added symbols:\t\t " << added_names.size() << endl;
cout << "# of missing symbols:\t\t " << missing_names.size() << endl; cout << "# of missing symbols:\t\t " << missing_names.size() << endl;
cout << "# of undesignated symbols:\t " << undesignated.size() << endl;
cout << "# of incompatible symbols:\t " << incompatible.size() << endl; cout << "# of incompatible symbols:\t " << incompatible.size() << endl;
cout << endl; cout << endl;
cout << "using: " << baseline_file << endl; cout << "using: " << baseline_file << endl;
...@@ -563,4 +610,3 @@ demangle(const std::string& mangled) ...@@ -563,4 +610,3 @@ demangle(const std::string& mangled)
} }
return name; return name;
} }
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