tools/summarise_gcc_errors.pl
author William Roberts <williamr@symbian.org>
Mon, 26 Jul 2010 11:39:25 +0100
changeset 11 3dcb71781467
parent 10 375cb23d95ba
permissions -rw-r--r--
Various tweaks to the summarising tools
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
#! perl
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# Copyright (c) 2010 Symbian Foundation Ltd
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
#
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
# 
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
# Contributors:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
#
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# Description:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
# Perl script to summarise GCC logs
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
use strict;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
use Getopt::Long;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
sub Usage($)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
  {
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
  my ($msg) = @_;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
  print "$msg\n\n" if ($msg ne "");
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	print <<'EOF';
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
summarise_gcc_errors.pl - simple script for analysing gcc error logs
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
	
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
This script will read a collection of GCC output logs and summarise
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
the error messages in various useful ways.
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
Options:
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
-warnings      process warnings as well as errors
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
-verbose       list the files associated with each error
11
3dcb71781467 Various tweaks to the summarising tools
William Roberts <williamr@symbian.org>
parents: 10
diff changeset
    36
-notfound      process "no such file" errors as well as compilation errors
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
EOF
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
  exit (1);  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
  }
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
my $warnings = 0;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
my $verbose = 0;
11
3dcb71781467 Various tweaks to the summarising tools
William Roberts <williamr@symbian.org>
parents: 10
diff changeset
    44
