Date: Sun, 23 Aug 2009 09:47:20 GMT From: bf <bf1783@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/138094: [NEW PORT]devel/abi-compliance-checker : a utility to detect ABI changes in shared libraries Message-ID: <200908230947.n7N9lKEV075959@www.freebsd.org> Resent-Message-ID: <200908230950.n7N9o5Rv070276@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 138094 >Category: ports >Synopsis: [NEW PORT]devel/abi-compliance-checker : a utility to detect ABI changes in shared libraries >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Aug 23 09:50:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: bf >Release: 8-CURRENT amd64 >Organization: - >Environment: >Description: This is a perl script, written by Andrey Ponomarenko or the Institute for System Programming of Russian Academy of Sciences (ISP RAS), that uses components of binutils and gcc to detect ABI changes in two different versions of a C/C++ shared library. I've patched it to fix a few of the more glaring grammar/spelling errors, and I plan to clean it up more later, but I'd like to make it available in the meantime. >How-To-Repeat: >Fix: Patch attached with submission follows: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # abi-compliance-checker # abi-compliance-checker/pkg-descr # abi-compliance-checker/Makefile # abi-compliance-checker/distinfo # abi-compliance-checker/files # abi-compliance-checker/files/patch-abi-compliance-checker.pl # echo c - abi-compliance-checker mkdir -p abi-compliance-checker > /dev/null 2>&1 echo x - abi-compliance-checker/pkg-descr sed 's/^X//' >abi-compliance-checker/pkg-descr << '7f914954f7bb9b2f92545d4fd25ddf48' XGiven the header files and shared objects corresponding to two different shared Xlibrary versions, and a simple description of each of the shared libraries in XXML format, abi-compliance-checker searches for the following kinds of binary Xcompatibility problems: X X--Added/withdrawn interfaces (functions, global variables) X--Problems in Data Types: X --Classes: added/withdrawn virtual functions (changes in layout of X virtual table), virtual function positions, virtual function X redefinitions X --Structural data types: added/withdrawn members (changes in layout of X type structure), X changes in members, size changes X --Enumerations: member value changes X--Interface problems: X --Parameters and return type changes X --Static property changes X XThe checker then generates a report that assesses the risks of any potential Xproblems detected. X XWWW: http://ispras.linux-foundation.org/index.php/ABI_compliance_checker 7f914954f7bb9b2f92545d4fd25ddf48 echo x - abi-compliance-checker/Makefile sed 's/^X//' >abi-compliance-checker/Makefile << '4cfb85f0acba1edbf51fe19ca3a02e9e' X# New ports collection makefile for: abi-compliance-checker X# Date created: August 21, 2009 X# Whom: bf <bf1783@gmail.com> X# X# $FreeBSD$ X# X XPORTNAME= abi-compliance-checker XPORTVERSION= 1.4 XCATEGORIES= devel perl5 XMASTER_SITES= http://ispras.linux-foundation.org/images/c/c1/ XDISTFILES= ${PORTNAME:S/^a/A/}-${PORTVERSION}${EXTRACT_SUFX} X XMAINTAINER= bf1783@gmail.com XCOMMENT= Checks binary compatibility of two versions of a C/C++ shared library X XNO_BUILD= yes XUSE_PERL5_RUN= yes X XPLIST_FILES= bin/${PORTNAME}.pl X XCPPFILT?= c++filt XREADELF?= readelf X Xpost-patch: X ${REINPLACE_CMD} -e "s|c++filt|${CPPFILT}|g" \ X -e "s|readelf|${READELF}|g" -e "s|g++|${CXX}|g" \ X -e "s|\"gcc|\"${CC}|g" -e "s|-shared|& -fPIC|g" ${WRKSRC}/${PORTNAME}.pl X Xdo-install: X @${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME}.pl ${PREFIX}/bin X Xregression-test: build X @(cd ${WRKSRC} && ./${PORTNAME}.pl -test ) X X.include <bsd.port.mk> 4cfb85f0acba1edbf51fe19ca3a02e9e echo x - abi-compliance-checker/distinfo sed 's/^X//' >abi-compliance-checker/distinfo << 'eb19074df10da556d6c05076aa3077e5' XMD5 (Abi-compliance-checker-1.4.tar.gz) = da40b6a17ed0fbe5316f782c775cfd24 XSHA256 (Abi-compliance-checker-1.4.tar.gz) = 5ee303b7c700925758d50a14516ad8e29b6272c71e1cdf494057f72939190a62 XSIZE (Abi-compliance-checker-1.4.tar.gz) = 43856 eb19074df10da556d6c05076aa3077e5 echo c - abi-compliance-checker/files mkdir -p abi-compliance-checker/files > /dev/null 2>&1 echo x - abi-compliance-checker/files/patch-abi-compliance-checker.pl sed 's/^X//' >abi-compliance-checker/files/patch-abi-compliance-checker.pl << 'cab1e2035d429d46427bfda7fc3d7419' X--- abi-compliance-checker.pl.orig 2009-08-18 14:29:08.000000000 -0400 X+++ abi-compliance-checker.pl 2009-08-23 05:20:10.000000000 -0400 X@@ -276,7 +276,7 @@ X my $LibVersion = $_[0]; X if(not -e $Descriptor{$LibVersion}{'Path'}) X { X- print "descriptor d$LibVersion does not exists, incorrect file path $Descriptor{$LibVersion}{'Path'}\n"; X+ print "descriptor d$LibVersion does not exist: incorrect file path $Descriptor{$LibVersion}{'Path'}\n"; X exit(0); X } X my $Descriptor_File = `cat $Descriptor{$LibVersion}{'Path'}`; X@@ -2470,7 +2470,7 @@ X system("g++ >header_compile_errors/$TargetLibraryName/$Descriptor{$Version}{'Version'} 2>&1 -fdump-translation-unit temp/$Lib_VersionName.h $CompilerOptions{$Version} $AddOpt"); X if($?) X { X- print "WARNING: some errors have occured while headers compilation\nyou can see compilation errors in the file header_compile_errors/$TargetLibraryName/$Descriptor{$Version}{'Version'}\n"; X+ print "WARNING: some errors have occured while compiling header(s)\nyou can see compilation errors in the file header_compile_errors/$TargetLibraryName/$Descriptor{$Version}{'Version'}\n"; X } X `mv -f $Lib_VersionName.h*.tu temp/`; X return (split("\n", `find temp -maxdepth 1 -name "$Lib_VersionName\.h*\.tu"`))[0]; X@@ -2565,13 +2565,13 @@ X sub parseHeaders_AllInOne($) X { X $Version = $_[0]; X- print "headers checking v$Descriptor{$Version}{'Version'} ...\n"; X+ print "checking header(s) v$Descriptor{$Version}{'Version'} ...\n"; X `mkdir -p header_compile_errors/$TargetLibraryName/`; X `rm -fr header_compile_errors/$TargetLibraryName/$Descriptor{$Version}{'Version'}`; X my $DumpPath = getDump_AllInOne(); X if(not $DumpPath) X { X- print "\nERROR: can't create gcc syntax tree for headers\nyou can see compilation errors in the file header_compile_errors/$TargetLibraryName/$Descriptor{$Version}{'Version'}\n"; X+ print "\nERROR: can't create gcc syntax tree for header(s)\nyou can see compilation errors in the file header_compile_errors/$TargetLibraryName/$Descriptor{$Version}{'Version'}\n"; X exit(1); X } X getInfo($DumpPath); X@@ -4306,7 +4306,7 @@ X X sub testSystem_cpp() X { X- print "testing on C++ library changes\n"; X+ print "testing for C++ library changes\n"; X my @DataDefs_v1 = (); X my @Sources_v1 = (); X my @DataDefs_v2 = (); X@@ -4690,7 +4690,7 @@ X X sub testSystem_c() X { X- print "\ntesting on C library changes\n"; X+ print "\ntesting for C library changes\n"; X my @DataDefs_v1 = (); X my @Sources_v1 = (); X my @DataDefs_v2 = (); X@@ -5448,27 +5448,27 @@ X elsif($Kind eq "Return_Type_And_Size") X { X $Incompatibility = "Type of return value has been changed from <span style='white-space:nowrap;'><b>$Old_Value</b> (<b>$Old_Size</b> bytes)</span> to <span style='white-space:nowrap;'><b>$New_Value</b> (<b>$New_Size</b> bytes)</span>\n"; X- $Effect = "Applications will have got different return value and it's execution may change"; X+ $Effect = "Applications will get a different return value and execution may change"; X } X elsif($Kind eq "Return_Type") X { X $Incompatibility = "Type of return value has been changed from <span style='white-space:nowrap;'><b>$Old_Value</b></span> to <span style='white-space:nowrap;'><b>$New_Value</b></span>\n"; X- $Effect = "Applications will have got different return value and it's execution may change"; X+ $Effect = "Applications will get a different return value and execution may change"; X } X elsif($Kind eq "Return_BaseType") X { X $Incompatibility = "Base type of return value has been changed from <span style='white-space:nowrap;'><b>$Old_Value</b> (<b>$Old_Size</b> bytes)</span> to <span style='white-space:nowrap;'><b>$New_Value</b> (<b>$New_Size</b> bytes)</span>\n"; X- $Effect = "Applications will have got different return value and it's execution may change"; X+ $Effect = "Applications will get a different return value and execution may change"; X } X elsif($Kind eq "Return_PointerLevel_And_Size") X { X $Incompatibility = "Type pointer level of return value has been changed from <b>$Old_Value</b> to <b>$New_Value</b> and size of type has been changed from <b>$Old_Size</b> bytes to <b>$New_Size</b> bytes\n"; X- $Effect = "Applications will have got different return value and it's execution may change"; X+ $Effect = "Applications will get a different return value and execution may change"; X } X elsif($Kind eq "Return_PointerLevel") X { X $Incompatibility = "Type pointer level of return value has been changed from <b>$Old_Value</b> to <b>$New_Value</b>\n"; X- $Effect = "Applications will have got different return value and it's execution may change"; X+ $Effect = "Applications will get a different return value and execution may change"; X } X if($Incompatibility) X { X@@ -6056,7 +6056,7 @@ X my @SoLibPaths = getSoPaths($LibVersion); X if($#SoLibPaths eq -1) X { X- print "ERROR: there are no any shared objects in specified paths in library descriptor d$LibVersion\n"; X+ print "ERROR: there are no shared objects in the paths specified in library descriptor d$LibVersion\n"; X exit(1); X } X foreach my $SoLibPath (@SoLibPaths) X@@ -6436,7 +6436,7 @@ X system("cd $InfoDump_FilePath/ && tar -cf $InfoDump_FileName".".tar $InfoDump_FileName"); X system("cd $InfoDump_FilePath/ && gzip $InfoDump_FileName".".tar --best"); X `rm -f $InfoDump_FilePath/$InfoDump_FileName`; X- print "see library info dump in $InfoDump_FilePath/$InfoDump_FileName.tar.gz and use it instead of library version descriptor on other machine\n"; X+ print "see library info dump in $InfoDump_FilePath/$InfoDump_FileName.tar.gz: use it instead of library version descriptor on other machine\n"; X exit(0); X } X X@@ -6487,15 +6487,15 @@ X parseHeaders_AllInOne(2); X } X X- print "headers comparison ...\n"; X+ print "comparing headers ...\n"; X mergeHeaders(); X } X X #LIBS MERGING X- print "shared objects comparison ...\n"; X+ print "comparing shared objects ...\n"; X mergeLibs(); X X- print "ABI compliance report drawing ...\n"; X+ print "creating ABI compliance report ...\n"; X create_HtmlReport(); X X if($HeaderCheckingMode_Separately) cab1e2035d429d46427bfda7fc3d7419 exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908230947.n7N9lKEV075959>