Alexander Shishkin | 25 Aug 23:32
Gravatar

[PATCH] don't call sparse when called to generate dependencies

I have a situation here when $(CC) is called with -M options with
slighly different set of -I/-D/etc arguments, which causes all sorts of
funny reports from sparse. Also, this increases the overall build time
because every compilation unit if sparsed twice.

Signed-off-by: Alexander Shishkin <alexander.shishckin <at> gmail.com>
---
 cgcc |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/cgcc b/cgcc
index 4fab530..89adbed 100755
--- a/cgcc
+++ b/cgcc
@@ -7,6 +7,7 @@ my $check = $ENV{'CHECK'} || 'sparse';
 my $m32 = 0;
 my $m64 = 0;
 my $has_specs = 0;
+my $gendeps = 0;
 my $do_check = 0;
 my $do_compile = 1;
 my $verbose = 0;
@@ -22,6 +23,7 @@ foreach (@ARGV) {

     $m32 = 1 if /^-m32$/;
     $m64 = 1 if /^-m64$/;
+    $gendeps = 1 if /^-M$/;

     if (/^-specs=(.*)$/) {
 	$check .= &add_specs ($1);
(Continue reading)

Bernd Petrovitsch | 26 Aug 09:44
Favicon

Re: [PATCH] don't call sparse when called to generate dependencies


On Tue, 2008-08-26 at 00:33 +0300, Alexander Shishkin wrote:
> I have a situation here when $(CC) is called with -M options with
> slighly different set of -I/-D/etc arguments, which causes all sorts of

I (obviously) don't know any details about your situation but do you
have any specific reason that you have different sets of -I/-D
parameters on dependency generation and the real compile run?

Personally I see only subtle problems on the horizon with such a
situation.
Let alone that it is somewhat simpler to have *one* CFLAGS/CPPFLAGS/...
variable and use that everywhere.

	Bernd
--

-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Alexander Shishkin | 26 Aug 11:19
Gravatar

Re: [PATCH] don't call sparse when called to generate dependencies

On Tue, Aug 26, 2008 at 10:44 AM, Bernd Petrovitsch <bernd <at> firmix.at> wrote:
> I (obviously) don't know any details about your situation but do you
> have any specific reason that you have different sets of -I/-D
> parameters on dependency generation and the real compile run?
To put a long story short: I run sparse against netbsd tree. To be
slightly more elaborate, I should mention that I wasn't able so far to
fully appreciate the beauty and elegance of certain design decisions
of the project in question. Nevertheless, I'm seeing different reports
from gendep and compilation runs.

> Personally I see only subtle problems on the horizon with such a
> situation.
> Let alone that it is somewhat simpler to have *one* CFLAGS/CPPFLAGS/...
> variable and use that everywhere.
Well, that aside, the overall build time significantly increases with
having to run sparse twice. Same warnings/errors are reported twice.

I still think that sparse has no business validating any code when
cgcc is called in -M mode; all those files are going to be compiled
later on anyway. And it's the compilation stage where warnings are
desirable.

Regards,
--
Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Bernd Petrovitsch | 26 Aug 12:00
Favicon

Re: [PATCH] don't call sparse when called to generate dependencies


On Tue, 2008-08-26 at 12:19 +0300, Alexander Shishkin wrote:
> On Tue, Aug 26, 2008 at 10:44 AM, Bernd Petrovitsch <bernd <at> firmix.at> wrote:
[....]
> > Let alone that it is somewhat simpler to have *one* CFLAGS/CPPFLAGS/...
> > variable and use that everywhere.
> Well, that aside, the overall build time significantly increases with
> having to run sparse twice. Same warnings/errors are reported twice.

Of course (and especially on a large source tree).

> I still think that sparse has no business validating any code when
> cgcc is called in -M mode; all those files are going to be compiled

Yes, that also seems superflous to me in general.

> later on anyway. And it's the compilation stage where warnings are
> desirable.

ACK.

	Bernd
--

-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo <at> vger.kernel.org
(Continue reading)

Josh Triplett | 27 Aug 02:43

Re: [PATCH] don't call sparse when called to generate dependencies

On Tue, 2008-08-26 at 00:33 +0300, Alexander Shishkin wrote:
> I have a situation here when $(CC) is called with -M options with
> slighly different set of -I/-D/etc arguments, which causes all sorts of
> funny reports from sparse. Also, this increases the overall build time
> because every compilation unit if sparsed twice.

Makes sense, given that -M implies -E.  Applied, thanks.

- Josh Triplett

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane