https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Stas Sergeev from comment #5) > (In reply to Andrew Pinski from comment #4) > > (In reply to Stas Sergeev from comment #3) > > > The signal handler needs to do the following things: > > > 1. Restore segment registers (init_handler() func) > > > > Why are you doing this, that is the question I am trying to understand here. > > What signal handler is happening? > Ah, OK. > This is a jit compiler. > It uses segment registers at will, and it uses > a memory protection too, so the signal is SIGSEGV. That seems bogus usage really. And very unportable. Don't use segment registers at all. > > > Because you can't do this under Linux at > > all. > What exactly do you mean? > > > I am also trying to understand if you are writing a kernel/userspace why you > > can't write this part in pure assembly function instead of using GCC here to > > do this work. > How am I supposed to access TLS in asm? > init_handler() itself is mostly in asm though, yes. > But the main sighandler is a huge convoluted func.