On Wed, Jun 10, 2020 at 12:40 AM Vincent Chen <
vincen...@sifive.com> wrote:
> Glibc. This may be a bit inconvenient. Hence, I think if the current
> implementation of Glibc riscv sigcontext.h is not for some reason,
> could we replace this self-defined sigcontext.h with the generic
> sigcontext.h? I know this may cause some Glibc backward compatible
> issues, but it really reduces the possibility of inconsistencies
> between these two files and saves synchronization work. Any feedback
> is welcome, I sincerely appreciate any time or comment made.
If you change the field names and types, then this will break programs
that use the sigcontext structure. In gcc for instance,
libgcc/config/riscv/linux-unwind.h uses sigcontext, and accesses the
gregs field. This is for doing stack unwinding (e.g. C++ exception
handling) from a signal handler frame. We can fix gcc if sigcontext
changes, but then new gcc sources won't build with old glibc sources,
and old gcc sources won't build with new glibc sources, which is
likely to cause trouble. Maybe we can add a glibc version test and
use the appropriate field names and types to fix this. Alittle
inconvenient but workable.
However, gcc is probably not the only program or library that uses the
sigcontext type. You would have to find and fix all of them. You
could trying doing an openembedded build with the glibc change, and
then try to build all packages that are ported to riscv to see how
many break. Just to get an indication of how big the problem is.
This won't identify end user codes that aren't part of linux though.
Each company that has a program they build for linux that uses
sigcontext would have to be fixed.
Jim