From e3419b4a6666e1a56a0b3d34449f8bd0f73b11a9 Mon Sep 17 00:00:00 2001 From: Andrey Ponomarenko Date: Thu, 28 Jan 2016 15:06:08 +0300 Subject: Do not check private part of the ABI. Fixed counting of checked data types. --- INSTALL | 21 ++++++++------- README | 16 +++++------ abi-compliance-checker.pl | 62 +++++++++++++++++++++++++++++++++--------- doc/Changelog.html | 21 +++++++++++++++ doc/index.html | 68 ++++++++++++++++++++++++++++------------------- 5 files changed, 129 insertions(+), 59 deletions(-) diff --git a/INSTALL b/INSTALL index a446c6c..6340ab6 100644 --- a/INSTALL +++ b/INSTALL @@ -2,15 +2,15 @@ Copyright (C) 2009-2011 Institute for System Programming, RAS Copyright (C) 2011-2012 Nokia Corporation and/or its subsidiary(-ies) Copyright (C) 2011-2012 ROSA Laboratory -Copyright (C) 2012-2015 Andrey Ponomarenko's ABI Laboratory +Copyright (C) 2012-2016 Andrey Ponomarenko's ABI Laboratory All rights reserved. RELEASE INFORMATION Project: ABI Compliance Checker (ACC) -Version: 1.99.15 -Date: 2015-12-11 +Version: 1.99.16 +Date: 2016-01-28 This file explains how to install and setup environment @@ -23,7 +23,7 @@ Content: 2. Requirements for Mac OS X 3. Requirements for MS Windows 4. Configure and Install - 5. Usage + 5. Usage (Original) 6. Usage with ABI Dumper @@ -34,6 +34,7 @@ Content: 2. GNU Binutils (c++filt, readelf, objdump) 3. Perl 5 (5.8 or newer) 4. Ctags (5.8 or newer) + 5. ABI Dumper (0.99.14 or newer) @@ -76,8 +77,8 @@ Content: -5. USAGE -======== +5. USAGE (ORIGINAL) +=================== Create XML-descriptors for two versions of a library (OLD.xml and NEW.xml): @@ -102,15 +103,15 @@ Content: abi-compliance-checker -lib NAME -old OLD.xml -new NEW.xml - For advanced usage, see doc/Readme.html or --help option. + For advanced usage, see doc/index.html or -help option. 6. USAGE WITH ABI DUMPER ======================== - Library should be compiled with -g - option to contain DWARF debug info. + Library should be compiled with -g -Og + options to contain DWARF debug info. Create ABI dumps for both library versions using the ABI Dumper tool (https://github.com/lvc/abi-dumper): @@ -118,7 +119,7 @@ Content: abi-dumper OLD.so -o ABI-0.dump -lver 0 abi-dumper NEW.so -o ABI-1.dump -lver 1 - Compare ABI dumps: + Compare ABI dumps to create report: abi-compliance-checker -l NAME -old ABI-0.dump -new ABI-1.dump diff --git a/README b/README index a859ae3..f0600a7 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ NAME: - ABI Compliance Checker (ACC) - a tool for checking backward binary and source-level compatibility of a C/C++ software library. + ABI Compliance Checker (ABICC) - a tool for checking backward binary and source-level compatibility of a C/C++ software library. The tool checks header files and shared objects of old and new versions and analyzes changes in API/ABI that may break binary and/or source compatibility: changes in calling stack, v-table changes, removed symbols, renamed fields, etc. @@ -15,8 +15,9 @@ REQUIRES: G++ GNU Binutils Ctags + ABI Dumper (0.99.14 or newer) -USAGE: +USAGE (ORIGINAL): abi-compliance-checker -lib NAME -old OLD.xml -new NEW.xml OLD.xml and NEW.xml are XML-descriptors: @@ -33,12 +34,6 @@ USAGE: /path/to/libraries/ -ADV. USAGE: - For advanced usage, see doc/Readme.html or output of --help option. - -COMPATIBILITY: - ABI Dumper >= 0.98 (https://github.com/lvc/abi-dumper) - USAGE WITH ABI DUMPER: 1. Library should be compiled with "-g -Og" GCC options @@ -50,6 +45,9 @@ USAGE WITH ABI DUMPER: abi-dumper OLD.so -o ABI-0.dump -lver 0 abi-dumper NEW.so -o ABI-1.dump -lver 1 - 3. Compare ABI dumps: + 3. Compare ABI dumps to create report: abi-compliance-checker -l NAME -old ABI-0.dump -new ABI-1.dump + +ADV. USAGE: + For advanced usage, see doc/index.html or output of -help option. diff --git a/abi-compliance-checker.pl b/abi-compliance-checker.pl index d10eb1d..a6ce328 100644 --- a/abi-compliance-checker.pl +++ b/abi-compliance-checker.pl @@ -1,12 +1,12 @@ #!/usr/bin/perl ########################################################################### -# ABI Compliance Checker (ABICC) 1.99.15 +# ABI Compliance Checker (ABICC) 1.99.16 # A tool for checking backward compatibility of a C/C++ library API # # Copyright (C) 2009-2011 Institute for System Programming, RAS # Copyright (C) 2011-2012 Nokia Corporation and/or its subsidiary(-ies) # Copyright (C) 2011-2012 ROSA Laboratory -# Copyright (C) 2012-2015 Andrey Ponomarenko's ABI Laboratory +# Copyright (C) 2012-2016 Andrey Ponomarenko's ABI Laboratory # # Written by Andrey Ponomarenko # @@ -21,6 +21,7 @@ # - GNU Binutils (readelf, c++filt, objdump) # - Perl 5 (5.8 or newer) # - Ctags (5.8 or newer) +# - ABI Dumper (0.99.14 or newer) # # Mac OS X # - Xcode (g++, c++filt, otool, nm) @@ -36,11 +37,6 @@ # - Add tool locations to the PATH environment variable # - Run vsvars32.bat (C:\Microsoft Visual Studio 9.0\Common7\Tools\) # -# COMPATIBILITY -# ============= -# ABI Dumper >= 0.99.12 -# -# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License or the GNU Lesser # General Public License as published by the Free Software Foundation. @@ -64,7 +60,7 @@ use Storable qw(dclone); use Data::Dumper; use Config; -my $TOOL_VERSION = "1.99.15"; +my $TOOL_VERSION = "1.99.16"; my $ABI_DUMP_VERSION = "3.2"; my $XML_REPORT_VERSION = "1.2"; my $XML_ABI_DUMP_VERSION = "1.2"; @@ -95,7 +91,7 @@ $SourceReportPath, $UseXML, $SortDump, $DumpFormat, $ExtraInfo, $ExtraDump, $Force, $Tolerance, $Tolerant, $SkipSymbolsListPath, $CheckInfo, $Quick, $AffectLimit, $AllAffected, $CppIncompat, $SkipInternalSymbols, $SkipInternalTypes, $TargetArch, $GccOptions, -$TypesListPath, $SkipTypesListPath); +$TypesListPath, $SkipTypesListPath, $CheckPrivateABI); my $CmdName = get_filename($0); my %OS_LibExt = ( @@ -256,6 +252,7 @@ GetOptions("h|help!" => \$Help, "all-affected!" => \$AllAffected, "skip-internal-symbols|skip-internal=s" => \$SkipInternalSymbols, "skip-internal-types=s" => \$SkipInternalTypes, + "check-private-abi!" => \$CheckPrivateABI ) or ERR_MESSAGE(); sub ERR_MESSAGE() @@ -757,6 +754,13 @@ OTHER OPTIONS: -skip-internal-types PATTERN Do not check types matched by the pattern. + + -check-private-abi + Check data types from the private part of the ABI when + comparing ABI dumps created by the ABI Dumper tool with + use of the -public-headers option. + + Requires ABI Dumper >= 0.99.14 REPORT: Compatibility report will be generated to: @@ -10507,6 +10511,11 @@ sub mergeVTables($) my $Level = $_[0]; foreach my $ClassName (keys(%{$VirtualTable{1}})) { + my $ClassId = $TName_Tid{1}{$ClassName}; + if(isPrivateABI($ClassId, 1)) { + next; + } + if($VTableChanged_M{$ClassName}) { # already registered next; @@ -10531,6 +10540,11 @@ sub mergeBases($) { # detect added and removed virtual functions my $ClassId = $TName_Tid{1}{$ClassName}; next if(not $ClassId); + + if(isPrivateABI($ClassId, 1)) { + next; + } + if(defined $VirtualTable{2}{$ClassName}) { foreach my $Symbol (keys(%{$VirtualTable{2}{$ClassName}})) @@ -10628,6 +10642,11 @@ sub mergeBases($) { my $ClassId_Old = $TName_Tid{1}{$ClassName}; next if(not $ClassId_Old); + + if(isPrivateABI($ClassId_Old, 1)) { + next; + } + if(not isCreatable($ClassId_Old, 1)) { # skip classes without public constructors (including auto-generated) # example: class has only a private exported or private inline constructor @@ -11401,6 +11420,21 @@ sub removeVPtr($) } } +sub isPrivateABI($$) +{ + my ($TypeId, $LibVersion) = @_; + + if($CheckPrivateABI) { + return 0; + } + + if(defined $TypeInfo{$LibVersion}{$TypeId}{"PrivateABI"}) { + return 1; + } + + return 0; +} + sub mergeTypes($$$) { my ($Type1_Id, $Type2_Id, $Level) = @_; @@ -11417,12 +11451,9 @@ sub mergeTypes($$$) return {}; } - $CheckedTypes{$Level}{$Type1{"Name"}} = 1; my %Type1_Pure = get_PureType($Type1_Id, $TypeInfo{1}); my %Type2_Pure = get_PureType($Type2_Id, $TypeInfo{2}); - $CheckedTypes{$Level}{$Type1_Pure{"Name"}} = 1; - if(defined $UsedDump{1}{"DWARF"}) { if($Type1_Pure{"Name"} eq "__unknown__" @@ -11432,6 +11463,13 @@ sub mergeTypes($$$) } } + if(isPrivateABI($Type1_Id, 1)) { + return {}; + } + + $CheckedTypes{$Level}{$Type1{"Name"}} = 1; + $CheckedTypes{$Level}{$Type1_Pure{"Name"}} = 1; + my %SubProblems = (); if($Type1_Pure{"Name"} eq $Type2_Pure{"Name"}) diff --git a/doc/Changelog.html b/doc/Changelog.html index 6ff72a6..507c04d 100644 --- a/doc/Changelog.html +++ b/doc/Changelog.html @@ -44,6 +44,27 @@


+Version 1.99.16 (January 28, 2016)
+Improvements +

+New Options + +Bug Fixes + +
+ Version 1.99.15 (December 11, 2015)
Bug Fixes - -

Tutorial

-An excellent tutorial "ABI: stability check" is available at Les RPM de Remi Blog. See also ABI compliance checker Notes at glibc wiki. -

-

Bugs

Please post bug reports, feature requests and questions to the issue tracker. -- cgit v1.2.3