Patchwork Use __cxa_atexit on OpenBSD

login
register
mail settings
Submitter Mark Kettenis
Date Sept. 15, 2012, 9:45 a.m.
Message ID <201209150945.q8F9j2ue023472@glazunov.sibelius.xs4all.nl>
Download mbox | patch
Permalink /patch/184073/
State New
Headers show

Comments

Mark Kettenis - Sept. 15, 2012, 9:45 a.m.
Split out from <http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00208.html>

Functionality was added in OpenBSD 4.3 and has been used by the system
compiler ever since.

Tested on i386-*-openbsd5.2 and amd64-*-openbsd5.2.  Changes a couple
of FAILs on constructor/destructor related tests into PASSes.


2012-09-02  Mark Kettenis  <kettenis@openbsd.org>

        * config.gcc (*-*-openbsd4.[3-9]|*-*-openbsd[5-9]*): Set
        default_use_cxa_atexit to yes.
Ian Taylor - Sept. 15, 2012, 10:37 p.m.
On Sat, Sep 15, 2012 at 2:45 AM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>
> 2012-09-02  Mark Kettenis  <kettenis@openbsd.org>
>
>         * config.gcc (*-*-openbsd4.[3-9]|*-*-openbsd[5-9]*): Set
>         default_use_cxa_atexit to yes.

This is OK.

Thanks.

Ian
Gerald Pfeifer - Oct. 3, 2012, 3:45 p.m.
On Sat, 15 Sep 2012, Ian Lance Taylor wrote:
>> 2012-09-02  Mark Kettenis  <kettenis@openbsd.org>
>>
>>         * config.gcc (*-*-openbsd4.[3-9]|*-*-openbsd[5-9]*): Set
>>         default_use_cxa_atexit to yes.
> This is OK.

I committed this to trunk and plan on doing so for the 4.7 branch
as well (so that OpenBSD can benefit from a release branch of GCC
carrying this) unless there are objections.

Gerald
Mark Kettenis - Oct. 4, 2012, 10:26 a.m.
> Date: Wed, 3 Oct 2012 17:45:21 +0200 (CEST)
> From: Gerald Pfeifer <gerald@pfeifer.com>
> 
> On Sat, 15 Sep 2012, Ian Lance Taylor wrote:
> >> 2012-09-02  Mark Kettenis  <kettenis@openbsd.org>
> >>
> >>         * config.gcc (*-*-openbsd4.[3-9]|*-*-openbsd[5-9]*): Set
> >>         default_use_cxa_atexit to yes.
> > This is OK.
> 
> I committed this to trunk and plan on doing so for the 4.7 branch
> as well (so that OpenBSD can benefit from a release branch of GCC
> carrying this) unless there are objections.

Thanks.  I won't object, although I'm not sure patching up the 4.7
branch is all that useful at this point given that it doesn't support
OpenBSD/amd64.

Any chance of getting the other diff that Ian approved

  <http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01070.html>

committed to trunk?

Thanks,

Mark
Gerald Pfeifer - Oct. 5, 2012, 9:41 p.m.
On Sat, 15 Sep 2012, Mark Kettenis wrote:
> Index: config.gcc
> ===================================================================
> --- config.gcc	(revision 191120)
> +++ config.gcc	(working copy)
> @@ -708,6 +708,11 @@
>      *-*-openbsd2.*|*-*-openbsd3.[012])
>        tm_defines="${tm_defines} HAS_LIBC_R=1" ;;
>    esac
> +  case ${target} in
> +    *-*-openbsd4.[3-9]|*-*-openbsd[5-9]*)
> +      default_use_cxa_atexit=yes
> +      ;;
> +  esac

By the way, as you add regular expressions like this, you may want
to make them more future proof.  This is something FreeBSD ran into
when the release policy was changed and FreeBSD 10 happened a lot
more quickly than originally expected.

Gerald
Mark Kettenis - Oct. 5, 2012, 10:22 p.m.
> Date: Fri, 5 Oct 2012 23:41:28 +0200 (CEST)
> From: Gerald Pfeifer <gerald@pfeifer.com>
> 
> On Sat, 15 Sep 2012, Mark Kettenis wrote:
> > Index: config.gcc
> > ===================================================================
> > --- config.gcc	(revision 191120)
> > +++ config.gcc	(working copy)
> > @@ -708,6 +708,11 @@
> >      *-*-openbsd2.*|*-*-openbsd3.[012])
> >        tm_defines="${tm_defines} HAS_LIBC_R=1" ;;
> >    esac
> > +  case ${target} in
> > +    *-*-openbsd4.[3-9]|*-*-openbsd[5-9]*)
> > +      default_use_cxa_atexit=yes
> > +      ;;
> > +  esac
> 
> By the way, as you add regular expressions like this, you may want
> to make them more future proof.  This is something FreeBSD ran into
> when the release policy was changed and FreeBSD 10 happened a lot
> more quickly than originally expected.

Fortunately OpenBSD releases are completely predictable: two releases
per year, and the version number gets increased by 0.1 every release.
And it is highly unlikely that this policy will ever be changed.  So
since 5.2 will be released on November 1st 2012, OpenBSD 9.9 will be
released on May 1st 2036.  I'd say that's future proof enough ;).
Gerald Pfeifer - Oct. 5, 2012, 11:26 p.m.
On Sat, 6 Oct 2012, Mark Kettenis wrote:
> Fortunately OpenBSD releases are completely predictable: two releases
> per year, and the version number gets increased by 0.1 every release.
> And it is highly unlikely that this policy will ever be changed.  So
> since 5.2 will be released on November 1st 2012, OpenBSD 9.9 will be
> released on May 1st 2036.  I'd say that's future proof enough ;).

That's what the FreeBSD guys thought and surprisingly many on GNU/Linux 
hardcoding 2.6.x -- until Linus woke up that one morning and created
Linux 3.0.  I'll remind you in June 2019. :-P

Gerald

Patch

Index: config.gcc
===================================================================
--- config.gcc	(revision 191120)
+++ config.gcc	(working copy)
@@ -708,6 +708,11 @@ 
     *-*-openbsd2.*|*-*-openbsd3.[012])
       tm_defines="${tm_defines} HAS_LIBC_R=1" ;;
   esac
+  case ${target} in
+    *-*-openbsd4.[3-9]|*-*-openbsd[5-9]*)
+      default_use_cxa_atexit=yes
+      ;;
+  esac
   ;;
 *-*-rtems*)
   case ${enable_threads} in