Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bionic/: implement TLSDESC (Documented in psabi; implemented in llvm) #3

Closed
enh-google opened this issue Jan 30, 2023 · 9 comments
Closed

Comments

@enh-google
Copy link
Collaborator

risc-v is the first Android ABI to ship after we added ELF TLS support. emutls doesn't even seem to work (with LLVM at least) for risc-v, but we can't go straight to using TLSDESC relocations because they haven't been standardized for risc-v yet. blocked on riscv-non-isa/riscv-elf-psabi-doc#94 getting some traction.

@MaoHan001
Copy link

What is the current status of TLS support? Recently, llvm received a fix for emulate_tls on RISC-V. But in AOSP emulate_tls is currently disabled on RISC-V, it seems the traditional GD/LD TLS mode is being used; and it appears that someone in the community has started to support TLS DESC in llvm so all that's needed going forward is to update the tools and enable relocation support in Bionic once llvm support is available?

@enh-google
Copy link
Collaborator Author

What is the current status of TLS support? Recently, llvm received a fix for emulate_tls on RISC-V. But in AOSP emulate_tls is currently disabled on RISC-V, it seems the traditional GD/LD TLS mode is being used;

correct. we don't want to use emutls for rv64 --- we'll use the best option available, which is currently the one you mention.

and it appears that someone in the community has started to support TLS DESC in llvm so all that's needed going forward is to update the tools and enable relocation support in Bionic once llvm support is available?

yeah, i'm excited to see some progress on that. the bionic work will be easy+quick once the details are fixed. (i'm assuming the same will be true for llvm too, given that other architectures already support it.)

but for now we're blocked on the TLS DESC psabi proposal.

@enh-google enh-google changed the title bionic/: implement TLSDESC (not yet in psabi) bionic/: implement TLSDESC (in psabi; not yet in llvm) Sep 12, 2023
@appujee
Copy link
Collaborator

appujee commented Sep 14, 2023

jrguzman-ms pushed a commit to msft-mirror-aosp/platform.bionic that referenced this issue Sep 16, 2023
riscv-non-isa/riscv-elf-psabi-doc#94 was
merged.

Bug: google/android-riscv64#3
Test: treehugger
Change-Id: Ifc0c4d7408367f0372cec969d4ee6f84699bee30
@appujee
Copy link
Collaborator

appujee commented May 8, 2024

Support for RISC-V TLSDESC Relocations has landed in llvm: llvm/llvm-project#66916 Thanks to @ilovepi and @MaskRay

@appujee appujee changed the title bionic/: implement TLSDESC (in psabi; not yet in llvm) bionic/: implement TLSDESC (Documented in psabi; implemented in llvm) May 14, 2024
@enh-google
Copy link
Collaborator Author

@appujee --- is there anything left to do here? do we have a prebuilt clang where this is on by default?

@appujee
Copy link
Collaborator

appujee commented Nov 12, 2024

Yes the patch is in the current clang-r530567

@appujee appujee closed this as completed Nov 12, 2024
@appujee appujee reopened this Nov 12, 2024
@appujee
Copy link
Collaborator

appujee commented Nov 12, 2024

And enabled by default for Android targets in llvm/llvm-project#81198

@ilovepi
Copy link

ilovepi commented Nov 12, 2024

Yeah, TLSDESC should be on by default in Clang for all Android RISC-V targets. I don't think there's anything left to do, since we've resolved all the psABI issues, updated the compiler and linker, and bionic.

@enh-google
Copy link
Collaborator Author

yeah, and the only CTS test i can think of for arm64 already includes riscv64, so i don't think there's any extra tests to be written either? thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants