How to compile u-boot with debug option?

Chan Kim ckim at
Tue Oct 19 04:21:38 CEST 2021



With these commands,

make ARCH=arm CROSS_COMPILE=aarch64-none-elf- qemu_arm64_defconfig 

make ARCH=arm CROSS_COMPILE=aarch64-none-elf-

I see only u-boot.bin. How can I make u-boot.elf with debug info?

I found and
tried adding

-DDEBUG to CFLAGS_NON_EFI in arch/arm/ and adding CFLAGS += -DDEBUG
in arch/arm/cpu/armv8/

But after doing "make ARCH=arm CROSS_COMPILE=aarch64-none-elf- u-boot.elf",
when I give file command for the u-boot.elf, it says


u-boot.elf: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV),
statically linked, not stripped


I think I should see "with debug_info, not stripped". With connecting gdb, I
can't see the source file. The run responds to 'continue' command though.

Could any tell me what I can do?


Thank you,

Chan Kim


More information about the U-Boot mailing list