public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cross-sparse
@ 2004-06-17 21:13 Geert Uytterhoeven
  2004-06-18 16:27 ` Linus Torvalds
  0 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2004-06-17 21:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux/m68k, Linux Kernel Development

	Hi Linus,

I wanted to give sparse a try on m68k, and noticed the current infrastructure
doesn't handle cross-compilation (no sane m68k people compile kernels natively
anymore, unless they run a Debian autobuilder ;-).

After hacking the include paths in the sparse sources, installing the resulting
binary as m68k-linux-sparse, and applying the following patch, it seems to work
fine!

OK to apply?

--- linux-2.6.7/Makefile	2004-06-16 13:06:15.000000000 +0200
+++ linux-m68k-2.6.7/Makefile	2004-06-17 22:07:27.000000000 +0200
@@ -296,7 +296,7 @@ GENKSYMS	= scripts/genksyms/genksyms
 DEPMOD		= /sbin/depmod
 KALLSYMS	= scripts/kallsyms
 PERL		= perl
-CHECK		= sparse
+CHECK		= $(CROSS_COMPILE)sparse
 MODFLAGS	= -DMODULE
 CFLAGS_MODULE   = $(MODFLAGS)
 AFLAGS_MODULE   = $(MODFLAGS)

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH] cross-sparse
  2004-06-17 21:13 [PATCH] cross-sparse Geert Uytterhoeven
@ 2004-06-18 16:27 ` Linus Torvalds
  2004-06-18 20:49   ` Geert Uytterhoeven
  2004-06-18 21:33   ` Herbert Poetzl
  0 siblings, 2 replies; 9+ messages in thread
From: Linus Torvalds @ 2004-06-18 16:27 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, Linux Kernel Development



On Thu, 17 Jun 2004, Geert Uytterhoeven wrote:
> 
> I wanted to give sparse a try on m68k, and noticed the current infrastructure
> doesn't handle cross-compilation (no sane m68k people compile kernels natively
> anymore, unless they run a Debian autobuilder ;-).
> 
> After hacking the include paths in the sparse sources, installing the resulting
> binary as m68k-linux-sparse, and applying the following patch, it seems to work
> fine!

Hmm.. It does make sense, but at the same time, sparse isn't even really 
supposed to _care_ about the architecture. Especially not for a kernel 
build.

Which part breaks when not just using the native sparse? As far as I know, 
a kernel build should use all-kernel header files, with the exception of 
"stdarg.h" which I thought was also architecture-independent (but hey, 
maybe I'm just a retard, and am wrong).

		Linus

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

* Re: [PATCH] cross-sparse
  2004-06-18 16:27 ` Linus Torvalds
@ 2004-06-18 20:49   ` Geert Uytterhoeven
  2004-06-18 20:58     ` Linus Torvalds
  2004-06-19  0:33     ` viro
  2004-06-18 21:33   ` Herbert Poetzl
  1 sibling, 2 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2004-06-18 20:49 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux/m68k, Linux Kernel Development

On Fri, 18 Jun 2004, Linus Torvalds wrote:
> On Thu, 17 Jun 2004, Geert Uytterhoeven wrote:
> > I wanted to give sparse a try on m68k, and noticed the current infrastructure
> > doesn't handle cross-compilation (no sane m68k people compile kernels natively
> > anymore, unless they run a Debian autobuilder ;-).
> >
> > After hacking the include paths in the sparse sources, installing the resulting
> > binary as m68k-linux-sparse, and applying the following patch, it seems to work
> > fine!
>
> Hmm.. It does make sense, but at the same time, sparse isn't even really
> supposed to _care_ about the architecture. Especially not for a kernel
> build.
>
> Which part breaks when not just using the native sparse? As far as I know,
> a kernel build should use all-kernel header files, with the exception of
> "stdarg.h" which I thought was also architecture-independent (but hey,
> maybe I'm just a retard, and am wrong).

IIRC, actually the first error I got when using the native sparse was that it
couldn't find stdarg.h.

And even the non-native sparse doesn't know about architecture-specific defines
like __mc68000__, causing some code paths being wrong. Guess I have to replace
them by e.g. CONFIG_M68K.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH] cross-sparse
  2004-06-18 20:49   ` Geert Uytterhoeven
@ 2004-06-18 20:58     ` Linus Torvalds
  2004-06-19  0:33     ` viro
  1 sibling, 0 replies; 9+ messages in thread
From: Linus Torvalds @ 2004-06-18 20:58 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, Linux Kernel Development



On Fri, 18 Jun 2004, Geert Uytterhoeven wrote:
> 
> IIRC, actually the first error I got when using the native sparse was that it
> couldn't find stdarg.h.

Ok.

> And even the non-native sparse doesn't know about architecture-specific defines
> like __mc68000__, causing some code paths being wrong. Guess I have to replace
> them by e.g. CONFIG_M68K.

No, this is handled by fixing up the expected defines in the

	arch/xxx/Makefile

thing, ie x86 has this:

	CHECK := $(CHECK) -D__i386__=1

exactly because sparse is architecture-agnostic. Same goes for 64-bit 
issues (sparse defaults to 32-bit types regardless of what the native 
format is), so a 64-bit platform like ppc64 would do:

	CHECK := $(CHECK) -m64 -D__powerpc__=1

where that "-m64" is the magic flag to sparse for a 64-bit compile 
environment.

But your stdarg.h issue is certainly valid. I'd really like for sparse to 
be _totally_ independent of the native compiler install, and I guess we 
could do something like

	CHECK := $(CHECK) -I$(shell $(CC) -print-file-name=include)

or similar to get this part right too, but then sparse would be hard to 
use stand-alone without the Makefile magic. Hmm.

		Linus

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

* Re: [PATCH] cross-sparse
  2004-06-18 16:27 ` Linus Torvalds
  2004-06-18 20:49   ` Geert Uytterhoeven
@ 2004-06-18 21:33   ` Herbert Poetzl
  2004-06-18 21:48     ` Randy.Dunlap
                       ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Herbert Poetzl @ 2004-06-18 21:33 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Geert Uytterhoeven, Linux/m68k, Linux Kernel Development

On Fri, Jun 18, 2004 at 09:27:22AM -0700, Linus Torvalds wrote:
> On Thu, 17 Jun 2004, Geert Uytterhoeven wrote:
> > 
> > I wanted to give sparse a try on m68k, and noticed the current 
> > infrastructure doesn't handle cross-compilation (no sane m68k 
> > people compile kernels natively anymore, unless they run a 
> > Debian autobuilder ;-).
> > 
> > After hacking the include paths in the sparse sources, installing 
> > the resulting binary as m68k-linux-sparse, and applying the 
> > following patch, it seems to work fine!
> 
> Hmm.. It does make sense, but at the same time, sparse isn't even really 
> supposed to _care_ about the architecture. Especially not for a kernel 
> build.

