public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Iain Sandoe <iains.gcc@gmail.com>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>,
	gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 2/4] libstdc++: Adjust build of PCH files accounting configured host support.
Date: Fri, 5 Nov 2021 23:23:45 +0000	[thread overview]
Message-ID: <CACb0b4ncPbXiKjdoUnOZAK3WXuFjAX2pg=Gnf-gEdKE3osahFQ@mail.gmail.com> (raw)
In-Reply-To: <EB9AC754-904B-4877-AD17-94886712C10E@gmail.com>

On Thu, 4 Nov 2021 at 21:04, Iain Sandoe wrote:

> Well, I did try to CC it to this list ..
>
> > Begin forwarded message:
> >
> > From: Iain Sandoe via Gcc-patches <gcc-patches@gcc.gnu.org>
> > Subject: [PATCH 2/4] libstdc++: Adjust build of PCH files accounting
> configured host support.
> > Date: 4 November 2021 at 20:02:16 GMT
> > To: gcc-patches@gcc.gnu.org
> > Cc: Iain Sandoe <iains.gcc@gmail.com>
> > Reply-To: iain@sandoe.co.uk
> >
> > This takes account of the overall configuration for host PCH support
> > when deciding if we should build the libstdc++ PCH files.
> >
> > We now require both the support is configured and that we are hosted.
> > A non-fatal configure warning is given if the user attempts to
> > --disable-host-pch-support --enable-libstdcxx-pch since the latter
> > conflicts with the former (but does not prevent a useable libstdc++
> > library build).
>

This looks OK for trunk.