my $notfound = 0;
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
# Analyse the rest of command-line parameters
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
if (!GetOptions(
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
    "w|warnings" => \$warnings,
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
    "v|verbose" => \$verbose,
11
3dcb71781467 Various tweaks to the summarising tools
William Roberts <williamr@symbian.org>
parents: 10
diff changeset
    50
    "notfound" => \$notfound,
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
    ))
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
  {
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
  Usage("Invalid argument");
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
  }
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    55
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    56
my $current_package = ""; 
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    57
my $current_mmp = ""; 
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    58
my $saved_filename = "";
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    59
my $current_link_target;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    60
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
my %files;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
my %errors_by_file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
my %error_count_by_file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
my %errors;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
my %message_ids;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
my %files_by_message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
my %messages_by_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
my %unique_message_counts;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
my %all_message_counts;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
my $next_message_id = 1;
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    71
my %packages_by_file;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    72
my %package_count_by_file;
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    73
my %missing_ELF_symbol;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    74
my %missing_export;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    75
my %excess_export;
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    76
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    77
sub handle_message($$$$$)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    78
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    79
	my ($package,$filename,$lineno,$messagetype,$message) = @_;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    80
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    81
	my $generic_message = "$messagetype: $message";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    82
	$generic_message =~ s/'offsetof'/"offsetof"/;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    83
	$generic_message =~ s/'([^a-zA-Z])'/"\1"/g;	# don't catch ';' in next substitution
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    84
	$generic_message =~ s/['`][^']+'/XX/g;	# suppress quoted bits of the actual instance
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    85
	$generic_message =~ s/pasting ""(.*)"" and ""(.*)""/pasting XX and YY/g;	# suppress detail of "pasting" error
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    86
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    87
	my $message_id = $next_message_id;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    88
	if (!defined $message_ids{$generic_message})
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    89
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    90
		$next_message_id++;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    91
		$message_ids{$generic_message} = $message_id;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    92
		$messages_by_id{$message_id} = $generic_message;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    93
		$all_message_counts{$message_id} = 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    94
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    95
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    96
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    97
		$message_id = $message_ids{$generic_message};
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    98
		$all_message_counts{$message_id} += 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    99
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   100
	my $instance = sprintf("%s:%d: %s-#%d", $filename, $lineno, $messagetype, $message_id);
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   101
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   102
	my $packages = $packages_by_file{$filename};
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   103
	if (!defined $packages)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   104
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   105
		$packages_by_file{$filename} = "\t$package\t";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   106
		$package_count_by_file{$filename} = 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   107
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   108
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   109
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   110
		if (index($packages,"\t$package\t") < 0)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   111
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   112
			$packages_by_file{$filename} .= "\t$package\t";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   113
			$package_count_by_file{$filename} += 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   114
			}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   115
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   116
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   117
	if (defined $files{$instance})
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   118
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   119
		# already seen this one
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   120
		return;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   121
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   122
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   123
	if (!defined $unique_message_counts{$message_id})
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   124
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   125
		$unique_message_counts{$message_id} = 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   126
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   127
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   128
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   129
		$unique_message_counts{$message_id} += 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   130
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   131
	$files{$instance} = $message;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   132
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   133
	if (!defined $files_by_message_id{$message_id})
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   134
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   135
		$files_by_message_id{$message_id} = $filename;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   136
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   137
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   138
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   139
		$files_by_message_id{$message_id} .= "\n$filename";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   140
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   141
			
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   142
	my $error = sprintf "%-5d: %s: %s", $lineno, $messagetype, $message;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   143
	if (!defined $errors_by_file{$filename})
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   144
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   145
		$errors_by_file{$filename} = $error;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   146
		$error_count_by_file{$filename} = 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   147
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   148
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   149
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   150
		$errors_by_file{$filename} .= "\n$error";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   151
		$error_count_by_file{$filename} += 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   152
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   153
	}
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   155
my $line;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   156
while ($line = <>)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   157
	{
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   158
	# </pre>os/usb, usb_CompilerCompatibility.005, SF_builds/usb/builds/CompilerCompatibility/usb_CompilerCompatibility.005/html/os_usb_failures.html
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   159
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   160
	if ($line =~/\/html\/([^\/]+)_failures.html/)
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   161
		{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   162
		$current_package = $1;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   163
		$current_package =~ s/_/\//;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   164
		next;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   165
		}
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   166
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   167
	# <recipe ... bldinf='M:/sf/os/bt/atext/group/bld.inf' ...
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   168
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   169
	if ($line =~ /^<recipe/o)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   170
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   171
		if ($line =~ / bldinf='..(\S+)' mmp='..(\S+)'/)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   172
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   173
			my $bldinf = $1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   174
			$current_mmp = $2;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   175
			my ($root, $sf, $layer, $package, @rest) = split /\//, $bldinf;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   176
			$current_package = "$layer/$package";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   177
			}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   178
		next;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   179
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   180
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   181
	# remember context from various commands
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   182
  if (substr($line,0,1) eq "+")
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   183
  	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   184
		if ($line =~ /g\+\+\.exe .* -o (\S+)\.sym /oi)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   185
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   186
			$current_link_target = $1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   187
			next;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   188
			}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   189
		if ($line =~ /^elf2e32.exe .* --output=(\S+) /oi)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   190
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   191
			$current_link_target = $1;	# admittedly an E32 image file, but never mind...
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   192
			next;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   193
			}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   194
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   195
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   196
	# M:/sf/os/kernelhwsrv/kernel/eka/drivers/soundsc/soundldd.cpp:2927: undefined reference to `__aeabi_uidiv'
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   197
  # M:/epoc32/build/rawipnif/c_6f716cf505597250/rawip_dll/armv5/udeb/rawipmcpr.o:(.rodata+0x258): undefined reference to `non-virtual thunk to CAgentMetaConnectionProvider::GetIntSettingL(TDesC16 const&, unsigned long&, ESock::MPlatsecApiExt*)'
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   198
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   199
	# M:/epoc32/include/elements/nm_interfaces.h:255: warning: dereferencing type-punned pointer will break strict-aliasing rules
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   200
	# M:/epoc32/include/f32file.h:2169: warning: invalid access to non-static data member 'TVolFormatParam::iUId'  of NULL object
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   201
	# M:/epoc32/include/f32file.h:2169: warning: (perhaps the 'offsetof' macro was used incorrectly)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   202
	# M:/epoc32/include/comms-infras/ss_nodemessages.h:301: error: wrong number of template arguments (3, should be 4)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   203
	# M:/epoc32/include/elements/nm_signatures.h:496: error: provided for 'template<class TSIGNATURE, int PAYLOADATTRIBOFFSET, class TATTRIBUTECREATIONPOLICY, int PAYLOADBUFFERMAXLEN> class Messages::TSignatureWithPolymorphicPayloadMetaType'
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   204
	# M:/epoc32/include/comms-infras/ss_nodemessages.h:301: error: invalid type in declaration before ';' token
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   205
	
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   206
	if ($line =~ /(^...*):(\d+|\(\S+\)): (([^:]+): )?(.*)$/)
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   207
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   208
		my $filename = $1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   209
		my $lineno = $2;
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   210
		my $messagetype = $4;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   211
		my $message = $5;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   212
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   213
		$filename =~ s/^.://;		# remove drive letter
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   214
		
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   215
		$message =~ s/&amp;/&/g;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   216
		$message =~ s/&gt;/>/g;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   217
		$message =~ s/&lt;/</g;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   218
		$message =~ s/&#39;/'/g;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   219
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   220
		if ($messagetype eq "")
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   221
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   222
			if ($message =~ /^undefined reference to .([^\']+).$/)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   223
				{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   224
				my $symbol = $1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   225
  			$missing_ELF_symbol{"$current_package\t$filename $lineno\t$symbol\timpacts $current_link_target"} = 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   226
				$messagetype = "error";  # linker error, fall through to the rest of the processing
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   227
				}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   228
			else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   229
				{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   230
				next;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   231
				}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   232
			}
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   233
		# Heuristic for guessing the problem file for assembler issues
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   234
		# 
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   235
		if ($filename =~ /\\TEMP\\/i)
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   236
			{
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   237
			$filename = $saved_filename;
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   238
			$lineno = 0;
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   239
			}
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   240
		else
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   241
			{
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   242
			$saved_filename = $filename;
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   243
			}
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   244
		
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   245
		if ($messagetype eq "note")
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   246
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   247
			next;		# ignore notes
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   248
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   249
		if ($messagetype eq "warning" && !$warnings)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   250
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   251
			next;		# ignore warnings
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   252
			}
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   253
		if ($messagetype eq "Warning" && $message =~ /No relevant classes found./)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   254
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   255
			next;		# ignore Qt code generation warnings
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   256
			}