apologies for assasinating this thread ...

I did an 'extensive' search with google (you do not want 
to know how many hits you get with 'sparse') and read 
most postings on the sparse mailinglist (linux-sparse),
found the freshmeat project pointing me to the 'new url'
http://www.codemonkey.org.uk/projects/sparse/ where I can
download 'sparse-2003-11-27.tar.gz', then found out that
there should be a maintained (up to date) version of it at 

   http://www.kernel.org/pub/software/devel/sparse/

but what I find there, seems of no use to me ...
(I'm no bitkeeper person) so I'm still looking for an url
where I can get a recent .tar to install that beast.

can anybody point me in the right direction, please?

TIA,
Herbert

> Which part breaks when not just using the native sparse? As far as I know, 
> a kernel build should use all-kernel header files, with the exception of 
> "stdarg.h" which I thought was also architecture-independent (but hey, 
> maybe I'm just a retard, and am wrong).
> 
> 		Linus
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH] cross-sparse
  2004-06-18 21:33   ` Herbert Poetzl
@ 2004-06-18 21:48     ` Randy.Dunlap
  2004-06-18 21:57     ` Chris Wedgwood
  2004-06-18 23:30     ` Dave Jones
  2 siblings, 0 replies; 9+ messages in thread
From: Randy.Dunlap @ 2004-06-18 21:48 UTC (permalink / raw)
  To: Herbert Poetzl; +Cc: torvalds, geert, linux-m68k, linux-kernel

On Fri, 18 Jun 2004 23:33:38 +0200 Herbert Poetzl wrote:

| On Fri, Jun 18, 2004 at 09:27:22AM -0700, Linus Torvalds wrote:
| > On Thu, 17 Jun 2004, Geert Uytterhoeven wrote:
| > > 
| > > I wanted to give sparse a try on m68k, and noticed the current 
| > > infrastructure doesn't handle cross-compilation (no sane m68k 
| > > people compile kernels natively anymore, unless they run a 
| > > Debian autobuilder ;-).
| > > 
| > > After hacking the include paths in the sparse sources, installing 
| > > the resulting binary as m68k-linux-sparse, and applying the 
| > > following patch, it seems to work fine!
| > 
| > Hmm.. It does make sense, but at the same time, sparse isn't even really 
| > supposed to _care_ about the architecture. Especially not for a kernel 
| > build.
| 
| apologies for assasinating this thread ...
| 
| I did an 'extensive' search with google (you do not want 
| to know how many hits you get with 'sparse') and read 
| most postings on the sparse mailinglist (linux-sparse),
| found the freshmeat project pointing me to the 'new url'
| http://www.codemonkey.org.uk/projects/sparse/ where I can
| download 'sparse-2003-11-27.tar.gz', then found out that
| there should be a maintained (up to date) version of it at 
| 
|    http://www.kernel.org/pub/software/devel/sparse/
| 
| but what I find there, seems of no use to me ...
| (I'm no bitkeeper person) so I'm still looking for an url
| where I can get a recent .tar to install that beast.
| 
| can anybody point me in the right direction, please?

sure, get a tarball from here:
  http://www.codemonkey.org.uk/projects/bitkeeper/sparse/

--
~Randy

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

* Re: [PATCH] cross-sparse
  2004-06-18 21:33   ` Herbert Poetzl
  2004-06-18 21:48     ` Randy.Dunlap
@ 2004-06-18 21:57     ` Chris Wedgwood
  2004-06-18 23:30     ` Dave Jones
  2 siblings, 0 replies; 9+ messages in thread
From: Chris Wedgwood @ 2004-06-18 21:57 UTC (permalink / raw)
  To: Linus Torvalds, Geert Uytterhoeven, Linux/m68k,
	Linux Kernel Development

On Fri, Jun 18, 2004 at 11:33:38PM +0200, Herbert Poetzl wrote:

> can anybody point me in the right direction, please?

http://sparse.bkbits.net/sparse/

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

* Re: [PATCH] cross-sparse
  2004-06-18 21:33   ` Herbert Poetzl
  2004-06-18 21:48     ` Randy.Dunlap
  2004-06-18 21:57     ` Chris Wedgwood
@ 2004-06-18 23:30     ` Dave Jones
  2 siblings, 0 replies; 9+ messages in thread
From: Dave Jones @ 2004-06-18 23:30 UTC (permalink / raw)
  To: Linus Torvalds, Geert Uytterhoeven, Linux/m68k,
	Linux Kernel Development

On Fri, Jun 18, 2004 at 11:33:38PM +0200, Herbert Poetzl wrote:

 > I did an 'extensive' search with google (you do not want 
 > to know how many hits you get with 'sparse') and read 
 > most postings on the sparse mailinglist (linux-sparse),
 > found the freshmeat project pointing me to the 'new url'
 > http://www.codemonkey.org.uk/projects/sparse/ where I can
 > download 'sparse-2003-11-27.tar.gz', then found out that
 > there should be a maintained (up to date) version of it at 
 > 
 >    http://www.kernel.org/pub/software/devel/sparse/
 > 
 > but what I find there, seems of no use to me ...
 > (I'm no bitkeeper person) so I'm still looking for an url
 > where I can get a recent .tar to install that beast.
 > 
 > can anybody point me in the right direction, please?

Erk, that's where I originally was snapshotting stuff, then
the box hosting codemonkey.org.uk died, and I had to restore
from backup. It turned a symlink to http://www.codemonkey.org.uk/projects/bitkeeper/sparse/
into a copy of the dir. Oops. I'll go fix that up (By just
killing the old dir).

		Dave


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

* Re: [PATCH] cross-sparse
  2004-06-18 20:49   ` Geert Uytterhoeven
  2004-06-18 20:58     ` Linus Torvalds
@ 2004-06-19  0:33     ` viro
  1 sibling, 0 replies; 9+ messages in thread
From: viro @ 2004-06-19  0:33 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linus Torvalds, Linux/m68k, Linux Kernel Development

On Fri, Jun 18, 2004 at 10:49:38PM +0200, Geert Uytterhoeven wrote:
> And even the non-native sparse doesn't know about architecture-specific defines
> like __mc68000__, causing some code paths being wrong. Guess I have to replace
> them by e.g. CONFIG_M68K.

That should be handled in arch/m68k/Makefile - see how it's done on e.g.
i386.

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

end of thread, other threads:[~2004-06-19  0:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-17 21:13 [PATCH] cross-sparse Geert Uytterhoeven
2004-06-18 16:27 ` Linus Torvalds
2004-06-18 20:49   ` Geert Uytterhoeven
2004-06-18 20:58     ` Linus Torvalds
2004-06-19  0:33     ` viro
2004-06-18 21:33   ` Herbert Poetzl
2004-06-18 21:48     ` Randy.Dunlap
2004-06-18 21:57     ` Chris Wedgwood
2004-06-18 23:30     ` Dave Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox