]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
toplevel: Build stage1/stage2/stageprofile libstdc++ with --disable-libstdcxx-pch...
authorJakub Jelinek <jakub@redhat.com>
Wed, 4 Feb 2026 10:49:01 +0000 (11:49 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 4 Feb 2026 10:49:01 +0000 (11:49 +0100)
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
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).

2026-02-04  Jakub Jelinek  <jakub@redhat.com>

* Makefile.tpl (STAGE1_CONFIGURE_FLAGS, STAGE2_CONFIGURE_FLAGS,
STAGEprofile_CONFIGURE_FLAGS): Append --disable-libstdcxx-pch if
target-libstdc++-v3-bootstrap.
* Makefile.in: Regenerate.

Makefile.in
Makefile.tpl

index ae0892e79337461762afe3a78879c7d95a450882..e0e8a872f40a7ebb47e29b7c2b44424d35d51482 100644 (file)
@@ -633,6 +633,12 @@ STAGE1_CONFIGURE_FLAGS = $(STAGE1_CHECKING) \
          --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
index 7e8016416619a76ed6cab2828a50c06288ddfa33..e634d17aa578fafe4cf656bd087a6722bc955d90 100644 (file)
@@ -556,6 +556,12 @@ STAGE1_CONFIGURE_FLAGS = $(STAGE1_CHECKING) \
          --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