[libc-commits] [PATCH] D145584: [libc] Add support for setjmp and longjmp in riscv

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Mar 15 15:16:53 PDT 2023


sivachandra added a comment.

Sorry for the delay. Going by my godbolt experiments, the problem you seem to be addressing (you have already said it) is clang specific: https://godbolt.org/z/GxfMor1KM

I would really not use manually calculated offsets. Also, in the libc project, we really want to focus on cleanliness of the source code - if a compiler is missing an optimization, then the compiler should be fixed. So, I prefer the solution which does not involve manually calculating offsets. About `-fno-omit-frame-pointer`, I have no strong opinions. Feel free to use it or do the other way round of using `-fomit-frame-pointer` (this has the benefit that it will not require the naked attribute). For the build structuring, I would suggest separating out the target specific implementations into different files and adding target independent aliases to the target dependent entrypoints. Much like how linux specific implementations are added at other places: https://github.com/llvm/llvm-project/blob/main/libc/src/unistd/CMakeLists.txt#L5


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145584/new/

https://reviews.llvm.org/D145584



More information about the libc-commits mailing list