Hello community, here is the log from the commit of package abi-dumper for openSUSE:Factory checked in at 2017-09-05 15:16:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/abi-dumper (Old) and /work/SRC/openSUSE:Factory/.abi-dumper.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "abi-dumper" Tue Sep 5 15:16:01 2017 rev:2 rq:520532 version:1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/abi-dumper/abi-dumper.changes 2017-07-08 12:34:51.986501710 +0200 +++ /work/SRC/openSUSE:Factory/.abi-dumper.new/abi-dumper.changes 2017-09-05 15:16:05.357907265 +0200 @@ -1,0 +2,11 @@ +Sun Sep 3 18:55:56 UTC 2017 - astieger@suse.com + +- update to 1.1: + * Support for compressing of ABI dumps before writing to drive + from RAM + * Fix analysis of inline functions (WARNING: old dumps should be + regenerated before comparing by ABICC) + * Deny analysis of static libraries + * Bumped ABI dump version + +------------------------------------------------------------------- Old: ---- abi-dumper-1.0.tar.gz New: ---- abi-dumper-1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ abi-dumper.spec ++++++ --- /var/tmp/diff_new_pack.2r2p6q/_old 2017-09-05 15:16:07.069666654 +0200 +++ /var/tmp/diff_new_pack.2r2p6q/_new 2017-09-05 15:16:07.073666092 +0200 @@ -17,7 +17,7 @@ Name: abi-dumper -Version: 1.0 +Version: 1.1 Release: 0 Summary: Tool to dump ABI of an ELF object containing DWARF debug info License: GPL-2.0+ OR LGPL-2.1+ ++++++ abi-dumper-1.0.tar.gz -> abi-dumper-1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/abi-dumper-1.0/INSTALL new/abi-dumper-1.1/INSTALL --- old/abi-dumper-1.0/INSTALL 2017-06-17 06:03:10.000000000 +0200 +++ new/abi-dumper-1.1/INSTALL 2017-08-30 07:17:09.000000000 +0200 @@ -6,8 +6,8 @@ RELEASE INFORMATION Project: ABI Dumper -Version: 1.0 -Date: June 17, 2017 +Version: 1.1 +Date: August 30, 2017 This file explains how to install and setup environment diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/abi-dumper-1.0/README new/abi-dumper-1.1/README --- old/abi-dumper-1.0/README 2017-06-17 06:03:10.000000000 +0200 +++ new/abi-dumper-1.1/README 2017-08-30 07:17:09.000000000 +0200 @@ -1,4 +1,4 @@ -ABI Dumper 1.0 +ABI Dumper 1.1 ============== NAME: @@ -41,7 +41,7 @@ abi-compliance-checker -l libTest -old ABIv0.dump -new ABIv1.dump COMPATIBILITY: - ABI Compliance Checker >= 1.99.24 (https://github.com/lvc/abi-compliance-checker) + ABI Compliance Checker >= 2.2 (https://github.com/lvc/abi-compliance-checker) ADV. USAGE: For advanced usage, see output of --help option. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/abi-dumper-1.0/abi-dumper.pl new/abi-dumper-1.1/abi-dumper.pl --- old/abi-dumper-1.0/abi-dumper.pl 2017-06-17 06:03:10.000000000 +0200 +++ new/abi-dumper-1.1/abi-dumper.pl 2017-08-30 07:17:09.000000000 +0200 @@ -1,6 +1,6 @@ #!/usr/bin/perl ########################################################################### -# ABI Dumper 1.0 +# ABI Dumper 1.1 # Dump ABI of an ELF object containing DWARF debug info # # Copyright (C) 2013-2017 Andrey Ponomarenko's ABI Laboratory @@ -22,7 +22,7 @@ # # COMPATIBILITY # ============= -# ABI Compliance Checker >= 1.99.24 +# ABI Compliance Checker >= 2.2 # # # This program is free software: you can redistribute it and/or modify @@ -46,8 +46,8 @@ use Storable qw(dclone); use Data::Dumper; -my $TOOL_VERSION = "1.0"; -my $ABI_DUMP_VERSION = "3.4"; +my $TOOL_VERSION = "1.1"; +my $ABI_DUMP_VERSION = "3.5"; my $ORIG_DIR = cwd(); my $TMP_DIR = tempdir(CLEANUP=>1); @@ -476,6 +476,9 @@ # Filter my %SymbolsList; +# Dump +my $COMPRESS = "tar.gz"; + sub printMsg($$) { my ($Type, $Msg) = @_; @@ -557,6 +560,10 @@ return ""; } +sub sepPath($) { + return (getDirname($_[0]), getFilename($_[0])); +} + sub checkCmd($) { my $Cmd = $_[0]; @@ -1952,6 +1959,34 @@ } } +sub createArchive($$) +{ + my ($Path, $To) = @_; + if(not $To) { + $To = "."; + } + + if(not checkCmd("tar")) { + exitStatus("Not_Found", "can't find \"tar\""); + } + if(not checkCmd("gzip")) { + exitStatus("Not_Found", "can't find \"gzip\""); + } + + my ($From, $Name) = sepPath($Path); + my $Pkg = abs_path($To)."/".$Name.".".$COMPRESS; + if(-e $Pkg) { + unlink($Pkg); + } + system("tar", "-C", $From, "-czf", $Pkg, $Name); + if($?) + { # cannot allocate memory (or other problems with "tar") + exitStatus("Error", "can't pack the ABI dump: ".$!); + } + unlink($Path); + return $To."/".$Name.".".$COMPRESS; +} + sub createABIFile() { printMsg("INFO", "Creating ABI dump"); @@ -2002,13 +2037,33 @@ } else { - mkpath(getDirname($OutputDump)); + my $DumpPath = "ABI.dump"; + if($OutputDump) + { # user defined path + $DumpPath = $OutputDump; + } + my $Archive = ($DumpPath=~s/\Q.$COMPRESS\E\Z//g); + my ($DDir, $DName) = sepPath($DumpPath); - open(DUMP, ">", $OutputDump) || die ("can't open file \'$OutputDump\': $!\n"); + my $DPath = $TMP_DIR."/".$DName; + if(not $Archive) { + $DPath = $DumpPath; + } + + mkpath($DDir); + + open(DUMP, ">", $DPath) || die ("can't open file \'$DumpPath\': $!\n"); print DUMP Dumper(\%ABI); close(DUMP); - printMsg("INFO", "\nThe object ABI has been dumped to:\n $OutputDump"); + if(not -s $DPath) { + exitStatus("Error", "can't create ABI dump because something is going wrong with the Data::Dumper module"); + } + if($Archive) { + $DumpPath = createArchive($DPath, $DDir); + } + + printMsg("INFO", "\nThe object ABI has been dumped to:\n $DumpPath"); } } @@ -2847,30 +2902,10 @@ } } - if(defined $PublicHeadersPath) + if($Bind ne "GLOBAL" and $Bind ne "LOCAL") { - my $BodyDecl_H = 0; - - if($Short and defined $Header and defined $SymbolToHeader{$Short} - and defined $SymbolToHeader{$Short}{$Header} - and $SymbolToHeader{$Short}{$Header} eq "function") { - $BodyDecl_H = 1; - } - - if($Bind ne "GLOBAL") - { - if($InLineDecl) { - $SInfo->{"InLine"} = 1; - } - elsif($BodyDecl_H) { - $SInfo->{"InLine"} = 2; - } - } - } - else - { # Not enough info in the DWARF dump - # False positives are possible - if((not $FKeepInLine and not defined $Bind) or $Bind eq "WEAK") + # Not enough info in the DWARF dump + if($Bind eq "WEAK") { if($InLineDecl) { $SInfo->{"InLine"} = 1; @@ -2879,6 +2914,24 @@ $SInfo->{"InLine"} = 2; } } + + #if(not $SInfo->{"InLine"}) + #{ + # if(defined $PublicHeadersPath) + # { + # if($Short and defined $Header + # and defined $PublicHeader{$Header}) + # { + # if(defined $SymbolToHeader{$Short} + # and defined $SymbolToHeader{$Short}{$Header}) + # { + # if($SymbolToHeader{$Short}{$Header} eq "function") { + # $SInfo->{"InLine"} = 2; + # } + # } + # } + # } + #} } } @@ -5020,8 +5073,18 @@ { if($MnglName and index($MnglName, "_Z")!=0) { - if(keys(%{$SInfo{"Param"}})!=keys(%{$SymbolInfo{$BASE_ID}{"Param"}})) + my $DifferentParams = (keys(%{$SInfo{"Param"}})!=keys(%{$SymbolInfo{$BASE_ID}{"Param"}})); + if($DifferentParams or keys(%{$SInfo{"Param"}})==1) { # different symbols with the same name + if(defined $SInfo{"Param"} + and $SInfo{"Param"}{0}{"type"}=="-1") + { # missed signature (...) + return; + } + } + + if($DifferentParams) + { # take the last one delete($SymbolInfo{$BASE_ID}); } } @@ -6366,7 +6429,7 @@ my @Func = ($Content=~/([a-zA-Z]\w+)\s*\(/g); foreach (@Func) { - if(not defined $SymbolToHeader{$_}) { + if(not defined $SymbolToHeader{$_} or not defined $SymbolToHeader{$_}{$HName}) { $SymbolToHeader{$_}{$HName} = "prototype"; } } @@ -6375,7 +6438,7 @@ my @Data = ($Content=~/([a-zA-Z_]\w+)\s*;/gi); foreach (@Data) { - if(not defined $SymbolToHeader{$_}) { + if(not defined $SymbolToHeader{$_} or not defined $SymbolToHeader{$_}{$HName}) { $SymbolToHeader{$_}{$HName} = "prototype"; } } @@ -6387,7 +6450,7 @@ my @Type2 = ($Content=~/([a-zA-Z]\w+)\s*{/g); foreach (@Type1, @Type2) { - if(not defined $TypeToHeader{$_}) { + if(not defined $TypeToHeader{$_} or not defined $TypeToHeader{$_}{$HName}) { $TypeToHeader{$_}{$HName} = 1; } } @@ -6607,6 +6670,10 @@ foreach my $Obj (@ARGV) { + if($Obj=~/\.a\Z/) { + exitStatus("Error", "analysis of static libraries is not supported, please dump ABIs of individual objects in the archive or compile a shared library"); + } + if(not $TargetName) { $TargetName = getFilename(realpath($Obj));