Re: [RFC] HOWTO find oops location

From: Marcelo Tosatti
Date: Sat Aug 14 2004 - 14:48:51 EST


On Sat, Aug 14, 2004 at 09:59:27PM +0300, Denis Vlasenko wrote:
> > > > Might be also worth mentioning "gcc -c file.c -g -Wa,-a,-ad > file.s"
> > > > which makes gcc output C code mixed with asm output.
> > > >
> > > > Sometimes its not as effective as the comment method you describe,
> > > > but it will be less work for sure :)
> > >
> > > Aha! Cool.
> > >
> > > Mmmm... How to ensure that build environment exactly matches one
> > > used during make? Environment, -On level, regparm, other gcc switches,
> > > etc, etc, etc? Else file.s object code can be rather different from
> > > code in file.o...
> >
> > No idea.
>
> I tried on 2.6:
>
> make V=1 fs/dcache.o
> make V=1 CFLAGS="-g -Wa,-a,-ad" fs/dcache.o >dcache.asm
>
> and compared gcc invocation commands. Pseudodiff:
>
> - -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
> - -fno-common -pipe -msoft-float -mpreferred-stack-boundary=2
> - -march=i486 -I/.1/usr/srcdevel/kernel/linux-2.6.7-bk20.src/include/asm-i386/mach-default
> - -Iinclude/asm-i386/mach-default -O2 -falign-functions=1 -falign-labels=1 -falign-loops=1
> - -falign-jumps=1
> + -g -Wa,-a,-ad
>
> :(

This worked for me:

gcc -c -g -Wa,-a,-ad -Wp,-MD,fs/.buffer.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude
-Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -msoft-float
-mpreferred-stack-boundary=2 -march=athlon -Iinclude/asm-i386/mach-default -O2
-DKBUILD_BASENAME=buffer -DKBUILD_MODNAME=buffer fs/buffer.c

The order of the parameters matter in some way, which I have no idea of.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/