11
3dcb71781467 Various tweaks to the summarising tools
William Roberts <williamr@symbian.org>
parents: 10
diff changeset
   257
		if ($message =~ /.*: No such file/ && !$notfound)
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   258
			{
11
3dcb71781467 Various tweaks to the summarising tools
William Roberts <williamr@symbian.org>
parents: 10
diff changeset
   259
			next;		# ignore "no such file", as these aren't likely to be GCC-specific
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   260
			}
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   261
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   262
		handle_message($current_package,$filename,$lineno,$messagetype,$message);	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   263
		next;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   264
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   265
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   266
  # Error: unrecognized option -mapcs
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   267
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   268
	if ($line =~ /^Error: (.*)$/)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   269
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   270
		my $message = $1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   271
		handle_message($current_package,$current_mmp,0,"Error",$message);	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   272
		next;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   273
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   274
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   275
	# Elf2e32: Warning: New Symbol _ZN15DMMCMediaChangeC1Ei found, export(s) not yet Frozen
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   276
	# elf2e32 : Error: E1036: Symbol _ZN21CSCPParamDBControllerD0Ev,_ZN21CSCPParamDBControllerD1Ev,_ZN21CSCPParamDBControllerD2Ev Missing from ELF File : M:/epoc32/release/armv5/udeb/scpdatabase.dll.sym.
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   277
  # elf2e32 : Error: E1053: Symbol _Z24ImplementationGroupProxyRi passed through '--sysdef' option is not at the specified ordinal in the DEF file M:/sf/mw/svgt/svgtopt/svgtplugin/BWINSCW/NPSVGTPLUGINu.DEF.
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   278
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   279
	if ($line =~ /^elf2e32 ?: ([^:]+): (.*)$/oi)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   280
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   281
		my $messagetype = $1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   282
		my $message = $2;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   283
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   284
		$message =~ s/&amp;/&/g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   285
		$message =~ s/&gt;/>/g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   286
		$message =~ s/&lt;/</g;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   287
		
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   288
		if ($message =~ /E1036: Symbol (\S+) Missing from ELF File : (.*)\.sym/i)
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   289
			{
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   290
			my $symbol_list = $1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   291
			my $linktarget = $2;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   292
			
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   293
			foreach my $symbol (split /,/, $symbol_list)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   294
				{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   295
				$missing_export{"$current_package\t???\t$symbol\timpacts $linktarget"} = 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   296
	  		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   297
			next;	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   298
			}	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   299
		
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   300
		if ($message =~ /New Symbol (\S+) found, export.s. not yet Frozen/oi)
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   301
			{
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   302
			my $symbol = $1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   303
	  	$excess_export{"$current_package\t???\t$symbol\textra in $current_link_target"} = 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   304
	  	next;
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   305
			}
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   306
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   307
    # Symbol _Z24ImplementationGroupProxyRi passed through '--sysdef' option is not at the specified ordinal in the DEF file M:/sf/mw/svgt/svgtopt/svgtplugin/BWINSCW/NPSVGTPLUGINu.DEF.
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   308
		if ($message =~ /Symbol (\S+) passed .* DEF file .:(.*)\.$/oi)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   309
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   310
			my $symbol = $1;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   311
			my $deffile = $2;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   312
	  	$missing_export{"$current_package\t$deffile\t$symbol\tmisplaced in $current_link_target"} = 1;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   313
	  	next;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   314
			}
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   315
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   316
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   317
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   318
# clean up the file lists
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   319
my %filecount_by_message_id;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   320
foreach my $id (keys %files_by_message_id)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   321
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   322
	my @longlist = split /\n/, $files_by_message_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   323
	my %uniq;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   324
	foreach my $file (@longlist)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   325
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   326
		$uniq{$file} = 1;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   327
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   328
	my $uniqlist = join( "\n\t", sort keys %uniq);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   329
	$files_by_message_id{$id} = $uniqlist;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   330
	$filecount_by_message_id{$id} = scalar keys %uniq;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   331
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   332
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   333
print "\n\n====Occurrences of messages (distinct, all)\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   334
foreach my $id ( sort {$unique_message_counts{$b} <=> $unique_message_counts{$a}} keys %unique_message_counts)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   335
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   336
	printf "%-6d\t%-6d\t%s\n", $unique_message_counts{$id}, $all_message_counts{$id}, $messages_by_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   337
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   338
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   339
print "\n\n====Files affected per message\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   340
foreach my $id ( sort {$filecount_by_message_id{$b} <=> $filecount_by_message_id{$a}} keys %filecount_by_message_id)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   341
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   342
	printf "%-6d\t%s\n", $filecount_by_message_id{$id}, $messages_by_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   343
	if ($verbose)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   344
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   345
		print "\t", $files_by_message_id{$id};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   346
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   347
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   348
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   349
print "\n\n====Packages impacted (if > 1)\n";
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   350
foreach my $file ( sort {$package_count_by_file{$b} <=> $package_count_by_file{$a}} keys %package_count_by_file)
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   351
	{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   352
	if ($package_count_by_file{$file} < 2)
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   353
		{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   354
		next;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   355
		}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   356
	my ($empty,@packages) = split /\t+/, $packages_by_file{$file};
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   357
	printf "%-6d\t%s\n\t(%s)\n",$package_count_by_file{$file}, $file, join(", ", @packages);
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   358
	}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   359
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   360
print "\n\n====Affected files by package\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   361
my $current_package = "";
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   362
my $current_packagename;
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   363
my @currentfiles;
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   364
my @bugzilla_stuff;
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   365
foreach my $file (sort keys %error_count_by_file)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   366
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   367
	my ($root, $sf, $layer, $packagename, @rest) = split /[\/\\]/, $file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   368
	my $package = "$sf/$layer/$packagename";
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   369
	if ($sf eq "epoc32")
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   370
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   371
		$package = "$sf/$layer";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   372
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   373
	if ($package ne $current_package)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   374
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   375
		if ($current_package ne "")
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   376
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   377
			printf "%-6d\t%s\n", scalar @currentfiles, $current_package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   378
			print join("\n",@currentfiles);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   379
			print "\n";
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   380
			my $bugreport = sprintf "\"%s\",%d,\"GCC compilation issues in %s\",\"GCC_SURGE\"", $current_package, scalar @currentfiles, $current_packagename;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   381
			$bugreport .= ",\"" . join("<br>", "Issues identified in the following source files:", @currentfiles) . "\"";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   382
			push @bugzilla_stuff, $bugreport;
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   383
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   384
		$current_package = $package;
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   385
		$current_packagename = $packagename;
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   386
		@currentfiles = ();
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   387
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   388
	my $filedetails = sprintf "\t%-6d\t%s", $error_count_by_file{$file}, $file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   389
	push @currentfiles, $filedetails;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   390
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   391
printf "%-6d\t%s\n", scalar @currentfiles, $current_package;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   392
print join("\n",@currentfiles);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   393
print "\n";
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   394
my $bugreport = sprintf "\"%s\",%d,\"GCC compilation issues in %s\",\"GCC_SURGE\"", $current_package, scalar @currentfiles, $current_packagename;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   395
$bugreport .= ',"' . join("<br>", "Issues identified in the following source files:", @currentfiles) . '"';
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   396
push @bugzilla_stuff, $bugreport;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   397
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   398
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   399
print "\n\n====Messages by file\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   400
foreach my $file ( sort keys %error_count_by_file)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   401
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   402
	my @details = split "\n", $errors_by_file{$file};
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   403
	printf "%-6d\t%s\n\t", $error_count_by_file{$file}, $file;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   404
	print join("\n\t", @details);
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   405
	print "\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   406
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   407
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   408
my %visibility_summary;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   409
print "\n\n====Visibility problems - all\n";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   410
foreach my $problem ( sort (keys %missing_ELF_symbol, keys %missing_export, keys %excess_export))
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   411
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   412
	print "$problem\n";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   413
	my ($package,$file,$symbol,$impact) = split /\t/, $problem;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   414
	my $key = "$symbol\t$package";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   415
	if (!defined $visibility_summary{$key})
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   416
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   417
		$visibility_summary{$key} = 0;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   418
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   419
	$visibility_summary{$key} += 1;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   420
	}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   421
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   422
print "\n\n====Symbol visibility problems (>1 instance)\n";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   423
my $current_symbol = "";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   424
my $references = 0;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   425
my @packagelist = ();
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   426
foreach my $problem ( sort keys %visibility_summary)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   427
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   428
	my ($symbol, $package) = split /\t/, $problem;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   429
	if ($symbol ne $current_symbol)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   430
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   431
		if ($current_symbol ne "" && $references > 1)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   432
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   433
			printf "%-6d\t%s\n", $references, $current_symbol;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   434
			printf "\t%-6d\t%s\n", scalar @packagelist, join(", ", @packagelist);
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   435
			}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   436
		$current_symbol = $symbol;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   437
		$references = 0;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   438
		@packagelist = ();
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   439
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   440
	$references += $visibility_summary{$problem};
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   441
	push @packagelist, $package;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   442
	}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   443
