From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111163 invoked by alias); 22 Sep 2016 13:32:38 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 110904 invoked by uid 89); 22 Sep 2016 13:32:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: Yes, score=6.3 required=5.0 tests=AWL,BAYES_50,FOREIGN_BODY,RCVD_IN_DNSWL_NONE,SPF_PASS,T_FILL_THIS_FORM_SHORT autolearn=no version=3.3.2 spammy=diese, Nachricht, nachricht, keine X-Spam-User: qpsmtpd, 2 recipients X-HELO: dedi548.your-server.de Received: from dedi548.your-server.de (HELO dedi548.your-server.de) (85.10.215.148) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Sep 2016 13:32:27 +0000 Received: from [88.198.220.130] (helo=sslproxy01.your-server.de) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1bn46y-0002XI-DH; Thu, 22 Sep 2016 15:32:24 +0200 Received: from [82.135.62.35] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bn46y-0005iw-2W; Thu, 22 Sep 2016 15:32:24 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 25F9B2A01AE; Thu, 22 Sep 2016 15:32:51 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id VfwoLx_pbm5v; Thu, 22 Sep 2016 15:32:48 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 790E52A180A; Thu, 22 Sep 2016 15:32:48 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id FhrrIukWDOeC; Thu, 22 Sep 2016 15:32:48 +0200 (CEST) Received: from [192.168.96.129] (unknown [192.168.96.129]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 28D1A2A01AE; Thu, 22 Sep 2016 15:32:48 +0200 (CEST) Subject: Re: [PATCH v2] [RTEMS] Always use atomic builtins for libstdc++ To: joel@rtems.org References: <1474534063-8867-1-git-send-email-sebastian.huber@embedded-brains.de> Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org, "rtems-devel@rtems.org" From: Sebastian Huber Message-ID: <57E3DD63.2010800@embedded-brains.de> Date: Thu, 22 Sep 2016 13:40:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg01550.txt.bz2 On 22/09/16 15:25, Joel Sherrill wrote: > /The target pattern in the commit message doesn't look right. > It should be *-*-rtems* I think. It should be ok since host_os is used: # It uses the following shell variables as set by config.guess: # host The configuration host (full CPU-vendor-OS triplet) # host_cpu The configuration host CPU # host_os The configuration host OS > > Do all BSPs for m68k build with C++ enabled? Yes, but I face currently some other problems with GCC 7: https://gcc.gnu.org/ml/gcc/2016-09/msg00114.html There is also a NULL pointer access in wctob() with the latest Newlib. > > What code is used for atomic operations on say a 68000 or > 68020? They use the libatomic if the atomic operations are not supported by=20 hardware. libatomic uses _Libatomic_Protect_start() and=20 _Libatomic_Protect_end() on RTEMS. > > Thanks. > > --joel > > On Thu, Sep 22, 2016 at 3:47 AM, Sebastian Huber=20 > > wrote: > > v2: Fix shell script part since shell grouping is expressed by { }. > > libstdc++-v3/ > * config/cpu/m68k/atomicity.h: Adjust comment. > * acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Honor > explicit atomicity_dir setup via configure.host. > * configure.host (rtems-*): Set atomicity_dir. > * configure: Regenerate. > --- > libstdc++-v3/acinclude.m4 | 5 +++-- > libstdc++-v3/config/cpu/m68k/atomicity.h | 3 +++ > libstdc++-v3/configure | 11 ++++++----- > libstdc++-v3/configure.host | 4 ++++ > 4 files changed, 16 insertions(+), 7 deletions(-) > > diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 > index 6d897be..d7db435 100644 > --- a/libstdc++-v3/acinclude.m4 > +++ b/libstdc++-v3/acinclude.m4 > @@ -3490,9 +3490,10 @@ EOF > AC_LANG_RESTORE > > # Set atomicity_dir to builtins if all but the long long test > above passes. > - if test "$glibcxx_cv_atomic_bool" =3D yes \ > + if { test "$glibcxx_cv_atomic_bool" =3D yes \ > && test "$glibcxx_cv_atomic_short" =3D yes \ > - && test "$glibcxx_cv_atomic_int" =3D yes; then > + && test "$glibcxx_cv_atomic_int" =3D yes } \ > + || test "$atomicity_dir" =3D "cpu/generic/atomicity_builtins"; > then > AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS, 1, > [Define if the compiler supports C++11 atomics.]) > atomicity_dir=3Dcpu/generic/atomicity_builtins > diff --git a/libstdc++-v3/config/cpu/m68k/atomicity.h > b/libstdc++-v3/config/cpu/m68k/atomicity.h > index f421330..a9ddc6b 100644 > --- a/libstdc++-v3/config/cpu/m68k/atomicity.h > +++ b/libstdc++-v3/config/cpu/m68k/atomicity.h > @@ -48,6 +48,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > } > > #elif defined(__rtems__) > + // This code is only provided for reference. RTEMS uses now > the atomic > + // builtins and libatomic. See configure.host. > + // > // TAS/JBNE is unsafe on systems with strict priority-based > scheduling. > // Disable interrupts, which we can do only from supervisor mode. > _Atomic_word > diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure > index 6332c4d..d09a7e0 100755 > --- a/libstdc++-v3/configure > +++ b/libstdc++-v3/configure > @@ -15539,9 +15539,10 @@ ac_compiler_gnu=3D$ac_cv_c_compiler_gnu > > > # Set atomicity_dir to builtins if all but the long long test > above passes. > - if test "$glibcxx_cv_atomic_bool" =3D yes \ > + if { test "$glibcxx_cv_atomic_bool" =3D yes \ > && test "$glibcxx_cv_atomic_short" =3D yes \ > - && test "$glibcxx_cv_atomic_int" =3D yes; then > + && test "$glibcxx_cv_atomic_int" =3D yes } \ > + || test "$atomicity_dir" =3D "cpu/generic/atomicity_builtins"; > then > > $as_echo "#define _GLIBCXX_ATOMIC_BUILTINS 1" >>confdefs.h > > @@ -15573,7 +15574,7 @@ $as_echo "$as_me: WARNING: Performance of > certain classes will degrade as a resu > # unnecessary for this test. > > cat > conftest.$ac_ext << EOF > -#line 15576 "configure" > +#line 15577 "configure" > int main() > { > _Decimal32 d1; > @@ -15615,7 +15616,7 @@ ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu > # unnecessary for this test. > > cat > conftest.$ac_ext << EOF > -#line 15618 "configure" > +#line 15619 "configure" > template > struct same > { typedef T2 type; }; > @@ -15649,7 +15650,7 @@ $as_echo "$enable_int128" >&6; } > rm -f conftest* > > cat > conftest.$ac_ext << EOF > -#line 15652 "configure" > +#line 15653 "configure" > template > struct same > { typedef T2 type; }; > diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host > index c0cc3ee..eb56ab1 100644 > --- a/libstdc++-v3/configure.host > +++ b/libstdc++-v3/configure.host > @@ -296,6 +296,10 @@ case "${host_os}" in > os_include_dir=3D"os/qnx/qnx6.1" > c_model=3Dc > ;; > + rtems*) > + # Use libatomic if necessary and avoid libstdc++ specific > atomicity support > + atomicity_dir=3D"cpu/generic/atomicity_builtins" > + ;; > solaris2) > # This too-vague configuration does not provide enough > information > # to select a ctype include, and thus os_include_dir is a > crap shoot. > -- > 1.8.4.5 > > _______________________________________________ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel > > > --=20 Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG.