tools/summarise_gcc_errors.pl
author William Roberts <williamr@symbian.org>
Wed, 07 Jul 2010 15:43:49 +0100
changeset 9 cb10ec12dc45
parent 8 c38b26fd0c68
child 10 375cb23d95ba
permissions -rw-r--r--
Lots of fixes and adjustments to help understand the linkage problems
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
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
EOF
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
  exit (1);  
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
  }
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
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
    42
my $verbose = 0;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
# 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
    45
if (!GetOptions(
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
    "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
    47
    "v|verbose" => \$verbose,
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
    ))
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
  {
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
  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
    51
  }
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    52
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
    53
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
    54
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
    55
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
    56
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
    57
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
my %files;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
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
    60
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
    61
my %errors;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
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
    63
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
    64
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
    65
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
    66
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
    67
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
    68
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
    69
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
    70
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
    71
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
    72
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
    73
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    74
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
    75
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    76
	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
    77
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    78
	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
    79
	$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
    80
	$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
    81
	$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
    82
	$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
    83
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    84
	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
    85
	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
    86
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    87
		$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
		$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
    89
		$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
    90
		$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
    91
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    92
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    93
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    94
		$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
    95
		$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
    96
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    97
	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
    98
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
    99
	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
   100
	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
   101
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   102
		$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
   103
		$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
   104
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   105
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   106
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   107
		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
   108
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   109
			$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
   110
			$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
   111
			}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   112
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   113
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   114
	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
   115
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   116
		# 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
   117
		return;
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
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   120
	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
   121
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   122
		$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
   123
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   124
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   125
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   126
		$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
   127
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   128
	$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
   129
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   130
	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
   131
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   132
		$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
   133
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   134
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   135
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   136
		$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
   137
		}
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
	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
   140
	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
   141
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   142
		$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
   143
		$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
   144
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   145
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   146
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   147
		$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
   148
		$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
   149
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   150
	}
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   151
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   152
my $line;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   153
while ($line = <>)
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
	{
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   155
	# </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
   156
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   157
	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
   158
		{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   159
		$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
   160
		$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
   161
		next;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   162
		}
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   163
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   164
	# <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
   165
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   166
	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
   167
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   168
		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
   169
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   170
			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
   171
			$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
   172
			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
   173
			$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
   174
			}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   175
		next;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   176
		}
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
	# 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
   179
  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
   180
  	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   181
		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
   182
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   183
			$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
   184
			next;
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
		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
   187
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   188
			$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
   189
			next;
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
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   192
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   193
	# 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
   194
  # 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
   195
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   196
	# 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
   197
	# 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
   198
	# 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
   199
	# 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
   200
	# 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
   201
	# 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
   202
	
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   203
	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
   204
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   205
		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
   206
		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
   207
		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
   208
		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
   209
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   210
		$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
   211
		
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   212
		$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
   213
		$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
   214
		$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
   215
		$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
   216
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   217
		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
   218
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   219
			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
   220
				{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   221
				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
   222
  			$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
   223
				$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
   224
				}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   225
			else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   226
				{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   227
				next;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   228
				}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   229
			}
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   230
		# 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
   231
		# 
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   232
		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
   233
			{
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   234
			$filename = $saved_filename;
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   235
			$lineno = 0;
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
		else
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   238
			{
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   239
			$saved_filename = $filename;
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   240
			}
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   241
		
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   242
		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
   243
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   244
			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
   245
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   246
		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
   247
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   248
			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
   249
			}
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   250
		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
   251
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   252
			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
   253
			}
7
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   254
		if ($message =~ /.*: No such file/ && !$warnings)