if ($references > 1)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   444
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   445
	printf "%-6d\t%s\n", $references, $current_symbol;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   446
	printf "\t%-6d\t%s\n", scalar @packagelist, join(", ", @packagelist);
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   447
	}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   448
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   449
print "\n\n====Missing symbols causing ELF link failures\n";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   450
foreach my $problem ( sort keys %missing_ELF_symbol)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   451
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   452
	print "$problem\n";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   453
	}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   454
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   455
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   456
my @simple_exports = ();
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   457
my @vague_exports = ();
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   458
my $last_elffile = "";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   459
my @last_objdump = ();
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   460
foreach my $problem (sort {substr($a,-12) cmp substr($b,-12)} keys %missing_export)
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   461
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   462
	my ($package,$file,$symbol,$impact) = split /\t/, $problem;
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   463
	if ($impact =~ /impacts ..\/(.*)/)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   464
		{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   465
		my $e32file = $1;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   466
		my $elffile = $e32file . ".sym";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   467
		my $objdumplist = $elffile . ".txt";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   468
		my @instances = ();
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   469
		if (-e $elffile && $last_elffile ne $elffile)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   470
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   471
			# cache miss
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   472
			if (-e $objdumplist && -s $objdumplist > 0)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   473
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   474
				open OBJDUMPLIST, "<$objdumplist";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   475
				@last_objdump = <OBJDUMPLIST>;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   476
				close OBJDUMPLIST;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   477
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   478
			else
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   479
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   480
				open OBJDUMP, "arm-none-symbianelf-objdump --sym $elffile |";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   481
				@last_objdump = <OBJDUMP>;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   482
				close OBJDUMP;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   483
				open OBJDUMPLIST, ">$objdumplist" or print STDERR "Failed to write $objdumplist: $!\n";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   484
				print OBJDUMPLIST @last_objdump;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   485
				close OBJDUMPLIST;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   486
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   487
			$last_elffile = $elffile;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   488
			}
