<div dir="auto">Missed info from docs its already doable via flags. Updating my knowledge base. Hope it gets implemented soon.<div dir="auto"><br></div><div dir="auto">Br,</div><div dir="auto">Pawel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">sob., 1.05.2021, 04:23 użytkownik Fangrui Song <<a href="mailto:maskray@google.com">maskray@google.com</a>> napisał:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2021-05-01, pawel k. via llvm-dev wrote:<br>
>Hello,<br>
>I may be wrong here but i was getting something like this in old vers of<br>
>clang.<br>
><br>
>Id assume, pthread.a namely unwind.c is using api for unwinding thats<br>
>incompatible with one provided by clang libs. Prolly assumed gcc model or<br>
>windows api. Id check source of unwind.c and lookup+use or if absent<br>
>implement exception api version thats compatible with clang. We will need<br>
>to ask somebody else which clang lib provides this api. Documentation to<br>
>clang might have some hints too.<br>
><br>
>Best regards,<br>
>Pawel<br>
><br>
>sob., 1.05.2021, 03:47 użytkownik Andrei Datcu via llvm-dev <<br>
><a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a>> napisał:<br>
><br>
>> Hello,<br>
>><br>
>> I'm trying to cross compile an executable that's using pthread. Target is<br>
>> armv7-linux-gnueabihf. I'm using the latest raspberry pi os as sysroot.<br>
>> I've managed to successfully build llvm, clang + all the runtimes and I'm<br>
>> trying to build a statically linked executable that's using as less GNU<br>
>> stuff as possible.<br>
>><br>
>> clang++ -sysroot=... -stdlib=libc++ --rtlib=compiler-rt -static<br>
>> -resource-dir ... -fuse-ld=lld -lc++abi -lunwind test.cpp<br>
<br>
You can use --unwindlib=libunwind.<br>
<br>
-lc++abi -lunwind are technically not in the right place.<br>
It is ok for ld.lld, though.<br>
<br>
>> The linker error I'm getting is:<br>
>><br>
>> ld.lld: error: undefined symbol: _Unwind_ForcedUnwind<br>
>> >>> referenced by unwind.c:121<br>
>> >>> unwind.o:(__pthread_unwind) in archive<br>
>> path-to-sysroot/usr/lib/arm-linux-gnueabihf/libpthread.a<br>
>><br>
>> Peeking at libunwind's internals, it seems clear there's no<br>
>> _Unwind_ForcedUnwind built for ARM (at least not with default options).<br>
>> What options do I have?<br>
<br>
Pending patch adding _Unwind_ForcedUnwind for ARM EHABI<br>
<a href="https://reviews.llvm.org/D89570" rel="noreferrer noreferrer" target="_blank">https://reviews.llvm.org/D89570</a><br>
<br>
>> 1) Should I add some options when building libunwind so I get<br>
>> _Unwind_ForcedUnwind? I'm not sure this is even possible<br>
>> 2) Use libgcc?<br>
>><br>
>> Thanks,<br>
>> Andrei<br>
>><br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a><br>
>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
>><br>
<br>
>_______________________________________________<br>
>LLVM Developers mailing list<br>
><a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a><br>
><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div>