elks
elks copied to clipboard
elf.c:34:18: error: use of undeclared identifier 'LIBELF_ARCH'
after make menuconfig; make clean; make
the build process stops at cd lib/elftoolchain-0.7.1/libelf; do gcc -Wall -I/Users/jayne/Development/ws-git/elks/include -I/Users/jayne/Development/ws-git/elks/elks/include -I/Users/jayne/Development/ws-git/elks/elks/tools/elf2elks/lib/elftoolchain-0.7.1/libelf -I/Users/jayne/Development/ws-git/elks/elks/tools/elf2elks/lib/elftoolchain-0.7.1/common -D__KERNEL__ -c -I. -I../common "$src"; done;
elf.c:34:18: error: use of undeclared identifier 'LIBELF_ARCH' .libelf_arch = LIBELF_ARCH, ^ elf.c:35:22: error: use of undeclared identifier 'LIBELF_BYTEORDER' .libelf_byteorder = LIBELF_BYTEORDER, ^ elf.c:36:19: error: use of undeclared identifier 'LIBELF_CLASS' .libelf_class = LIBELF_CLASS, ^
I dont know myself how to use the files.That may help:
_libelf_config.h
#if defined(amd64) #define LIBELF_ARCH EM_X86_64 #define LIBELF_BYTEORDER ELFDATA2LSB #define LIBELF_CLASS ELFCLASS64 #elif defined(i386) #define LIBELF_ARCH EM_386 #define LIBELF_BYTEORDER ELFDATA2LSB #define LIBELF_CLASS ELFCLASS32 +#elif defined(aarch64) +#define LIBELF_ARCH EM_AARCH64 +#define LIBELF_BYTEORDER ELFDATA2LSB +#define LIBELF_CLASS ELFCLASS64 #endif
after that fix i can get the image: qemu-system-x86_64 -drive format=raw,file=image/fd1440.img,if=floppy
Hello @anchorz,
Thanks for the fix for building elf2elks
on M1. I'll look into add this as a patch to the build, since the elf2elks source is pulled from a specific external commit rather than being held resident in this repository.
Thank you!
can you just simply add the patch in ELKS repository?
can you just simply add the patch in ELKS repository?
Yes, thank you. I plan to do that.