1. include/generated/asm-offsets.h 和 include/generated/asm-offsets.h的生成
CC spl/./lib/asm-offsets.s
UPD spl/./include/generated/generic-asm-offsets.h
CC spl/./arch/arm/lib/asm-offsets.s
UPD spl/./include/generated/asm-offsets.h
2. spl/arch/arm/mach-s3c64xx soc相关代码
3. spl/arch/arm/cpu 架构,微架构代码
4. arch/arm/cpu/arm1176/start.S reset符号在的文件
5. spl/arch/arm/lib arm架构通用库
6. spl/board/samsung/ok6410a/ok6410a.c 板级相关代码
7. 板级库 spl/board/samsung/ok6410a/lowlevel_init.S spl/board/samsung/ok6410a/bl2_mmc_copy.c (链接脚本中指明了链接)
8. spl/common/spl spl 通用库1
9. spl/common/init spl 通用init
10.spl/lib spl 通用库2
10.spl/disk 块驱动
11.spl/drivers/block 块驱动
12.spl/drivers/serial 串口驱动
13.spl/fs 文件系统
14.spl/u-boot-spl.lds 链接脚本的生成
15.spl/u-boot-spl 根据链接脚本 链接 1-13(目录一般对应built-in.o) ,生成spl/u-boot-spl
16.其他镜像相关文件 u-boot-spl-nodtb.bin/u-boot-spl.bin/u-boot-spl.sym
以上过程分成x种
1. include/generated/asm-offsets.h 的生成
2. .o文件的生成
3. built-in.o 的生成
4. 链接脚本spl/u-boot-spl.lds的生成
5. spl/u-boot-spl 的生成
6. 其他镜像相关文件的生成
过程分类
- 1 include/generated/asm-offsets.h 和 include/generated/generic-asm-offsets.h 的生成
make -f ../scripts/Makefile.build obj=spl/.
arm-linux-gnueabi-gcc -Wp,-MD,spl/./lib/.asm-offsets.s.d -nostdinc -isystem /home/suws/ok6410/system-new/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/7.4.1/include -Ispl/include -Iinclude -I../include -I../arch/arm/include -include ../include/linux/kconfig.h -I../. -Ispl/. -D__KERNEL__ -D__UBOOT__ -DCONFIG_SPL_BUILD -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -g -fstack-usage -Wno-format-nonliteral -Wno-unused-but-set-variable -Werror=date-time -ffunction-sections -fdata-sections -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -march=armv5t -D__LINUX_ARM_ARCH__=6 -I../arch/arm/mach-s3c64xx/include -DDO_DEPS_ONLY -DKBUILD_BASENAME='"asm_offsets"' -DKBUILD_MODNAME='"asm_offsets"' -fverbose-asm -S -o spl/./lib/asm-offsets.s ../lib/asm-offsets.c
set -e; mkdir -p spl/./include/generated/; (set -e; echo "#ifndef __GENERIC_ASM_OFFSETS_H__"; echo "#define __GENERIC_ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne "s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; echo ""; echo "#endif" ) < spl/./lib/asm-offsets.s > spl/./include/generated/generic-asm-offsets.h.tmp; if [ -r spl/./include/generated/generic-asm-offsets.h ] && cmp -s spl/./include/generated/generic-asm-offsets.h spl/./include/generated/generic-asm-offsets.h.tmp; then rm -f spl/./include/generated/generic-asm-offsets.h.tmp; else : ' UPD spl/./include/generated/generic-asm-offsets.h'; mv -f spl/./include/generated/generic-asm-offsets.h.tmp spl/./include/generated/generic-asm-offsets.h; fi
arm-linux-gnueabi-gcc -Wp,-MD,spl/./arch/arm/lib/.asm-offsets.s.d -nostdinc -isystem /home/suws/ok6410/system-new/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/7.4.1/include -Ispl/include -Iinclude -I../include -I../arch/arm/include -include ../include/linux/kconfig.h -I../. -Ispl/. -D__KERNEL__ -D__UBOOT__ -DCONFIG_SPL_BUILD -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -g -fstack-usage -Wno-format-nonliteral -Wno-unused-but-set-variable -Werror=date-time -ffunction-sections -fdata-sections -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -march=armv5t -D__LINUX_ARM_ARCH__=6 -I../arch/arm/mach-s3c64xx/include -DDO_DEPS_ONLY -DKBUILD_BASENAME='"asm_offsets"' -DKBUILD_MODNAME='"asm_offsets"' -fverbose-asm -S -o spl/./arch/arm/lib/asm-offsets.s ../arch/arm/lib/asm-offsets.c
set -e; mkdir -p spl/./include/generated/; (set -e; echo "#ifndef __ASM_OFFSETS_H__"; echo "#define __ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne "s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; echo ""; echo "#endif" ) < spl/./arch/arm/lib/asm-offsets.s > spl/./include/generated/asm-offsets.h.tmp; if [ -r spl/./include/generated/asm-offsets.h ] && cmp -s spl/./include/generated/asm-offsets.h spl/./include/generated/asm-offsets.h.tmp; then rm -f spl/./include/generated/asm-offsets.h.tmp; else : ' UPD spl/./include/generated/asm-offsets.h'; mv -f spl/./include/generated/asm-offsets.h.tmp spl/./include/generated/asm-offsets.h; fi
两个文件生成过程类似,以 include/generated/asm-offsets.h 为例
arm-linux-gnueabi-gcc
-Wp,-MD,spl/./lib/.asm-offsets.s.d
-nostdinc
-isystem /home/suws/ok6410/system-new/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/7.4.1/include
-Ispl/include -Iinclude -I../include -I../arch/arm/include -include ../include/linux/kconfig.h -I../. -Ispl/.
-D__KERNEL__ -D__UBOOT__ -DCONFIG_SPL_BUILD
-Wall
-Wstrict-prototypes
-Wno-format-security
-fno-builtin
-ffreestanding
-std=gnu11
-fshort-wchar
-fno-strict-aliasing
-fno-PIE
-Os
-fno-stack-protector
-fno-delete-null-pointer-checks
-Wno-maybe-uninitialized
-g
-fstack-usage
-Wno-format-nonliteral
-Wno-unused-but-set-variable
-Werror=date-time
-ffunction-sections
-fdata-sections
-D__ARM__
-marm
-mno-thumb-interwork
-mabi=aapcs-linux
-ffunction-sections
-fdata-sections
-fno-common
-ffixed-r9
-msoft-float
-pipe
-march=armv5t
-D__LINUX_ARM_ARCH__=6
-I../arch/arm/mach-s3c64xx/include
-DDO_DEPS_ONLY
-DKBUILD_BASENAME='"asm_offsets"'
-DKBUILD_MODNAME='"asm_offsets"'
-fverbose-asm
-S
-o spl/./lib/asm-offsets.s
../lib/asm-offsets.c
set -e;
mkdir -p spl/./include/generated/;
(
set -e;
echo "#ifndef __ASM_OFFSETS_H__";
echo "#define __ASM_OFFSETS_H__";
echo "/*";
echo " * DO NOT MODIFY.";
echo " *";
echo " * This file was generated by Kbuild";
echo " */";
echo "";
sed -ne "s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}";
echo "";
echo "#endif"
)
< spl/./arch/arm/lib/asm-offsets.s > spl/./include/generated/asm-offsets.h.tmp;
if [ -r spl/./include/generated/asm-offsets.h ] &&
cmp -s spl/./include/generated/asm-offsets.h spl/./include/generated/asm-offsets.h.tmp;
then
rm -f spl/./include/generated/asm-offsets.h.tmp;
else
: ' UPD spl/./include/generated/asm-offsets.h';
mv -f spl/./include/generated/asm-offsets.h.tmp spl/./include/generated/asm-offsets.h;
fi
- 2 .o文件的生成(以spl/arch/arm/cpu/arm1176/start.o为例)
arm-linux-gnueabi-gcc
-Wp,-MD,spl/arch/arm/cpu/arm1176/.start.o.d
-nostdinc
-isystem /home/suws/ok6410/system-new/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/7.4.1/include
-Ispl/include
-Iinclude
-I../include
-I../arch/arm/include
-include ../include/linux/kconfig.h
-D__KERNEL__
-D__UBOOT__
-DCONFIG_SPL_BUILD
-D__ASSEMBLY__
-fno-PIE
-g
-D__ARM__
-marm
-mno-thumb-interwork
-mabi=aapcs-linux
-ffunction-sections
-fdata-sections
-fno-common
-ffixed-r9
-msoft-float
-pipe
-march=armv5t
-D__LINUX_ARM_ARCH__=6
-I../arch/arm/mach-s3c64xx/include
-c -o spl/arch/arm/cpu/arm1176/start.o ../arch/arm/cpu/arm1176/start.S
- 3 built-in.o 的生成(以spl/arch/arm/mach-s3c64xx/built-in.o为例)
arm-linux-gnueabi-ld.bfd
-r
-o spl/arch/arm/mach-s3c64xx/built-in.o
spl/arch/arm/mach-s3c64xx/timer.o
spl/arch/arm/mach-s3c64xx/clock.o
spl/arch/arm/mach-s3c64xx/cpu.o
spl/arch/arm/mach-s3c64xx/cpu_init.o
- 4 链接脚本spl/u-boot-spl.lds的生成
arm-linux-gnueabi-gcc
-E
-Wp,-MD,spl/.u-boot-spl.lds.d
-D__KERNEL__
-D__UBOOT__
-DCONFIG_SPL_BUILD
-D__ARM__
-marm
-mno-thumb-interwork
-mabi=aapcs-linux
-ffunction-sections
-fdata-sections
-fno-common
-ffixed-r9
-msoft-float
-pipe
-march=armv5t
-D__LINUX_ARM_ARCH__=6
-I../arch/arm/mach-s3c64xx/include
-Ispl/include
-Iinclude
-I../include
-I../arch/arm/include
-include ../include/linux/kconfig.h
-nostdinc
-isystem /home/suws/ok6410/system-new/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/7.4.1/include
-include ../include/u-boot/u-boot.lds.h
-include ./include/config.h
-DCPUDIR=arch/arm/cpu/arm1176
-DIMAGE_TEXT_BASE=0x0C000000
-ansi
-D__ASSEMBLY__
-x assembler-with-cpp
-std=c99
-P
-o spl/u-boot-spl.lds
../board/samsung/ok6410a/u-boot-spl.lds
arm-linux-gnueabi-ld.bfd
-T u-boot-spl.lds
--gc-sections
-Bstatic
--gc-sections
--no-dynamic-linker
-Ttext 0x0C000000
arch/arm/cpu/arm1176/start.o
--start-group
arch/arm/mach-s3c64xx/built-in.o
arch/arm/cpu/arm1176/built-in.o
arch/arm/cpu/built-in.o
arch/arm/lib/built-in.o
board/samsung/ok6410a/built-in.o
board/samsung/common/built-in.o
common/spl/built-in.o
common/init/built-in.o
lib/built-in.o
disk/built-in.o
drivers/built-in.o
dts/built-in.o
fs/built-in.o
--end-group
arch/arm/lib/eabi_compat.o
arch/arm/lib/lib.a
-Map u-boot-spl.map
-o u-boot-spl
arm-linux-gnueabi-objcopy
-j .text
-j .secure_text
-j .secure_data
-j .rodata
-j .hash
-j .data
-j .got
-j .got.plt
-j .u_boot_list
-j .rel.dyn
-j .binman_sym_table
-j .text_rest
-j .dtb.init.rodata
-O binary
spl/u-boot-spl
spl/u-boot-spl-nodtb.bin
cp spl/u-boot-spl-nodtb.bin spl/u-boot-spl.bin
arm-linux-gnueabi-objdump
-t
spl/u-boot-spl > spl/u-boot-spl.sym
编译的目录
arch/arm/cpu/arm1176
arch/arm/cpu/arm1176/../arm11
arch/arm/lib
arch/arm/mach-s3c64xx
board/samsung/ok6410a
common/init
common/spl
disk
drivers/block
drivers/serial
fs
include/generated
lib