查看内核文件的编译参数时, 可以先全编译一遍kernel. 然后在把要分析的那个文件生成出来的.o删掉再编译.
linux-2.6.29$ make
linux-2.6.29$ rm arch/mips/kernel/entry.o -f
linux-2.6.29$ make V=1 >abc.log 2>&
linux-2.6.29$ vi abc.log
vi查到编译选项:
mips_4KC-gcc -Wp,-MD,arch/mips/kernel/.entry.o.d -nostdinc -isystem /vobs/cots/winpath3_tools/tool_chain/eldk4mips_4.1/usr/bin/../lib/gcc/mips-linux/4.0.0/include -Iinclude -I/hix/she_iu_ngvdsl/kernel/linux-2.6.29_ts/arch/mips/include -include include/linux/autoconf.h -D__KERNEL__ -D__ASSEMBLY__ -ffunction-sections -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32r2 -Wa,-mips32r2 -Wa,--trap -I/hix/she_iu_ngvdsl/kernel/linux-2.6.29_ts/arch/mips/include/asm/mach-winpath -I/hix/she_iu_ngvdsl/kernel/linux-2.6.29_ts/arch/mips/include/asm/mach-generic -gdwarf-2 -c -o arch/mips/kernel/entry.o arch/mips/kernel/entry.S
加入 -E -dD.
mips_4KC-gcc -Wp,-MD,arch/mips/kernel/.entry.o.d -nostdinc -isystem /vobs/cots/winpath3_tools/tool_chain/eldk4mips_4.1/usr/bin/../lib/gcc/mips-linux/4.0.0/include -Iinclude -I/hix/she_iu_ngvdsl/kernel/linux-2.6.29_ts/arch/mips/include -include include/linux/autoconf.h -D__KERNEL__ -D__ASSEMBLY__ -ffunction-sections -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32r2 -Wa,-mips32r2 -Wa,--trap -I/hix/she_iu_ngvdsl/kernel/linux-2.6.29_ts/arch/mips/include/asm/mach-winpath -I/hix/she_iu_ngvdsl/kernel/linux-2.6.29_ts/arch/mips/include/asm/mach-generic -gdwarf-2 -c -E -dD -o arch/mips/kernel/entry.i arch/mips/kernel/entry.S
阅读(2408) | 评论(0) | 转发(0) |