I suggest that we checkin this patch as a separate patch for now with 
appropriate README entry. It's basically a gcc bug, so the right place to fix 
it would be gcc itself.

Does anyone think it more appropriate for core.patch?
-Amit

On Monday 11 September 2006 13:32, Milind Dumbare wrote:
>       Attached patch moves weak definitions from kernel/kgdb.c to
> kernel/kgdbarchlib.c to get rid of gcc 4.1 bug.
>
> On Mon, 2006-05-22 at 16:40 -0700, George Anzinger wrote:
> > Tom Rini wrote:
> > > On Mon, May 22, 2006 at 09:24:32PM +0200, Jan Kiszka wrote:
> > >>Hi,
> > >>
> > >>I stumbled over some issue of kgdb in combination with gcc 4.1 since
> > >>kernel 2.6.16. The background can be found in [1]. It melts down that
> > >>the default arch-dependent functions in kernel/kgdb.c got compiled in -
> > >>and immediately optimised out again. The effect is, of course, lethal.
> > >>
> > >>As a workaround I added "CFLAGS_kgdb.o += -fno-unit-at-a-time" to
> > >>kernel/Makefile, but I'm not sure if this is the preferred solution
> > >>here. Alternatives might be to move all default arch-stubs into a
> > >>separate object file, thus giving the linker the chance again to handle
> > >>them, or to use #ifndef KGDB_HAVE_ARCH_xxx constructs.
> > >
> > > This sounds kind of like a gcc bug.  If you have the message from
> > > Florian Weimer could you please bounce me a copy?  I'd like to verify
> > > that the correct solution to this problem is roughly:
> > > 1) kgdb.h includes weak declarations
> > > 2) kernel/kgdb.c does not provide any copy of the function
> > > 3) arch/$ARCH/kernel/kgdb.c may or may not provide the function
> > > and finally
> > > 4) There's a way to get the desired behavior out of both gcc-4.1 and
> > > gcc-3.3 at least.  Thanks!
> >
> > I think you also need to provide a library of weak functions, it just
> > needs to be in a different *.c so gcc doesn't see it and conclude that it
> > can drop it.  I.e. the linker needs to see both the real arch version and
> > the weak version.
> >
> > One wonders what gcc would do if the weak module was not empty...

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to