linuxカーネルビルド時のコマンドを確認する

カーネルビルド時に、どういうコンパイルオプションでgccが実行されているかを確認する必要がありましたので、メモを残しておきます。

方法は、makeV=1を付けるだけ。

% make V=1 uImage 2>&1 | tee build.log

このVは、kernel.orgのREADMEによるとVerboseモードのことを指していて、V=0/1/2のいずれかを設定できるとのこと。

  • Verbose kernel compile/build output:

Normally, the kernel build system runs in a fairly quiet mode (but not totally silent). However, sometimes you or other kernel developers need to see compile, link, or other commands exactly as they are executed. For this, use "verbose" build mode. This is done by inserting "V=1" in the "make" command. E.g.:

make V=1 all

To have the build system also tell the reason for the rebuild of each target, use "V=2". The default is "V=0".

何をしたかというと、得られた内容の-c-Sに変更して、アセンブラレベルでどういう処理に変換されているかを確認したかったのでした。

参考サイト