howto get kernel preprocessor output

Daniel Thompson daniel.thompson at linaro.org
Tue Mar 24 15:17:04 UTC 2015


On 24/03/15 15:13, pleasurefish wrote:
> would you pls tell me the details,  :)

You added V=1 to the kernel build flags which causes the build system to 
show the commands it is executing.

Then you find the specific command you want to see the pre-processed 
output for; copy it, add -E and run it by hand.

That's it!


Daniel.

> At 2015-03-24 22:04:55, "Daniel Thompson" <daniel.thompson at linaro.org> wrote:
>> On 24/03/15 14:02, pleasurefish wrote:
>>> hi all,
>>>
>>> i'm porting the mali driver on the latest linux kernel. but it cannot work.
>>> firstly, i thought maybe i should check that the preprocessor output be
>>> the same under different linux kernel verison.
>>>
>>> as gcc could use the -E options to get the preprocess output.
>>> after reading in the Document/kbuild/kbuild.txt, modules.txt.
>>> KCPPFLAGS=-E was set in the KDIR/Makefile, but the preprocessors output
>>> couldn't get in the *.o.
>>>
>>> is that right?
>>> or is there any quick way to get the preprocessor output.
>>
>> I do it the very dumb way!
>>
>> I build with V=1 and then copy the resulting line, slap on a -E and run
>> it outside of make.
>>
>>
>> Daniel.





More information about the linaro-android mailing list