10
375cb23d95ba Avoid matching sub-symbols, e.g. __aeabi_memclr matching __aeabi_memclr4
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
   489
		my $length = length($symbol);
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   490
		foreach my $line (@last_objdump)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   491
			{
10
375cb23d95ba Avoid matching sub-symbols, e.g. __aeabi_memclr matching __aeabi_memclr4
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
   492
			chomp $line;
375cb23d95ba Avoid matching sub-symbols, e.g. __aeabi_memclr matching __aeabi_memclr4
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
   493
			if (substr($line,-$length) eq $symbol)
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   494
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   495
				push @instances, $line;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   496
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   497
			}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   498
		close OBJDUMP;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   499
		
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   500
		printf STDERR "Checked %s for %s, found %d instances\n", $elffile, $symbol, scalar @instances;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   501
		print STDERR join("\n", @instances, "");
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   502
		
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   503
		if (scalar @instances == 0)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   504
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   505
			$problem = "$package\t$elffile\t$symbol\tmissing\t$file";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   506
			}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   507
		if (scalar @instances == 1)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   508
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   509
			my $flags = "";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   510
			if ($instances[0] =~ /^.{8} (.{7}) /)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   511
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   512
				$flags = " (".$1.")";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   513
				$flags =~ s/ //g;	# throw away the spaces
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   514
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   515
			if (index($instances[0], ".hidden") > 0)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   516
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   517
				$problem = "$package\t$elffile\t$symbol\thidden$flags\t$file";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   518
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   519
			else
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   520
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   521
				$problem = "$package\t$elffile\t$symbol\tvisible$flags\t$file";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   522
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   523
			}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   524
		if (scalar @instances > 1)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   525
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   526
			$problem = "$package\t$elffile\t$symbol\trepeated\t$file";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   527
			}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   528
		}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   529
	if ($symbol =~ /^(_ZNK?\d|[^_]|__)/)
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   530
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   531
		push @simple_exports, $problem;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   532
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   533
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   534
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   535
		push @vague_exports, $problem;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   536
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   537
	}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   538
