Jeffrey Law <[email protected]> writes: > On 6/22/2026 10:24 AM, Peter Bergner wrote: >> On 6/22/26 8:47 AM, Jeffrey Law wrote: >>> On 6/21/2026 8:59 PM, Peter Bergner wrote: >>>> I downloaded musl, newlib and >>>> picolibc and their riscv setjmp functions do save all non-volatile >>>> registers, >>> I was thinking more along the lines of the changes which allow wholesale >>> replacement of the library that went in for picolibc IIRC. But I was >>> mistaken, those changes allow adding bits after the C library, not >>> wholesale replacement of the library. So ISTM the only worry would be >>> if setjmp was weak and could then be overridden by a routine in that >>> additional library. I don't think this is worth worrying about. >>> >>> So the original patch is fine by me. >> So keep the change limited to GLIBC only as in the original patch, even >> though we now know that musl, newlib, and picolibc do save & restore the >> non-volatile registers like GLIBC does? I can do that if you prefer. > I meant I don't think we need to worry about changing the C library > via command line options. So if we're configured for glibc, we know > we'll still be using glibc. Similarly for musl or the other > libraries. Thus if you've confirmed a particular library does the > right thing WRT setjmp, then I think we're free to handle that library > just like you're doing for glibc.
There are folks who do this often with musl (with 'musl-gcc', a wrapper that does exactly what you're describing). I'm not aware of anyone doing it otherwise (other libcs) these days. > > jeff sam
signature.asc
Description: PGP signature
