public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] LTO: display file name if LTO version check fails
@ 2016-05-19 12:21 Martin Liška
  2016-05-19 12:57 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2016-05-19 12:21 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

Hi.

During the compilation of chrome, I've noticed that they utilize 'cc' binary.
Because of that, I see LTO version check, but it would be quite useful to
see which file is affected.

Like:

lto1: fatal error: bytecode stream in file 'obj/third_party/icu/source/common/icuuc.cmemory.o' generated with LTO version 4.0 instead of the expected 6.0

Ready after it finishes regression tests?
Thanks,
Martin


[-- Attachment #2: 0001-LTO-display-file-name-if-LTO-version-check-fails.patch --]
[-- Type: text/x-patch, Size: 2318 bytes --]

From a65988d01557606296f420968e921ef58fd193b2 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 19 May 2016 14:17:03 +0200
Subject: [PATCH] LTO: display file name if LTO version check fails

gcc/ChangeLog:

2016-05-19  Martin Liska  <mliska@suse.cz>

	* lto-section-in.c (lto_get_section_data): Call
	lto_check_version with additional argument.
	* lto-streamer.c (lto_check_version): Add new argument.
	* lto-streamer.h (lto_check_version): Likewise.
---
 gcc/lto-section-in.c | 3 ++-
 gcc/lto-streamer.c   | 7 ++++---
 gcc/lto-streamer.h   | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c
index 93b82be..d8e74d7 100644
--- a/gcc/lto-section-in.c
+++ b/gcc/lto-section-in.c
@@ -168,7 +168,8 @@ lto_get_section_data (struct lto_file_decl_data *file_data,
     }
 
   lto_check_version (((const lto_header *)data)->major_version,
-		     ((const lto_header *)data)->minor_version);
+		     ((const lto_header *)data)->minor_version,
+		     file_data->file_name);
   return data;
 }
 
diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c
index 5e35aac..bfde1fe 100644
--- a/gcc/lto-streamer.c
+++ b/gcc/lto-streamer.c
@@ -376,12 +376,13 @@ lto_orig_address_remove (tree t)
 /* Check that the version MAJOR.MINOR is the correct version number.  */
 
 void
-lto_check_version (int major, int minor)
+lto_check_version (int major, int minor, const char *file_name)
 {
   if (major != LTO_major_version || minor != LTO_minor_version)
     fatal_error (input_location,
-		 "bytecode stream generated with LTO version %d.%d instead "
-	         "of the expected %d.%d",
+		 "bytecode stream in file '%s' generated with LTO version "
+		 "%d.%d instead of the expected %d.%d",
+		 file_name,
 		 major, minor,
 		 LTO_major_version, LTO_minor_version);
 }
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index 01c15ff..92efdb8 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -844,7 +844,7 @@ extern void lto_orig_address_map (tree, intptr_t);
 extern intptr_t lto_orig_address_get (tree);
 extern void lto_orig_address_remove (tree);
 #endif
-extern void lto_check_version (int, int);
+extern void lto_check_version (int, int, const char *);
 extern void lto_streamer_hooks_init (void);
 
 /* In lto-streamer-in.c */
-- 
2.8.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] LTO: display file name if LTO version check fails
  2016-05-19 12:21 [PATCH] LTO: display file name if LTO version check fails Martin Liška
@ 2016-05-19 12:57 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2016-05-19 12:57 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches

On Thu, May 19, 2016 at 2:21 PM, Martin Liška <mliska@suse.cz> wrote:
> Hi.
>
> During the compilation of chrome, I've noticed that they utilize 'cc' binary.
> Because of that, I see LTO version check, but it would be quite useful to
> see which file is affected.
>
> Like:
>
> lto1: fatal error: bytecode stream in file 'obj/third_party/icu/source/common/icuuc.cmemory.o' generated with LTO version 4.0 instead of the expected 6.0
>
> Ready after it finishes regression tests?

Ok.

Richard.

> Thanks,
> Martin
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-19 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-19 12:21 [PATCH] LTO: display file name if LTO version check fails Martin Liška
2016-05-19 12:57 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).