I am trying to build a full LLVM+CLANG toolchain for compiling AArch64 baremetal applications.
I have used some guidance from Here and built CLANG+NEWLIB+COMPILER_RT+LIBUNWIND+LIBCXXABI+LIBCXX.
When trying to compile a simple c++ program I am getting many errors for undefined symbols such as:
From a little research I found that all those symbols are defined by the linker script. But I don’t see any linker scripts provided in LLVM source directory.
How can I handle this? Should I write my own linker script? If yes how do I know what is the correct way to handle those sections?
The linkerscripts tend to be specific to the C-library, and target used so I wouldn’t expect to see one in the LLVM directory. Usually an embedded toolchain will provide a sample linker script.
Some of these I do recognise, such as
__end. You can usually find a linker script from a GNU bare-metal toolchain, and in some cases you can dump the internal linker script from GNU ld.bfd with the
I can see that
__eh_frame_end could be defined by a linker script. I’m not convinced about
__libunwind_Registers_arm64_jumpto those are functions that are defined by libunwind. Perhaps libunwind isn’t being linked in or it hasn’t built properly.