<div dir="auto">Hello,<div dir="auto">I may be wrong here but i was getting something like this in old vers of clang.</div><div dir="auto"><br></div><div dir="auto">Id assume, pthread.a namely unwind.c is using api for unwinding thats incompatible with one provided by clang libs. Prolly assumed gcc model or windows api. Id check source of unwind.c and lookup+use or if absent implement exception api version thats compatible with clang. We will need to ask somebody else which clang lib provides this api. Documentation to clang might have some hints too.</div><div dir="auto"><br></div><div dir="auto">Best regards,</div><div dir="auto">Pawel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">sob., 1.05.2021, 03:47 użytkownik Andrei Datcu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> napisał:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>I'm trying to cross compile an executable that's using pthread. Target is armv7-linux-gnueabihf. I'm using the latest raspberry pi os as sysroot. I've managed to successfully build llvm, clang + all the runtimes and I'm trying to build a statically linked executable that's using as less GNU stuff as possible.</div><div><br></div><div>clang++ -sysroot=...  -stdlib=libc++ --rtlib=compiler-rt -static -resource-dir ... -fuse-ld=lld -lc++abi -lunwind test.cpp</div><div><br></div><div>The linker error I'm getting is:</div><div><br></div><div>ld.lld: error: undefined symbol: _Unwind_ForcedUnwind<br>>>> referenced by unwind.c:121<br>>>>               unwind.o:(__pthread_unwind) in archive path-to-sysroot/usr/lib/arm-linux-gnueabihf/libpthread.a</div><div><br></div><div>Peeking at libunwind's internals, it seems clear there's no 
_Unwind_ForcedUnwind built for ARM (at least not with default options). What options do I have?</div><div><br></div><div>1) Should I add some options when building libunwind so I get 
_Unwind_ForcedUnwind? I'm not sure this is even possible</div><div>2) Use libgcc?</div><div><br></div><div>Thanks,</div><div>Andrei<br></div><div><br>

</div></div>
_______________________________________________<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>
</blockquote></div>