Firefly开源社区

打印 上一主题 下一主题

[人工智能] uboot编译工具链分析

101

积分

0

威望

0

贡献

技术小白

积分
101

uboot编译工具链分析

发表于 2018-5-29 15:22:48      浏览:8475 | 回复:0        打印      只看该作者   [复制链接] 楼主
我想搞清楚uboot的变异工具链使用的是哪一个,所以在makefile中添加了log,来确定make时所选用的编译工具链,但是看到编译log后,我蒙圈了,怎么会使用两个编译工具链呢。我添加的log如下:
ifeq ($(ARCHV),aarch64)

$(shell echo "ARCHV=aarch64" >&2;)

ifneq ($(wildcard ../toolchain/aarch64-linux-android-4.9),)
$(shell echo "CROSS_COMPILE == 0" >&2;)
CROSS_COMPILE   ?= $(shell pwd)/../toolchain/aarch64-linux-android-4.9/bin/aarch64-linux-android-
endif
ifneq ($(wildcard ../prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin),)
CROSS_COMPILE   ?= $(shell pwd)/../prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
$(shell echo "CROSS_COMPILE == 1" >&2;)

endif

else

ifneq ($(wildcard ../toolchain/arm-eabi-4.8),)
$(shell echo "CROSS_COMPILE == 2" >&2;)
CROSS_COMPILE   ?= $(shell pwd)/../toolchain/arm-eabi-4.8/bin/arm-eabi-
endif
ifneq ($(wildcard ../toolchain/arm-eabi-4.7),)
$(shell echo "CROSS_COMPILE == 3" >&2;)
CROSS_COMPILE   ?= $(shell pwd)/../toolchain/arm-eabi-4.7/bin/arm-eabi-
endif
ifneq ($(wildcard ../toolchain/arm-eabi-4.6),)
$(shell echo "CROSS_COMPILE == 4" >&2;)
CROSS_COMPILE   ?= $(shell pwd)/../toolchain/arm-eabi-4.6/bin/arm-eabi-
endif
ifneq ($(wildcard ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin),)
$(shell echo "CROSS_COMPILE == 5" >&2;)
CROSS_COMPILE   ?= $(shell pwd)/../prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-
endif
ifneq ($(wildcard ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin),)
$(shell echo "CROSS_COMPILE == 6" >&2;)
CROSS_COMPILE   ?= $(shell pwd)/../prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-
endif
ifneq ($(wildcard ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin),)
$(shell echo "CROSS_COMPILE == 7" >&2;)
CROSS_COMPILE   ?= $(shell pwd)/../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
endif

实际编译是输出的log如下:
ln@ln-machine:~/workplace/firefly/u-boot$ sudo make rk3128_defconfig
CROSS_COMPILE == 5
CROSS_COMPILE == 7
#
# configuration written to .config
#
ln@ln-machine:~/workplace/firefly/u-boot$ sudo make
CROSS_COMPILE == 5
CROSS_COMPILE == 7
CROSS_COMPILE == 5
CROSS_COMPILE == 7
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/config.h
  GEN     include/autoconf.mk
  GEN     include/autoconf.mk.dep
CROSS_COMPILE == 5
CROSS_COMPILE == 7
  CHK     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  HOSTCC  tools/dumpimage.o
  HOSTCC  tools/image-host.o
  HOSTCC  tools/loaderimage.o
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/mkimage.o
  HOSTLD  tools/mkenvimage
  HOSTLD  tools/dumpimage
  HOSTLD  tools/mkimage
  HOSTCC  tools/boot_merger
  HOSTLD  tools/loaderimage
  CC      board/rockchip/common/rkboot/fastboot.o
  LD      board/rockchip/common/built-in.o
  CC      board/rockchip/rk32xx/rk32xx.o
  LD      board/rockchip/rk32xx/built-in.o
  CC      common/main.o
  CC      common/board_f.o
  CC      common/cmd_version.o
  CC      common/cmd_fastboot.o
  CC      common/cmd_bootrk.o
  LD      common/built-in.o
  CC      lib/display_options.o
  LD      lib/built-in.o
  LD      u-boot
  OBJCOPY u-boot.bin
./tools/boot_merger ./tools/rk_tools/RKBOOT/RK3128MINIALL.ini && \
         \
        ./tools/loaderimage --pack u-boot.bin uboot.img
out:RK3128MiniLoaderAll.bin
fix opt:RK3128MiniLoaderAll_V2.25.bin
merge success(RK3128MiniLoaderAll_V2.25.bin)
pack input u-boot.bin
pack file size:340400
crc = 0x7dcb616d
uboot version:U-Boot 2014.10-RK3128-10 (May 29 2018 - 15:16:39)
pack uboot.img success!
  OBJCOPY u-boot.srec
求大神解惑。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表