[libc-commits] [PATCH] D158640: [libc][riscv] Added support for rv32 in setjmp and longjmp

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Aug 23 12:39:57 PDT 2023


sivachandra added a comment.

In D158640#4611308 <https://reviews.llvm.org/D158640#4611308>, @aaron.ballman wrote:

> In D158640#4611291 <https://reviews.llvm.org/D158640#4611291>, @jrtc27 wrote:
>
>> You can likely get away with it then, but don't be surprised when it breaks... this will never be officially supported by the compiler
>
> I'd like to second this -- it seems pretty fragile that you need to compile this with very specific optimization flags in order for it to work, especially when there is a solution but it's prevented due to a policy of not allowing hand-written assembly files.

I totally appreciate the problem here. As I have said earlier, we are doing this with full appreciation of what can go wrong rather than just doing it because it happens to work.

About the requirement of a specific optimization flag for correctness, LLVM's libc is not the only libc requiring them. I do not remember which exact parts now, but many years ago when I was working with glibc, it required higher optimization levels to ensure correctness. Even within the libc project, `setjmp`/`longjmp` are not the only ones having this requirement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158640



More information about the libc-commits mailing list