LLVM's LD.LLD Doesn't Understand BLOCK(4K)
Posted: Thu Dec 10, 2020 11:04 am
Dear All,
I've been trying to rebuild the X86 Bare Bones tutorial, but this time using LLVM toolchain instead of using GCC. Boot.s & kernel.c compiled, but when using linker (ld.lld), it says it doesn't understand BLOCK(4K). I've tried removing the BLOCK(4K) to just ALIGN (4K) in the linker.ld, which compiled this time, but when booted by QEMU (using GRUB) it's not recognized as multiboot and not loaded.
PS: Building it all using GCC cross-compile i686-elf was successful, not fuss on that, and booted correctly. Only using LLVM toolchain (clang & ld.lld) didn't end up as well as GCC.
2nd note: I used ld.lld directly (and indeed ld when compiling with GCC) instead via clang because my clang keeps using the native linker (ld.lld) and not the directed one (using GCC_EXEC_PREFIX, using PATH, using -B, all to no avail).
Has anyone experience compiling with LLVM before? Any help I can get? Thanks.
I've been trying to rebuild the X86 Bare Bones tutorial, but this time using LLVM toolchain instead of using GCC. Boot.s & kernel.c compiled, but when using linker (ld.lld), it says it doesn't understand BLOCK(4K). I've tried removing the BLOCK(4K) to just ALIGN (4K) in the linker.ld, which compiled this time, but when booted by QEMU (using GRUB) it's not recognized as multiboot and not loaded.
PS: Building it all using GCC cross-compile i686-elf was successful, not fuss on that, and booted correctly. Only using LLVM toolchain (clang & ld.lld) didn't end up as well as GCC.
2nd note: I used ld.lld directly (and indeed ld when compiling with GCC) instead via clang because my clang keeps using the native linker (ld.lld) and not the directed one (using GCC_EXEC_PREFIX, using PATH, using -B, all to no avail).
Has anyone experience compiling with LLVM before? Any help I can get? Thanks.