I am compiling a kernel for my raspberry pi (on the pi). I checked necessary configuration and enabled DEBUG_INFO=y and REDUCED_DEBUG=n.
But when I issue the command make I get the following error:
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
LD kernel/debug/kdb/built-in.o
kernel/debug/kdb/kdb_main.o: file not recognized: File truncated
scripts/Makefile.build:387: recipe for target 'kernel/debug/kdb/built-in.o' failed
make[3]: *** [kernel/debug/kdb/built-in.o] Error 1
scripts/Makefile.build:455: recipe for target 'kernel/debug/kdb' failed
make[2]: *** [kernel/debug/kdb] Error 2
scripts/Makefile.build:455: recipe for target 'kernel/debug' failed
make[1]: *** [kernel/debug] Error 2
Makefile:797: recipe for target 'kernel' failed
make: *** [kernel] Error 2
I could build my kernel and reboot it properly without the DEBUG_INFO etc. ( actually I had forgot to enable them) and I could load a module also.
How can I enable debugging feature and make this build. I Intend to write gpio drivers later.
Edit: Comment:
The Makefile has following for DEBUG_INFO:
ifdef CONFIG_DEBUG_INFO
KBUILD_CFLAGS += -g
KBUILD_AFLAGS += -gdwarf-2
endif
ifdef CONFIG_DEBUG_INFO_REDUCED
KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \
$(call cc-option,-fno-var-tracking)
endif
But I don't get it...what is this -femit-struct-debug-baseonly, -fno-var-tracking