Bug 37060

Summary: if using gcov, should rebuild everything on gcc upgrade
Product: dbus Reporter: Simon McVittie <smcv>
Component: GLibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: John (J5) Palmieri <johnp>
Severity: enhancement    
Priority: medium CC: rob.taylor
Version: unspecifiedKeywords: patch
Hardware: All   
OS: All   
URL: http://cgit.freedesktop.org/~smcv/dbus-glib/log/?h=config-h-37060
Whiteboard:
i915 platform: i915 features:
Attachments: [PATCH 1/3] Consistently include config.h in all non-generated .c files
[PATCH 2/3] Include config.h in generated C files, and regenerate dbus-gmarshal.c
[PATCH 3/3] Force a full rebuild for new gcc versions if gcov is enabled

Description Simon McVittie 2011-05-10 03:31:18 UTC
A couple of related bugs here, really:

* Best-practice for Autoconf seems to be to include config.h in all
  files in a project. If we don't do this, the existing machinery to
  force everything to be rebuilt with/without instrumentation when you
  enable/disable gcov won't fully work.

* When you upgrade your gcc, gcov will report many version mismatches,
  because it wants the instrumentation to come from the compiler that
  matches your gcov. We can force a rebuild by making the thing in config.h
  depend on the gcc version, if and only if gcov support is enabled.
Comment 1 Simon McVittie 2011-05-10 03:31:57 UTC
Created attachment 46529 [details] [review]
[PATCH 1/3] Consistently include config.h in all non-generated .c  files
Comment 2 Simon McVittie 2011-05-10 03:32:12 UTC
Created attachment 46530 [details] [review]
[PATCH 2/3] Include config.h in generated C files, and regenerate  dbus-gmarshal.c
Comment 3 Simon McVittie 2011-05-10 03:32:36 UTC
Created attachment 46531 [details] [review]
[PATCH 3/3] Force a full rebuild for new gcc versions if gcov is  enabled

This avoids a lot of "Version mismatch - expected 406p got 405*". Because
we're changing the content of each file after preprocessing, it even
defeats ccache, which is desirable here - otherwise we'd get old versions
of the profiling code being resurrected from the cache.
Comment 4 Guillaume Desmottes 2011-05-30 07:28:42 UTC
Review of attachment 46529 [details] [review]:

++
Comment 5 Guillaume Desmottes 2011-05-30 07:29:08 UTC
Review of attachment 46530 [details] [review]:

++
Comment 6 Guillaume Desmottes 2011-05-30 07:31:32 UTC
Review of attachment 46531 [details] [review]:

++
Comment 7 Guillaume Desmottes 2011-05-30 07:31:33 UTC
Review of attachment 46531 [details] [review]:

++
Comment 8 Simon McVittie 2011-05-30 07:43:51 UTC
Thanks; fixed in git for 0.94 based on Guillaume's review + no objections from the reviewer group

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.