diff --git a/common/version.h b/common/version.h index d2c527e66b367bd0e19c7877595e93e688b8ad3c..e097a4f4d1e45e714598d16391a64e11d05a3a40 100644 --- a/common/version.h +++ b/common/version.h @@ -92,11 +92,11 @@ #ifdef __clang__ #define CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100) + #define COMPILER_VERSION_STRING " Clang: (GNU) " STR(__clang_major__) "." STR(__clang_minor__) "." STR(__clang_patchlevel__) #else #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) + #define COMPILER_VERSION_STRING " GCC: (GNU) " STR(__GNUC__) "." STR(__GNUC_MINOR__) GCC_PATCHLEVEL_STRING #endif - /* Ignore __GNUC_PATCHLEVEL__ */ -#define COMPILER_VERSION_STRING " GCC: (GNU) " STR(__GNUC__) "." STR(__GNUC_MINOR__) GCC_PATCHLEVEL_STRING static const char titan_[] __attribute__ ((section (".titan"))) = \ diff --git a/compiler2/titanver b/compiler2/titanver index 5dc74cc6d50ad255eb8976885a8fa30f3a65887c..6a000f961d19b51179a43d645597d238e349cc0e 100644 --- a/compiler2/titanver +++ b/compiler2/titanver @@ -14,7 +14,11 @@ if [ -z "${perlexe}" ] ; then GCCVER=`strings -a -10 ${1+"$@"} | sed -n ' s/.*TITAN: [0-9][0-9]* PLATFORM: [A-Z0-9][A-Z0-9]* // -/GCC/ { +/GCC: (GNU)/ { +p +} +s/.*TITAN: [0-9][0-9]* PLATFORM: [A-Z0-9][A-Z0-9]* // +/Clang: (GNU)/ { p } /Sun C++/ { @@ -43,7 +47,7 @@ if 0; use strict; use vars qw($r $v); -my $compiler = 'GCC'; +my $compiler = 'Compiler'; my %versions; @@ -62,28 +66,30 @@ open (PIPE, $cmdline = "$objdump -s -j " . join(' -j ', @sections) . " @ARGV |") my $obj = '?'; -while (<PIPE>) -{ - chomp; - next unless length; - if (/^([^:]+):\s+file format/) { +sub match_comment() { if (length($comment)) { - ($found_ver) = $comment =~ /GCC: \([^)]*\) (\d\.\d+(?:\.\d+)?)/; - $found_ver ||= 'unknown!'; + ($found_ver) = $comment =~ /((GCC|Clang): \([^)]*\) \d\.\d+(?:\.\d+)?)/; + if ($found_ver) { + print "$compiler version was $found_ver for $obj\n" if $v; - print "$compiler version was $found_ver for $obj\n" if $v; + push @{$versions{$found_ver}}, $obj; - push @{$versions{$found_ver}}, $obj; - - if (defined $r and $r ne $found_ver) - { + if (defined $r and $r ne $found_ver) { if (!$v) { # found version was not written, do it now warn "$compiler was $found_ver for $obj\n"; } - - die " $r was expected\n"; + die " $r was expected\n"; + } } } +} + +while (<PIPE>) +{ + chomp; + next unless length; + if (/^([^:]+):\s+file format/) { + match_comment(); $obj = $1; $comment = ''; } @@ -101,11 +107,12 @@ while (<PIPE>) \s\s (.+) # up to 16 characters of "plain" text $/x) { - $comment .= $text; } } +match_comment(); + close (PIPE) or die "close failed: $!"; if ( scalar keys %versions > 1 ) {