8c4a7869f673 Add heuristic for guessing the source file associated with assembler errors
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   255
			{
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   256
			# 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
   257
			}
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   258
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   259
		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
   260
		next;
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
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   263
  # 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
   264
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   265
	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
   266
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   267
		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
   268
		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
   269
		next;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   270
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   271
	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   272
	# 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
   273
	# 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
   274
  # 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
   275
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   276
	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
   277
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   278
		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
   279
		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
   280
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   281
		$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
   282
		$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
   283
		$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
   284
		
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   285
		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
   286
			{
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   287
			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
   288
			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
   289
			
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   290
			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
   291
				{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   292
				$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
   293
	  		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   294
			next;	
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   295
			}	
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
		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
   298
			{
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   299
			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
   300
	  	$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
   301
	  	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
   302
			}
9
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   303
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   304
    # 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
   305
		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
   306
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   307
			my $symbol = $1;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   308
			my $deffile = $2;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   309
	  	$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
   310
	  	next;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   311
			}
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   312
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   313
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   314
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   315
# 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
   316
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
   317
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
   318
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   319
	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
   320
	my %uniq;
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   321
	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
   322
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   323
		$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
   324
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   325
	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
   326
	$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
   327
	$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
   328
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   329
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   330
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
   331
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
   332
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   333
	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
   334
	}
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
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
   337
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
   338
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   339
	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
   340
	if ($verbose)
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
		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
   343
		}
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
3
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   346
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
   347
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
   348
	{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   349
	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
   350
		{
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   351
		next;
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   352
		}
5578c2bec847 Update gcce summary tool to note the affected packages, and update summary text
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
   353
	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
   354
	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
   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
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   357
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
   358
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
   359
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
   360
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
   361
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
   362
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
   363
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   364
	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
   365
	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
   366
	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
   367
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   368
		$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
   369
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   370
	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
   371
		{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   372
		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
   373
			{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   374
			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
   375
			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
   376
			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
   377
			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
   378
			$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
   379
			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
   380
			}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   381
		$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
   382
		$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
   383
		@currentfiles = ();
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   384
		}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   385
	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
   386
	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
   387
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   388
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
   389
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
   390
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
   391
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
   392
$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
   393
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
   394
1
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   395
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   396
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
   397
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
   398
	{
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   399
	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
   400
	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
   401
	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
   402
	print "\n";
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   403
	}
fd0863fd52e5 Add script to summarise GCC errors (and warnings) from the "*_failures.html" logs
William Roberts <williamr@symbian.org>
parents:
diff changeset
   404
8
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   405
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
   406
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
   407
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
   408
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   409
	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
   410
	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
   411
	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
   412
	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
   413
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   414
		$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
   415
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   416
	$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
   417
	}
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
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
   420
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
   421
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
   422
my @packagelist = ();
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   423
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
   424
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   425
	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
   426
	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
   427
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   428
		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
   429
			{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   430
			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
   431
			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
   432
			}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   433
		$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
   434
		$references = 0;
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   435
		@packagelist = ();
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   436
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   437
	$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
   438
	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
   439
	}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   440
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
   441
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   442
	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
   443
	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
   444
	}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   445
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   446
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
   447
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
   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 "$problem\n";
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   450
	}
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
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   453
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
   454
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
   455
my $last_elffile = "";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   456
my @last_objdump = ();
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   457
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
   458
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   459
	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
   460
	if ($impact =~ /impacts ..\/(.*)/)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   461
		{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   462
		my $e32file = $1;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   463
		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
   464
		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
   465
		my @instances = ();
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   466
		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
   467
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   468
			# cache miss
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   469
			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
   470
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   471
				open OBJDUMPLIST, "<$objdumplist";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   472
				@last_objdump = <OBJDUMPLIST>;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   473
				close OBJDUMPLIST;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   474
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   475
			else
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   476
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   477
				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
   478
				@last_objdump = <OBJDUMP>;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   479
				close OBJDUMP;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   480
				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
   481
				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
   482
				close OBJDUMPLIST;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   483
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   484
			$last_elffile = $elffile;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   485
			}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   486
		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
   487
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   488
			if (index($line,$symbol) >= 0)
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   489
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   490
				push @instances, $line;
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   491
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   492
			}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   493
		close OBJDUMP;
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
		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
   496
		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
   497
		
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   498
		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
   499
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   500
			$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
   501
			}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   502
		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
   503
			{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   504
			my $flags = "";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   505
			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
   506
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   507
				$flags = " (".$1.")";
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   508
				$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
   509
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   510
			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
   511
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   512
				$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
   513
				}
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   514
			else
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   515
				{
cb10ec12dc45 Lots of fixes and adjustments to help understand the linkage problems
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
   516
				$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
   517
				}
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
		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
   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\trepeated\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 ($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
   525
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   526
		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
   527
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   528
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   529
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   530
		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
   531
		}
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
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
   534
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
   535
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
   536
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
   537
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   538
@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
@vague_exports = ();
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   540
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
   541
	{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   542
	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
   543
	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
   544
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   545
		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
   546
		}
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   547
	else
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   548
		{
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   549
		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
   550
		}
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
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
   553
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
   554
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
   555
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
   556
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   557
c38b26fd0c68 Substantial update of summarise_gcc_errors.pl, for the GCC_SURGE work
William Roberts <williamr@symbian.org>
parents: 7
diff changeset
   558
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
   559
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
   560
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
   561