On Wed, 4 Feb 2026 at 09:57, Jakub Jelinek <[email protected]> wrote:
>
> Hi!
>
> The following patch saves ~ 2.4GiB of disk space in x86_64-linux
> bootstrapped object directory:
> find obj80 -name \*.gch -a -type f | xargs du -shc | grep total
> 3.7G    total
> find obj82 -name \*.gch -a -type f | xargs du -shc | grep total
> 1.3G    total
> and ~ 800MiB for i686-linux:
> find obj81 -name \*.gch -a -type f | xargs du -shc | grep total
> 1.2G    total
> find obj83 -name \*.gch -a -type f | xargs du -shc | grep total
> 409M    total
> by disabling PCH in stage1/stage2/stageprofile builds, so only
> building it in stage3/stagefeedback etc.
> I think in stage1/stage2 it is a pure waste of bootstrap time and disk

Yes, definitely.

> space, for profiledbootstrap I'd say PCH isn't used commonly enough
> in the wild that it is worth training GCC on that (but if you disagree,
> I can surely take out that single line in there).

The 'std' module is implemented in terms of the bits/stdc++.h file,
which I assume uses the bits/stdc++.h.gch PCH if available - maybe
Jason can confirm that.

But even building the 'std' module is still something that's expected
to be done less often than compiling other code (e.g. all the code
that will do 'import std'). If you are compiling the 'std' module more
than you are compiling the code that consumes it, then there's not
much point using the module, it's not reducing your build times or
simplifying your build tooling!

So I agree that training on stdc++.h probably isn't useful.

>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

No objections from the libstdc++ side.


>
> 2026-02-04  Jakub Jelinek  <[email protected]>
>
>         * Makefile.tpl (STAGE1_CONFIGURE_FLAGS, STAGE2_CONFIGURE_FLAGS,
>         STAGEprofile_CONFIGURE_FLAGS): Append --disable-libstdcxx-pch if
>         target-libstdc++-v3-bootstrap.
>         * Makefile.in: Regenerate.
>
> --- Makefile.tpl.jj     2026-01-01 18:33:49.674983619 +0100
> +++ Makefile.tpl        2026-02-03 23:54:37.609444020 +0100
> @@ -556,6 +556,12 @@ STAGE1_CONFIGURE_FLAGS = $(STAGE1_CHECKI
>           --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
>           --disable-build-format-warnings
>
> +@if target-libstdc++-v3-bootstrap
> +STAGE1_CONFIGURE_FLAGS += --disable-libstdcxx-pch
> +STAGE2_CONFIGURE_FLAGS += --disable-libstdcxx-pch
> +STAGEprofile_CONFIGURE_FLAGS += --disable-libstdcxx-pch
> +@endif target-libstdc++-v3-bootstrap
> +
>  @if target-libphobos-bootstrap
>  STAGE1_CONFIGURE_FLAGS += --with-libphobos-druntime-only
>  STAGE2_CONFIGURE_FLAGS += --with-libphobos-druntime-only
> --- Makefile.in.jj      2026-01-01 18:33:49.673983636 +0100
> +++ Makefile.in 2026-02-03 23:55:15.755489944 +0100
> @@ -633,6 +633,12 @@ STAGE1_CONFIGURE_FLAGS = $(STAGE1_CHECKI
>           --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
>           --disable-build-format-warnings
>
> +@if target-libstdc++-v3-bootstrap
> +STAGE1_CONFIGURE_FLAGS += --disable-libstdcxx-pch
> +STAGE2_CONFIGURE_FLAGS += --disable-libstdcxx-pch
> +STAGEprofile_CONFIGURE_FLAGS += --disable-libstdcxx-pch
> +@endif target-libstdc++-v3-bootstrap
> +
>  @if target-libphobos-bootstrap
>  STAGE1_CONFIGURE_FLAGS += --with-libphobos-druntime-only
>  STAGE2_CONFIGURE_FLAGS += --with-libphobos-druntime-only
>
>         Jakub
>

Reply via email to