public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ramana Radhakrishnan <ramana.gcc@googlemail.com>
To: Andreas Tobler <andreast-list@fgznet.ch>
Cc: Richard Earnshaw <rearnsha@arm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][ARM] FreeBSD ARM support, EABI, v3
Date: Tue, 13 Jan 2015 10:44:00 -0000	[thread overview]
Message-ID: <CAJA7tRZBq0azkpEXi-JeHovYOCaxFKhjJ7HDM1F_z54qKLAJew@mail.gmail.com> (raw)
In-Reply-To: <54AEEDCE.8020302@fgznet.ch>

On Thu, Jan 8, 2015 at 8:51 PM, Andreas Tobler <andreast-list@fgznet.ch> wrote:
> On 08.01.15 17:27, Richard Earnshaw wrote:
>>
>> On 29/12/14 18:44, Andreas Tobler wrote:
>>>
>>> All,
>>>
>>> here is the third attempt to support ARM with FreeBSD.
>>>
>>> In the meantime we found another issue in the unwinder where I had to
>>> adapt some stuff.
>>>
>>> The unwind_phase2_forced function in libgcc calls a stop_fn function.
>>> This stop_fn is in FreeBSD's libthr implementation and is called
>>> thread_unwind_stop. This thread_unwind_stop is a generic function used
>>> on all FreeBSD archs.
>>>
>>> The issue is now that this thread_unwind_stop expects a double int for
>>> the exception_class, like on every other arch. For ARM EABI this
>>> exception_class is an array of char which is passed in one register as
>>> pointer vs. two registers for a double int.
>>>
>>> To solve this issue we defined the exception_class as double integer for
>>> FreeBSD.

My apologies for the slow response, some other work and then holidays
intervened.

From my understanding of the ABI document the implementation is
currently as mandated by the ABI. Also this isn't a part of the ABI
that's available for the platform (here FreeBSD to manipulate and
change as per it's wishes). ARM EHABI is special for software, making
FreeBSD more "special" for ARM appears to be counter intuitive from my
point of view. A number of exception unwinding libraries. for e.g.
libobjc , libstdc++ all use this implementation of exception_class.
Therefore this creates a divergence for the FreeBSD port which is
different from everything else. I expect that a number of language run
time support libraries that supported the ARM EHABI would be using
such an implementation, therefore you need to fix every single
implementation of this in every unwinder that supports the ARM EHABI
which I expect to have been ported to in a number of libraries
already. (I already see this in libobjc and libstdc++ in the GCC tree)

I would rather fix the thread_unwind_stop implementation in libthr for
ARM EHABI rather than make this change.


>>>
>>> This adaptation reduced the failure count in libstdc++ by about 40 fails.
>>>
>>> I build and test this port on a regular basis and I post the results to
>>> the usual place.

Thanks for doing this. I'm really glad that FreeBSD is finally moving to EABI.


regards
Ramana

>
>
> ...
>
>> Umm, sorry, just seen this update to the previous patch.
>>
>> The changes to the exception unwinding look a bit more involved.  Could
>> you separate that out into a separate patch, so that it's easier to see
>> what you're changing?
>
>
> Ok, here the mentioned part as separate diff. The comments are above. The CL
> below :)
>
> Thank you very much!
>
> Andreas
>
> gcc:
>
>         * ginclude/unwind-arm-common.h (_Uwind_Control_Block): Define
>         exception_class as double integer for FreeBSD ARM.
>         (_Unwind_Exception): Define _Unwind_Exception_Class as double
> integer
>         for FreeBSD ARM.
>
> libstc++-v3:
>
>
>         * libsupc++/unwind-cxx.h (__is_gxx_exception_class,
>         __is_dependent_exception): Exclude FreeBSD ARM from the
>         __ARM_EABI_UNWINDER__ ifdef.
>
>

  reply	other threads:[~2015-01-13 10:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-29 18:45 Andreas Tobler
2015-01-08 16:27 ` Richard Earnshaw
2015-01-08 20:51   ` Andreas Tobler
2015-01-13 10:44     ` Ramana Radhakrishnan [this message]
2015-01-13 21:11       ` Andreas Tobler
2015-01-14  9:54         ` Richard Earnshaw
2015-01-15 23:01           ` Andreas Tobler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJA7tRZBq0azkpEXi-JeHovYOCaxFKhjJ7HDM1F_z54qKLAJew@mail.gmail.com \
    --to=ramana.gcc@googlemail.com \
    --cc=andreast-list@fgznet.ch \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ramrad01@arm.com \
    --cc=rearnsha@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).