On Fri, Oct 24, 2003 at 12:56:55PM -0700, Adam Litke wrote:
> On Fri, 2003-10-24 at 11:39, Sam Ravnborg wrote:
> > Any chance the last two files can be compiled with -pg also
> > with a few changes?
> > I do not see why debugging info can harm here.
> 
> Functions inside files compiled with -pg get instrumented with a call to
> the symbol 'mcount' after the prologue.  If the file that defines the
> function mcount is compiled with -pg, you get stuck in infinite
> recursion because each call to mcount will trigger another call to
> mcount, etc.
That could be solved if you define mcount in assembly, thus preventing the
instrumentation.

> Also in misc.o, the mcount symbol is not visible and
> attempts to call it generate linker errors.  These are just two of the
> reasons why it is necesary. 
misc.o is special for sure.

Untested - but a solution could be to add -qt to both
CFLAGS_MODULE and CFLAGS_KERNEL
They should not be picked up by misc.o
Requires the following (white space damaged) patch

===== scripts/Makefile.build 1.41 vs edited =====
--- 1.41/scripts/Makefile.build Sun Oct  5 08:50:46 2003
+++ edited/scripts/Makefile.build       Fri Oct 24 23:47:43 2003
@@ -82,8 +82,8 @@
 # ---------------------------------------------------------------------------

 # Default is built-in, unless we know otherwise
-modkern_cflags := $(CFLAGS_KERNEL)
 quiet_modtag := $(empty)   $(empty)
+$(real-objs-y)        : modkern_cflags := $(CFLAGS_KERNEL)

 $(real-objs-m)        : modkern_cflags := $(CFLAGS_MODULE)
 $(real-objs-m:.o=.i)  : modkern_cflags := $(CFLAGS_MODULE)
@@ -191,7 +191,7 @@
 # Compile assembler sources (.S)
 # ---------------------------------------------------------------------------

-modkern_aflags := $(AFLAGS_KERNEL)
+$(real-objs-y)      : modkern_aflags := $(AFLAGS_KERNEL)

 $(real-objs-m)      : modkern_aflags := $(AFLAGS_MODULE)
 $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)


        Sam


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to