在编译u-boot-2016.05时出现如下问题:
解决办法:
搜索 “u-boot contains unexpected relocations”,没有搜索到任何内容,那么我们再尝试搜索checkarmreloc:
lvxiaoliang@lvxiaoliang-virtual-machine:~/Ftp/tmp/u-boot-2016.05$ grep "checkarmreloc" * -nR
arch/arm/config.mk:111:ALL-y += checkarmreloc
Makefile:1384:checkarmreloc: u-boot
在顶层Makefile中有如下语句:
#########################################################################
# ARM relocations should all be R_ARM_RELATIVE (32-bit) or
# R_AARCH64_RELATIVE (64-bit).
checkarmreloc: u-boot
@RELOC="`$(CROSS_COMPILE)readelf -r -W $< | cut -d ' ' -f 4 | \
grep R_A | sort -u`"; \
if test "$$RELOC" != "R_ARM_RELATIVE" -a \
"$$RELOC" != "R_AARCH64_RELATIVE"; then \
echo "$< contains unexpected relocations: $$RELOC"; \
false; \
fi
env: scripts_basic
$(Q)$(MAKE) $(build)=tools/$@
tools-only: scripts_basic $(version_h) $(timestamp_h)
$(Q)$(MAKE) $(build)=tools
tools-all: export HOST_TOOLS_ALL=y
tools-all: env tools ;
cross_tools: export CROSS_BUILD_TOOLS=y
cross_tools: tools ;
.PHONY : CHANGELOG
CHANGELOG:
git log --no-merges U-Boot-1_1_5.. | \
unexpand -a | sed -e 's/\s\s*$$//' > $@
#########################################################################
那么我们就别编译checkarmreloc了,所以我们注释掉arch/arm/config.mk的第111行:
#ALL-y += checkarmreloc
然后就能编译通过了