The problem is with linking bootaa64.efi. It seems the behaviour of lld-link differs between versions 12.0.1 and later, for instance, 14.0.6.kzinti wrote:Could you let me know what the issue with linking the bootloader was? Is there something I need to fix or document on my side to help people build it?
The lld-link command links boot.dir obj files with those in libmetal.a. The boot.dir obj files use symbols from obj files inside libmetal.a, but the linker isn't able to pull/find those symbols even though they are present.
A workaround is to modify the following line inside boot/src/CMakeLists.txt:
Code: Select all
#diff
-target_link_libraries(boot PRIVATE metal)
+target_link_libraries(boot PUBLIC metal)
With any of those workarounds, "make run" successfully builds the required components and launches qemu-system-aarch64.
Edit: The kernel too links with metal, but there the linker doesn't need any changes.
Edit2: The kernel is an ELF binary while bootaa64.efi is an EFI binary.