This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add missing emulated TLS support
AbandonedPublic

Authored by brad on May 14 2021, 1:14 PM.

Details

Summary

While getting OpenBSD/riscv64 up and running it was noticed that this bit of code to enable emulated TLS was missing from the RISC-V backend.

Diff Detail

Unit TestsFailed

Event Timeline

brad created this revision.May 14 2021, 1:14 PM
brad requested review of this revision.May 14 2021, 1:14 PM

Why should we bother to support this? Emulated TLS should die, not be supported by new architectures, IMO. We've had properly-defined TLS from the start.

brad added a comment.May 14 2021, 1:18 PM

OpenBSD requires the emulated TLS support.

You should really implement proper TLS. Emulated TLS is a lazy, inefficient hack.

+1. Please implement proper ELF TLS and drop reliance on emulated TLS. libclang_rt.builtins-$arch.a has some improper libc calls (e.g. malloc) just because of emutls.

I think we will soon be able to eliminate emutls in the LLVM code base.

brad added a comment.Feb 19 2022, 7:52 PM

You should really implement proper TLS. Emulated TLS is a lazy, inefficient hack.

I really wish that were the case. I have been asking the relevant developers for ages.

brad abandoned this revision.Feb 19 2022, 7:52 PM