buildsys: simplify abi-check

This commit is contained in:
Fabian Grünbichler 2017-03-24 12:48:31 +01:00
parent 2f2c243050
commit 9bdcd71386
2 changed files with 24 additions and 25 deletions

0
abi-blacklist Normal file
View File

View File

@ -1,12 +1,12 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
my $flavour = shift; my $abinew = shift;
my $prev_abinum = shift; my $abiold = shift;
my $abinum = shift;
my $prev_abidir = shift;
my $abidir = shift;
my $skipabi = shift; my $skipabi = shift;
$abinew =~ /abi-(.*)/;
my $abinum = $1;
my $fail_exit = 1; my $fail_exit = 1;
my $EE = "EE:"; my $EE = "EE:";
my $errors = 0; my $errors = 0;
@ -14,26 +14,25 @@ my $abiskip = 0;
my $count; my $count;
print "II: Checking ABI for $flavour...\n"; print "II: Checking ABI...\n";
if (-f "$prev_abidir/ignore" if ($skipabi) {
or -f "$prev_abidir/$flavour.ignore" or "$skipabi" eq "true") {
print "WW: Explicitly asked to ignore ABI, running in no-fail mode\n"; print "WW: Explicitly asked to ignore ABI, running in no-fail mode\n";
$fail_exit = 0; $fail_exit = 0;
$abiskip = 1; $abiskip = 1;
$EE = "WW:"; $EE = "WW:";
} }
if ($prev_abinum != $abinum) { #if ($prev_abinum != $abinum) {
print "II: Different ABI's, running in no-fail mode\n"; # print "II: Different ABI's, running in no-fail mode\n";
$fail_exit = 0; # $fail_exit = 0;
$EE = "WW:"; # $EE = "WW:";
} #}
#
if (not -f "$abidir/$flavour" or not -f "$prev_abidir/$flavour") { if (not -f "$abinew" or not -f "$abiold") {
print "EE: Previous or current ABI file missing!\n"; print "EE: Previous or current ABI file missing!\n";
print " $abidir/$flavour\n" if not -f "$abidir/$flavour"; print " $abinew\n" if not -f "$abinew";
print " $prev_abidir/$flavour\n" if not -f "$prev_abidir/$flavour"; print " $abiold\n" if not -f "$abiold";
# Exit if the ABI files are missing, but return status based on whether # Exit if the ABI files are missing, but return status based on whether
# skip ABI was indicated. # skip ABI was indicated.
@ -53,7 +52,7 @@ my %module_syms;
my $ignore = 0; my $ignore = 0;
print " Reading symbols/modules to ignore..."; print " Reading symbols/modules to ignore...";
for $file ("$prev_abidir/../blacklist", "$prev_abidir/../../perm-blacklist") { for $file ("abi-blacklist") {
if (-f $file) { if (-f $file) {
open(IGNORE, "< $file") or open(IGNORE, "< $file") or
die "Could not open $file"; die "Could not open $file";
@ -86,8 +85,8 @@ sub is_ignored($$) {
# Read new syms first # Read new syms first
print " Reading new symbols ($abinum)..."; print " Reading new symbols ($abinum)...";
$count = 0; $count = 0;
open(NEW, "< $abidir/$flavour") or open(NEW, "< $abinew") or
die "Could not open $abidir/$flavour"; die "Could not open $abinew";
while (<NEW>) { while (<NEW>) {
chomp; chomp;
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/; m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
@ -101,10 +100,10 @@ close(NEW);
print "read $count symbols.\n"; print "read $count symbols.\n";
# Now the old symbols, checking for missing ones # Now the old symbols, checking for missing ones
print " Reading old symbols ($prev_abinum)..."; print " Reading old symbols...";
$count = 0; $count = 0;
open(OLD, "< $prev_abidir/$flavour") or open(OLD, "< $abiold") or
die "Could not open $prev_abidir/$flavour"; die "Could not open $abiold";
while (<OLD>) { while (<OLD>) {
chomp; chomp;
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/; m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
@ -146,8 +145,8 @@ foreach $sym (keys(%symbols)) {
} }
print " " if $count; print " " if $count;
print "found $count new symbols\n"; print "found $count new symbols\n";
if ($count and $prev_abinum == $abinum) { if ($count) {
print "WW: Found new symbols within same ABI. Not recommended\n"; print "WW: Found new symbols. Not recommended unless ABI was bumped\n";
} }
print "II: Checking for changes to ABI...\n"; print "II: Checking for changes to ABI...\n";