This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Allow IRIX Ada bootstrap with C++
Eric Botcazou <ebotcazou@adacore.com> writes:
>> 2011-07-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>>
>> * init.c [sgi] (__gnat_error_handler): Update sigaction(2) citation.
>> Correct argument types.
>> Extract code from reason.
>> (__gnat_install_handler): Assign to act.sa_sigaction.
>
> This breaks signal handling on our IRIX 6.5 machine though.
Same for me ;-( As already noted in the patch submission, there's
something fishy going on with the IRIX sighandler stuff:
gcc/ada/init.c (__gnat_install_handler) explicitly does not include
SA_SIGINFO in sa_flags, which means the handler only gets one arg, sig.
Still the installed handler (__gnat_error_handler) accesses args beyond
the first.
There are two possible solutions:
* Actually set SA_SIGINFO.
* Punt and cast the second __gnat_error_handler `arg' to an int.
Running under gdb, it seems that three args are really passed.
I prefer the first, since that's the clean solution. Unfortunately, my
question why the current code doesn't set SA_SIGINFO, yet cites a
considerable part of the man page about its effects, remained unanswered
when I submitted the patch.
Both solutions do work for a simple test of the 32-bit
null_pointer_deref1 test, but I'll have to perform a full testsuite run
and also adapt libjava/include/posix-signals.h. I remember that there
were problems when I set SA_SIGINFO there, so maybe irix6-unwind.h needs
updates to cope with that.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University