Re: [kbuild-devel] Clean alternative to $subst(...,...,$(CFLAGS))
On Mon, Oct 20, 2003 at 11:44:28AM -0700, Adam Litke wrote: I am working on a patch which requires all .c files to be compiled with the -pg option. However, there are two specific files for which -pg must not be used. Below is the current way I am accomplishing this. Hi Adam. I have tried to think of a better solution - and I see now easy and clean way to do this within kbuild. If you could convince the gcc people to implement -no-pg it would be easy. 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. 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
Re: [kbuild-devel] Clean alternative to $subst(...,...,$(CFLAGS))
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. 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. -- Adam Litke (agl at us.ibm.com) IBM Linux Technology Center (503) 578 - 3283 t/l 775 - 3283 --- 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
Re: [kbuild-devel] Clean alternative to $subst(...,...,$(CFLAGS))
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
[kbuild-devel] Clean alternative to $subst(...,...,$(CFLAGS))
I am working on a patch which requires all .c files to be compiled with the -pg option. However, there are two specific files for which -pg must not be used. Below is the current way I am accomplishing this. In the top-level Makefile: ifeq ($(CONFIG_MCOUNT),y) CFLAGS += -pg endif In sub Makefiles: ifeq ($(CONFIG_MCOUNT),y) $(obj)/mcount.o: $(CC) $(subst -pg,,$(CFLAGS)) -c -o $(obj)/mcount.o $(src)/mcount.c endif This method is broken and a dirty way to do it. Can anyone suggest a clean way to accomplish this? -- Adam Litke (agl at us.ibm.com) IBM Linux Technology Center (503) 578 - 3283 t/l 775 - 3283 --- This SF.net email sponsored by: Enterprise Linux Forum Conference Expo The Event For Linux Datacenter Solutions Strategies in The Enterprise Linux in the Boardroom; in the Front Office; in the Server Room http://www.enterpriselinuxforum.com ___ kbuild-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/kbuild-devel