printf "\n\n====Simple exports missing from linked ELF executables - (%d)\n", scalar @simple_exports;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   539
print join("\n", sort @simple_exports, "");
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   540
printf "\n\n====Vague linkage exports missing from linked ELF executables - (%d)\n", scalar @vague_exports;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   541
print join("\n", sort @vague_exports, "");
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   542
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   543
@simple_exports = ();
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   544
@vague_exports = ();
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   545
foreach my $problem (keys %excess_export)
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   546
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   547
	my ($package,$file,$symbol,$impact) = split /\t/, $problem;
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   548
	if ($symbol =~ /^(_ZNK?\d|_Z\d|[^_]|__)/)
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   549
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   550
		push @simple_exports, $problem;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   551
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   552
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   553
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   554
		push @vague_exports, $problem;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   555
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   556
	}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   557
printf "\n\n====Simple unfrozen exports found in linked ELF executables - (%d)\n", scalar @simple_exports;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   558
print join("\n", sort @simple_exports, "");
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   559
printf "\n\n====Vague linkage unfrozen exports found in linked ELF executables - (%d)\n", scalar @vague_exports;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   560
print join("\n", sort @vague_exports, "");
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   561
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   562
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   563
print "\n\n====Bugzilla CSV input\n";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   564
print "\"product\",\"count\",\"short_desc\",\"keywords\",\"long_desc\"\n";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   565
print join("\n", @bugzilla_stuff, "");
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   566