[llvm-dev] Problems using Clang with LLD on embedded ARM

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Sun Feb 26 14:49:10 PST 2017


On Sun, Feb 26, 2017 at 04:25:57PM -0600, Sean Vig via llvm-dev wrote:
> Thanks! I applied that patch and it links with -flto now, but it looks like
> there are now some other problems. First, it seems to be dropping things
> that I try to KEEP in the linker script, even when I don't use
> --gc-sections, namely my interrupt vector table. Second, when using thin
> LTO, it starts trying to link symbols __aeabi_memclr4 and __aeabi_uidiv,
> which I don't think it should since I am using -ffreestanding -fno-builtins
> when compiling (with full lto or no lto, it does not try to link these
> symbols).

You still need a runtime library, even with freestanding. Both
__aeabi_memclr4 and __aeabi_uidiv are helpers as defined by EABI and
their presence is required even with freestanding.

Joerg


More information about the llvm-dev mailing list