[U-Boot] arm64: No rule to make checkarmreloc

Hi Albert,
I have enabled SPL support for ARM64 target and make a build.
log: LD u-boot RELOC="`aarch64-linux-gnu-readelf -r -W u-boot | cut -d ' ' -f 4 | \ grep R_A | sort -u`"; \ if test "$RELOC" != "R_ARM_RELATIVE" -a \ "$RELOC" != "R_AARCH64_RELATIVE"; then \ echo "u-boot contains unexpected relocations: $RELOC"; \ false; \ fi OBJCOPY u-boot.srec OBJCOPY u-boot.bin start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot.bin 0x4000000000 $start $end CFG u-boot.cfg make[1]: *** No rule to make target `checkarmreloc', needed by `all'. Stop. make: *** [spl/u-boot-spl] Error 2
$ file u-boot u-boot: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
Does this an issue with ELF where relocation record other than R_ARM_RELATIVE or something, any help?
thanks!

On 14 July 2015 at 17:32, Jagan Teki jteki@openedev.com wrote:
Hi Albert,
I have enabled SPL support for ARM64 target and make a build.
log: LD u-boot RELOC="`aarch64-linux-gnu-readelf -r -W u-boot | cut -d ' ' -f 4 | \ grep R_A | sort -u`"; \ if test "$RELOC" != "R_ARM_RELATIVE" -a \ "$RELOC" != "R_AARCH64_RELATIVE"; then \ echo "u-boot contains unexpected relocations: $RELOC"; \ false; \ fi OBJCOPY u-boot.srec OBJCOPY u-boot.bin start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot.bin 0x4000000000 $start $end CFG u-boot.cfg make[1]: *** No rule to make target `checkarmreloc', needed by `all'. Stop. make: *** [spl/u-boot-spl] Error 2
$ file u-boot u-boot: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
Does this an issue with ELF where relocation record other than R_ARM_RELATIVE or something, any help?
This is got fixed by adding CONFIG_SPL=y instead of defining in include/configs/*.h
thanks!

Hello Jagan,
On Tue, 14 Jul 2015 17:32:06 +0530, Jagan Teki jteki@openedev.com wrote:
Hi Albert,
I have enabled SPL support for ARM64 target and make a build.
log: LD u-boot RELOC="`aarch64-linux-gnu-readelf -r -W u-boot | cut -d ' ' -f 4 | \ grep R_A | sort -u`"; \ if test "$RELOC" != "R_ARM_RELATIVE" -a \ "$RELOC" != "R_AARCH64_RELATIVE"; then \ echo "u-boot contains unexpected relocations: $RELOC"; \ false; \ fi
Not sure why the above appears here; it should not be displayed at all.
OBJCOPY u-boot.srec OBJCOPY u-boot.bin start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot.bin 0x4000000000 $start $end CFG u-boot.cfg make[1]: *** No rule to make target `checkarmreloc', needed by `all'. Stop. make: *** [spl/u-boot-spl] Error 2
Note that the error message here is different from the one which the rule above may emit.
$ file u-boot u-boot: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
Does this an issue with ELF where relocation record other than R_ARM_RELATIVE or something, any help?
Since the error message is not the one which the relocation check may emit, this is not a relocation problem. You can check for yourself by executing:
$ aarch64-linux-gnu-readelf -r -W u-boot | cut -d ' ' -f 4 | \
grep R_A | sort -u
This should produce a single line:
R_AARCH64_RELATIVE
If it does, then the binary is fine (and I think it is).
The problem you have is with 'checkarmreloc' itself.
A git grep checkarmreloc shows only two instances in the source code:
Makefile:checkarmreloc: u-boot arch/arm/config.mk:ALL-y += checkarmreloc
The first occurrence is the definition of the 'checkarmreloc' target: it depends on u-boot and does the check about R_A*_RELATIVE. This definition has no effect until Make is instructed to actually build the target.
The second occurrence adds the checkarmreloc target to the list of targets to build -- but only if not doing an SP build. So how come it tried to build that target in your case?
The only way we can find is that you indicate which target you were actually building and what changes you made to mainline U-Boot to get it to build.
Can you make the exact source code available as a branch on a git repo somewhere, and also indicate the exact command line you used? If not, can you provide a complete log, possibly passing V=1 to your 'make' command?
thanks!
Jagan | openedev.
Amicalement,
participants (2)
-
Albert ARIBAUD
-
Jagan Teki