EmbeddedRelated.com
Forums
Memfault Beyond the Launch

asflags while cross compiling a kernel module (wind river linux v4)

Started by Unknown January 13, 2014
Hello

I am trying to pass certain parameters to the wind river gnu assembler and I want this to apply only while compiling a certain module. Hence in the makefile for that module, Ive added the following:

#ppc_TARGET_FUNDAMENTAL_CFLAGS += -Wa,-alh=$<.s  
ppc_TARGET_FUNDAMENTAL_ASFLAGS += -alh=$<.s  

I had earlier tried passing them to the compiler during the compilation phase but it didn't work out so I tried to pass them directly to the assembler but this also does NOT seem to work :(.

Basically I want to tell the assembler to preserve the intermediate .S (or assembly language file) but it looks like it is not getting that message. I had earlier tried adding this to KBUILD_CFLAGS but then in the top level Makefile, it is recommended that one should NOT modify the 'native' Makefile in any way instead play around with the windriver 'enhanced' make variables hence my approach above.

Also as you can see, I am running this on the PowerPC architecture (if that helps). Ive even tried replacing ppc with ppc_e200v1 but that doesn't help either. I can see my module being compiled and the resulting .ko being generated but I cannot find the intermediate .s file anywhere.

keen for an answer.
On Sun, 12 Jan 2014 22:20:08 -0800 (PST), aijazbaig1.new@gmail.com
wrote:

>I am trying to pass certain parameters to the wind river gnu assembler and I want this to apply only while compiling a certain module. Hence in the makefile for that module, Ive added the following: > >#ppc_TARGET_FUNDAMENTAL_CFLAGS += -Wa,-alh=$<.s >ppc_TARGET_FUNDAMENTAL_ASFLAGS += -alh=$<.s > >I had earlier tried passing them to the compiler during the compilation phase but it didn't work out so I tried to pass them directly to the assembler but this also does NOT seem to work :(. > >Basically I want to tell the assembler to preserve the intermediate .S (or assembly language file) but it looks like it is not getting that message. I had earlier tried adding this to KBUILD_CFLAGS but then in the top level Makefile, it is recommended that one should NOT modify the 'native' Makefile in any way instead play around with the windriver 'enhanced' make variables hence my approach above. > >keen for an answer.
This is basic makefile processing. Try reading the manual. http://www.gnu.org/software/make/manual/make.html Hint: create specific targets for the .s and .o files that override the default .c.o processing (if you use default processing). mymodule.o : mymodule.s #commands to assemble .s file mymodule.s : mymodule.c #commands to compile to assembler
On Monday, January 13, 2014 12:42:23 PM UTC-8, George Neuner wrote:
> On Sun, 12 Jan 2014 22:20:08 -0800 (PST), aijazbaig1.new@gmail.com > > wrote: > > > > >I am trying to pass certain parameters to the wind river gnu assembler and I want this to apply only while compiling a certain module. Hence in the makefile for that module, Ive added the following: > > > > > >#ppc_TARGET_FUNDAMENTAL_CFLAGS += -Wa,-alh=$<.s > > >ppc_TARGET_FUNDAMENTAL_ASFLAGS += -alh=$<.s > > > > > >I had earlier tried passing them to the compiler during the compilation phase but it didn't work out so I tried to pass them directly to the assembler but this also does NOT seem to work :(. > > > > > >Basically I want to tell the assembler to preserve the intermediate .S (or assembly language file) but it looks like it is not getting that message. I had earlier tried adding this to KBUILD_CFLAGS but then in the top level Makefile, it is recommended that one should NOT modify the 'native' Makefile in any way instead play around with the windriver 'enhanced' make variables hence my approach above. > > > > > >keen for an answer. > > > > This is basic makefile processing. Try reading the manual. > > http://www.gnu.org/software/make/manual/make.html > > > > Hint: create specific targets for the .s and .o files that override > > the default .c.o processing (if you use default processing). > > > > mymodule.o : mymodule.s > > #commands to assemble .s file > > > > mymodule.s : mymodule.c > > #commands to compile to assembler
I do know that George. However, as you can see i'm using wind river linux and as such, wind river has created wrapper makefiles over and above the top level makefile of the kernel proper. The primary reason for sticking with the wind river makefile variables (and flag wrappers) is because I do not know what all options are being passed to the compiler via all these wind river specific wrappers. Besides I will then have to invoke the compiler with the very same options that are being passed to the compiler. Perhaps invoke the compiler directly using implicit rules and using CFLAGS, ASFLAGS and LDFLAGs directly in it? I could try doing that however if someone knows how to use wind river linux variables then it might be more acceptable to the management folks! Perhaps only setting the rule to create the assembly file without asking it to create the object file might give a hint to the compiler to do as we say and not destroy the intermediate .s file. Is it?

Memfault Beyond the Launch