> >
> > Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> >
> > libstdc++-v3/ChangeLog:
> >
> >       * acinclude.m4: Account for configured host PCH support.
> >       * configure: Regenerate.
> >       * configure.ac: Act on --enable-host-pch-support.
> > ---
> > libstdc++-v3/acinclude.m4 | 49 ++++++++++++++++-----------
> > libstdc++-v3/configure    | 71 ++++++++++++++++++++++++++-------------
> > libstdc++-v3/configure.ac | 11 ++++--
> > 3 files changed, 86 insertions(+), 45 deletions(-)
> >
> > diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
> > index 90ecc4a87a2..87652306691 100644
> > --- a/libstdc++-v3/acinclude.m4
> > +++ b/libstdc++-v3/acinclude.m4
> > @@ -3225,7 +3225,7 @@ AC_DEFUN([GLIBCXX_ENABLE_WCHAR_T], [
> > ])
> >
> >
> > -dnl
> > +≈
> > dnl Check to see if building and using a C++ precompiled header can be
> done.
> > dnl
> > dnl --enable-libstdcxx-pch=yes
> > @@ -3240,29 +3240,40 @@ dnl Substs:
> > dnl  glibcxx_PCHFLAGS
> > dnl
> > AC_DEFUN([GLIBCXX_ENABLE_PCH], [
> > -  GLIBCXX_ENABLE(libstdcxx-pch,$1,,[build pre-compiled libstdc++
> headers])
> > +  dnl This is only allowed if host support is enabled, and we are
> hosted.
> > +  if test "$1" = "yes" && test "$2" = "yes"; then
> > +    can_pch=yes
> > +  else
> > +    can_pch=no
> > +  fi
> > +  GLIBCXX_ENABLE(libstdcxx-pch,$can_pch,,[build pre-compiled libstdc++
> headers])
> >   if test $enable_libstdcxx_pch = yes; then
> > -    AC_CACHE_CHECK([for compiler with PCH support],
> > -      [glibcxx_cv_prog_CXX_pch],
> > -      [ac_save_CXXFLAGS="$CXXFLAGS"
> > -       CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated"
> > -       AC_LANG_SAVE
> > -       AC_LANG_CPLUSPLUS
> > -       echo '#include <math.h>' > conftest.h
> > -       if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
> > +    if test "$2" != "yes"; then
> > +      glibcxx_cv_prog_CXX_pch=no
> > +      AC_MSG_WARN([PCH headers cannot be built since host PCH is
> disabled])
> > +    else
> > +      AC_CACHE_CHECK([for compiler with PCH support],
> > +        [glibcxx_cv_prog_CXX_pch],
> > +        [ac_save_CXXFLAGS="$CXXFLAGS"
> > +         CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated"
> > +         AC_LANG_SAVE
> > +         AC_LANG_CPLUSPLUS
> > +         echo '#include <math.h>' > conftest.h
> > +         if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
> >                         -o conftest.h.gch 1>&5 2>&1 &&
> >               echo '#error "pch failed"' > conftest.h &&
> >         echo '#include "conftest.h"' > conftest.cc &&
> >              $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ;
> > -       then
> > -      glibcxx_cv_prog_CXX_pch=yes
> > -       else
> > -      glibcxx_cv_prog_CXX_pch=no
> > -       fi
> > -       rm -f conftest*
> > -       CXXFLAGS=$ac_save_CXXFLAGS
> > -       AC_LANG_RESTORE
> > -      ])
> > +         then
> > +        glibcxx_cv_prog_CXX_pch=yes
> > +         else
> > +        glibcxx_cv_prog_CXX_pch=no
> > +         fi
> > +         rm -f conftest*
> > +         CXXFLAGS=$ac_save_CXXFLAGS
> > +         AC_LANG_RESTORE
> > +        ])
> > +    fi
> >     enable_libstdcxx_pch=$glibcxx_cv_prog_CXX_pch
> >   fi
> >
> >
> > diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
> > index 2d68b3672b9..ce82f16c859 100644
> > --- a/libstdc++-v3/configure.ac
> > +++ b/libstdc++-v3/configure.ac
> > @@ -103,7 +103,6 @@ if test "$enable_vtable_verify" = yes; then
> >   postdep_objects_CXX="${postdep_objects_CXX}
> ${glibcxx_builddir}/../libgcc/vtv_end.o"
> > fi
> >
> > -
> > # libtool variables for C++ shared and position-independent compiles.
> > #
> > # Use glibcxx_lt_pic_flag to designate the automake variable
> > @@ -147,8 +146,16 @@ GLIBCXX_ENABLE_HOSTED
> > # Enable descriptive messages to standard output on termination.
> > GLIBCXX_ENABLE_VERBOSE
> >
> > +# The current default is that PCH is supported by the host unless
> otherwise
> > +# stated.
> > +AC_ARG_ENABLE(host_pch_support,
> > +AS_HELP_STRING([--disable-host-pch-support],
> > +            [Disable host support for precompiled headers]),
> > +host_pch_support=$enableval,
> > +host_pch_support=yes)
> > +
> > # Enable compiler support that doesn't require linking.
> > -GLIBCXX_ENABLE_PCH($is_hosted)
> > +GLIBCXX_ENABLE_PCH($is_hosted, $host_pch_support)
> > GLIBCXX_ENABLE_THREADS
> > GLIBCXX_ENABLE_ATOMIC_BUILTINS
> > GLIBCXX_ENABLE_LOCK_POLICY
> > --
> > 2.24.3 (Apple Git-128)
> >
>
>

  parent reply	other threads:[~2021-11-05 23:24 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 20:02 [PATCH 0/4] config: Allow a host to opt out of PCH Iain Sandoe
2021-11-04 20:02 ` [PATCH 1/4] config: Add top-level flag to disable host PCH Iain Sandoe
2021-11-04 20:02   ` [PATCH 2/4] libstdc++: Adjust build of PCH files accounting configured host support Iain Sandoe
2021-11-04 20:02     ` [PATCH 3/4] libcpp: Honour a configuration without host support for PCH Iain Sandoe
2021-11-04 20:02       ` [PATCH 4/4] c-family, gcc: Allow configuring without " Iain Sandoe
     [not found]     ` <EB9AC754-904B-4877-AD17-94886712C10E@gmail.com>
2021-11-05 23:23       ` Jonathan Wakely [this message]
2021-11-05  9:42 ` [PATCH 0/4] config: Allow a host to opt out of PCH Richard Biener
2021-11-05  9:54   ` Jakub Jelinek
2021-11-05 10:31     ` Richard Biener
2021-11-05 15:25       ` Jakub Jelinek
2021-11-05 16:37         ` Iain Sandoe
2021-11-08  7:16           ` Richard Biener
2021-11-08  7:43             ` Iain Sandoe
2021-11-08 11:46           ` Jakub Jelinek
2021-11-08 19:48             ` [PATCH] pch: Add support for PCH for relocatable executables Jakub Jelinek
2021-11-08 21:03               ` John David Anglin
2021-11-09  9:50                 ` Jakub Jelinek
2021-11-09  7:12               ` Richard Biener
2021-11-09  8:07                 ` Iain Sandoe
2021-11-09 11:40                   ` Iain Sandoe
2021-11-09 12:18                     ` Jakub Jelinek
2021-11-10  8:14                       ` Iain Sandoe
2021-11-10 20:24                         ` Iain Sandoe
2021-11-13 20:32                           ` Iain Sandoe
2021-11-16  8:52                             ` Jakub Jelinek
2021-11-09  9:44                 ` Jakub Jelinek
2021-11-09 11:32                   ` Jakub Jelinek
2021-11-09 12:03                     ` Richard Biener
2021-11-09 12:29                       ` Jakub Jelinek
2021-11-09 14:41                         ` Andrew MacLeod
2021-11-09 14:58                           ` Jakub Jelinek
2021-11-09 15:23                             ` Andrew MacLeod
2021-11-09 15:28                               ` Jakub Jelinek
2021-11-09 18:29                                 ` [COMMITTED] Keep x_range_query NULL for global ranges Andrew MacLeod
2021-11-18  8:04               ` [PATCH] pch, v2: Add support for PCH for relocatable executables Jakub Jelinek
2021-12-02 18:26                 ` Jeff Law
2021-12-06 10:00                 ` Martin Liška
2021-12-06 10:23                   ` [committed] avr: Fix AVR build [PR71934] Jakub Jelinek
2021-12-06 11:28                     ` Martin Liška

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='CACb0b4ncPbXiKjdoUnOZAK3WXuFjAX2pg=Gnf-gEdKE3osahFQ@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iains.gcc@gmail.com \
    --cc=libstdc++@gcc.gnu.org \
    /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).