[llvm-dev] Help with setting up ARM embedded clang + lld

Sean Silva via llvm-dev llvm-dev at lists.llvm.org
Thu May 4 14:50:56 PDT 2017


On Thu, May 4, 2017 at 9:48 AM, Scott Shawcroft via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> On Wed, May 3, 2017, at 11:51 AM, Rui Ueyama wrote:
>
> On Wed, May 3, 2017 at 3:52 AM, Renato Golin <renato.golin at linaro.org>
> wrote:
>
> On 2 May 2017 at 23:59, Rui Ueyama <ruiu at google.com> wrote:
> > That's interesting. Usually your code wouldn't be gc'ed because your
> entire
> > code is reachable from _start.
>
> Baremetal doesn't need a _start.
>
>
> > Does your program depend on the feature that, if no -e option is given,
> the
> > linker sets the beginning of the .text section to the entry point
> address?
>
> I believe that would help, yes. But there may be linker scripts that
> can change that, so you need to be careful.
>
>
> If you want to do GC, you still need to teach linkers GC root symbols in
> some way, no? Otherwise, linkers cannot determine if a section is live or
> not.
>
>
> Yeah totally. I had marked some sections as used previously but haven't
> had a chance to look further into it. I'll try to take some time this
> weekend to poke at it further.
>
> The project I'm working on is here: https://github.com/tannewt/
> circuitpython/tree/clang/atmel-samd in case you can't wait.
>


Staring at the makefile, it seems like -flto is used, which might run into
the same "GC" related issue I was describing here about linker script KEEP
directives not being factored into the internalization logic with LTO:
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110582.html

I don't think we ever got a reproducer for that issue though. If removing
-flto fixes the GC issue (or the __attribute__((used)) workaround I
describe in the link works), could you add `--reproduce repro.tar` to your
LLD invocation and upload repro.tar in a bug report?

-- Sean Silva


> Thanks,
> Scott
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170504/c5ded284/attachment.html>


More information about the llvm-dev mailing list