Skip to content

Commit

Permalink
config: Add top-level flag to disable host PCH.
Browse files Browse the repository at this point in the history
This provides a --disable-host-pch-support configure flag
that is passed down to libcpp, gcc and libstdc++ where the
support for PCH is enacted.

FIXME: needs doc changes.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

ChangeLog:

	* Makefile.def: Pass host PCH support configuration
	to libcpp, gcc and libstdc++.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Add --disable-host-pch-support flag.
  • Loading branch information
iains committed Oct 28, 2021
1 parent 2dc835c commit af097ef
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 33 deletions.
9 changes: 6 additions & 3 deletions Makefile.def
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ host_modules= { module= fixincludes; bootstrap=true;
host_modules= { module= flex; no_check_cross= true; };
host_modules= { module= gas; bootstrap=true; };
host_modules= { module= gcc; bootstrap=true;
extra_make_flags="$(EXTRA_GCC_FLAGS)"; };
extra_make_flags="$(EXTRA_GCC_FLAGS)";
extra_configure_flags="@configure_host_pch_support@"; };
host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
// Work around in-tree gmp configure bug with missing flex.
extra_configure_flags='--disable-shared LEX="touch lex.yy.c"';
Expand Down Expand Up @@ -81,7 +82,8 @@ host_modules= { module= tcl;
host_modules= { module= itcl; };
host_modules= { module= ld; bootstrap=true; };
host_modules= { module= libbacktrace; bootstrap=true; };
host_modules= { module= libcpp; bootstrap=true; };
host_modules= { module= libcpp; bootstrap=true;
extra_configure_flags="@configure_host_pch_support@"; };
// As with libiconv, don't install any of libcody
host_modules= { module= libcody; bootstrap=true;
no_install= true;
Expand Down Expand Up @@ -152,7 +154,8 @@ host_modules= { module= libctf; bootstrap=true; };
target_modules = { module= libstdc++-v3;
bootstrap=true;
lib_path=src/.libs;
raw_cxx=true; };
raw_cxx=true;
extra_configure_flags="@configure_host_pch_support@"; };
target_modules = { module= libsanitizer;
bootstrap=true;
lib_path=.libs;
Expand Down
87 changes: 57 additions & 30 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11931,7 +11931,7 @@ configure-gcc:
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--target=${target_alias} @configure_host_pch_support@ \
|| exit 1
@endif gcc

Expand Down Expand Up @@ -11966,7 +11966,8 @@ configure-stage1-gcc:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
\
$(STAGE1_CONFIGURE_FLAGS)
$(STAGE1_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif gcc-bootstrap

.PHONY: configure-stage2-gcc maybe-configure-stage2-gcc
Expand Down Expand Up @@ -11999,7 +12000,8 @@ configure-stage2-gcc:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGE2_CONFIGURE_FLAGS)
$(STAGE2_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif gcc-bootstrap

.PHONY: configure-stage3-gcc maybe-configure-stage3-gcc
Expand Down Expand Up @@ -12032,7 +12034,8 @@ configure-stage3-gcc:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGE3_CONFIGURE_FLAGS)
$(STAGE3_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif gcc-bootstrap

.PHONY: configure-stage4-gcc maybe-configure-stage4-gcc
Expand Down Expand Up @@ -12065,7 +12068,8 @@ configure-stage4-gcc:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGE4_CONFIGURE_FLAGS)
$(STAGE4_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif gcc-bootstrap

.PHONY: configure-stageprofile-gcc maybe-configure-stageprofile-gcc
Expand Down Expand Up @@ -12098,7 +12102,8 @@ configure-stageprofile-gcc:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEprofile_CONFIGURE_FLAGS)
$(STAGEprofile_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif gcc-bootstrap

.PHONY: configure-stagetrain-gcc maybe-configure-stagetrain-gcc
Expand Down Expand Up @@ -12131,7 +12136,8 @@ configure-stagetrain-gcc:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEtrain_CONFIGURE_FLAGS)
$(STAGEtrain_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif gcc-bootstrap

.PHONY: configure-stagefeedback-gcc maybe-configure-stagefeedback-gcc
Expand Down Expand Up @@ -12164,7 +12170,8 @@ configure-stagefeedback-gcc:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEfeedback_CONFIGURE_FLAGS)
$(STAGEfeedback_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif gcc-bootstrap

.PHONY: configure-stageautoprofile-gcc maybe-configure-stageautoprofile-gcc
Expand Down Expand Up @@ -12197,7 +12204,8 @@ configure-stageautoprofile-gcc:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEautoprofile_CONFIGURE_FLAGS)
$(STAGEautoprofile_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif gcc-bootstrap

.PHONY: configure-stageautofeedback-gcc maybe-configure-stageautofeedback-gcc
Expand Down Expand Up @@ -12230,7 +12238,8 @@ configure-stageautofeedback-gcc:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEautofeedback_CONFIGURE_FLAGS)
$(STAGEautofeedback_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif gcc-bootstrap


Expand Down Expand Up @@ -24705,7 +24714,7 @@ configure-libcpp:
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--target=${target_alias} @configure_host_pch_support@ \
|| exit 1
@endif libcpp

Expand Down Expand Up @@ -24740,7 +24749,8 @@ configure-stage1-libcpp:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
\
$(STAGE1_CONFIGURE_FLAGS)
$(STAGE1_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif libcpp-bootstrap

.PHONY: configure-stage2-libcpp maybe-configure-stage2-libcpp
Expand Down Expand Up @@ -24773,7 +24783,8 @@ configure-stage2-libcpp:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGE2_CONFIGURE_FLAGS)
$(STAGE2_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif libcpp-bootstrap

.PHONY: configure-stage3-libcpp maybe-configure-stage3-libcpp
Expand Down Expand Up @@ -24806,7 +24817,8 @@ configure-stage3-libcpp:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGE3_CONFIGURE_FLAGS)
$(STAGE3_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif libcpp-bootstrap

.PHONY: configure-stage4-libcpp maybe-configure-stage4-libcpp
Expand Down Expand Up @@ -24839,7 +24851,8 @@ configure-stage4-libcpp:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGE4_CONFIGURE_FLAGS)
$(STAGE4_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif libcpp-bootstrap

.PHONY: configure-stageprofile-libcpp maybe-configure-stageprofile-libcpp
Expand Down Expand Up @@ -24872,7 +24885,8 @@ configure-stageprofile-libcpp:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEprofile_CONFIGURE_FLAGS)
$(STAGEprofile_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif libcpp-bootstrap

.PHONY: configure-stagetrain-libcpp maybe-configure-stagetrain-libcpp
Expand Down Expand Up @@ -24905,7 +24919,8 @@ configure-stagetrain-libcpp:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEtrain_CONFIGURE_FLAGS)
$(STAGEtrain_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif libcpp-bootstrap

.PHONY: configure-stagefeedback-libcpp maybe-configure-stagefeedback-libcpp
Expand Down Expand Up @@ -24938,7 +24953,8 @@ configure-stagefeedback-libcpp:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEfeedback_CONFIGURE_FLAGS)
$(STAGEfeedback_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif libcpp-bootstrap

.PHONY: configure-stageautoprofile-libcpp maybe-configure-stageautoprofile-libcpp
Expand Down Expand Up @@ -24971,7 +24987,8 @@ configure-stageautoprofile-libcpp:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEautoprofile_CONFIGURE_FLAGS)
$(STAGEautoprofile_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif libcpp-bootstrap

.PHONY: configure-stageautofeedback-libcpp maybe-configure-stageautofeedback-libcpp
Expand Down Expand Up @@ -25004,7 +25021,8 @@ configure-stageautofeedback-libcpp:
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEautofeedback_CONFIGURE_FLAGS)
$(STAGEautofeedback_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif libcpp-bootstrap


Expand Down Expand Up @@ -43534,7 +43552,7 @@ configure-target-libstdc++-v3:
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
--target=${target_alias} @configure_host_pch_support@ \
|| exit 1
@endif target-libstdc++-v3

Expand Down Expand Up @@ -43581,7 +43599,8 @@ configure-stage1-target-libstdc++-v3:
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
\
$(STAGE1_CONFIGURE_FLAGS)
$(STAGE1_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif target-libstdc++-v3-bootstrap

.PHONY: configure-stage2-target-libstdc++-v3 maybe-configure-stage2-target-libstdc++-v3
Expand Down Expand Up @@ -43626,7 +43645,8 @@ configure-stage2-target-libstdc++-v3:
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGE2_CONFIGURE_FLAGS)
$(STAGE2_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif target-libstdc++-v3-bootstrap

.PHONY: configure-stage3-target-libstdc++-v3 maybe-configure-stage3-target-libstdc++-v3
Expand Down Expand Up @@ -43671,7 +43691,8 @@ configure-stage3-target-libstdc++-v3:
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGE3_CONFIGURE_FLAGS)
$(STAGE3_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif target-libstdc++-v3-bootstrap

.PHONY: configure-stage4-target-libstdc++-v3 maybe-configure-stage4-target-libstdc++-v3
Expand Down Expand Up @@ -43716,7 +43737,8 @@ configure-stage4-target-libstdc++-v3:
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGE4_CONFIGURE_FLAGS)
$(STAGE4_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif target-libstdc++-v3-bootstrap

.PHONY: configure-stageprofile-target-libstdc++-v3 maybe-configure-stageprofile-target-libstdc++-v3
Expand Down Expand Up @@ -43761,7 +43783,8 @@ configure-stageprofile-target-libstdc++-v3:
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEprofile_CONFIGURE_FLAGS)
$(STAGEprofile_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif target-libstdc++-v3-bootstrap

.PHONY: configure-stagetrain-target-libstdc++-v3 maybe-configure-stagetrain-target-libstdc++-v3
Expand Down Expand Up @@ -43806,7 +43829,8 @@ configure-stagetrain-target-libstdc++-v3:
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEtrain_CONFIGURE_FLAGS)
$(STAGEtrain_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif target-libstdc++-v3-bootstrap

.PHONY: configure-stagefeedback-target-libstdc++-v3 maybe-configure-stagefeedback-target-libstdc++-v3
Expand Down Expand Up @@ -43851,7 +43875,8 @@ configure-stagefeedback-target-libstdc++-v3:
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEfeedback_CONFIGURE_FLAGS)
$(STAGEfeedback_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif target-libstdc++-v3-bootstrap

.PHONY: configure-stageautoprofile-target-libstdc++-v3 maybe-configure-stageautoprofile-target-libstdc++-v3
Expand Down Expand Up @@ -43896,7 +43921,8 @@ configure-stageautoprofile-target-libstdc++-v3:
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEautoprofile_CONFIGURE_FLAGS)
$(STAGEautoprofile_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif target-libstdc++-v3-bootstrap

.PHONY: configure-stageautofeedback-target-libstdc++-v3 maybe-configure-stageautofeedback-target-libstdc++-v3
Expand Down Expand Up @@ -43941,7 +43967,8 @@ configure-stageautofeedback-target-libstdc++-v3:
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
--with-build-libsubdir=$(HOST_SUBDIR) \
$(STAGEautofeedback_CONFIGURE_FLAGS)
$(STAGEautofeedback_CONFIGURE_FLAGS) \
@configure_host_pch_support@
@endif target-libstdc++-v3-bootstrap


Expand Down
42 changes: 42 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ LDFLAGS
CFLAGS
CC
extra_liboffloadmic_configure_flags
configure_host_pch_support
target_subdir
host_subdir
build_subdir
Expand Down Expand Up @@ -793,6 +794,7 @@ enable_offload_defaulted
enable_gold
enable_ld
enable_compressed_debug_sections
enable_host_pch_support
enable_libquadmath
enable_libquadmath_support
enable_libada
Expand Down Expand Up @@ -1531,6 +1533,8 @@ Optional Features:
--enable-compressed-debug-sections={all,gas,gold,ld,none}
Enable compressed debug sections for gas, gold or ld
by default
--disable-host-pch-support
Disable support for C-family precompiled headers
--disable-libquadmath do not build libquadmath directory
--disable-libquadmath-support
disable libquadmath support for Fortran
Expand Down Expand Up @@ -3110,6 +3114,44 @@ else
fi


# Add a configure option to control whether the host will support pre-compiled
# headers (PCH) for the c-family compilers. At present, the default is 'yes'
# for most platforms but this can be adjusted below for any that are unable to
# support it. 'configure_host_pch_support' is passed as an additional config
# arg to the configures for host and target modules that depend on the support
# where this is not specified explicitly.
configure_host_pch_support=
# Check whether --enable-host_pch_support was given.
if test "${enable_host_pch_support+set}" = set; then :
enableval=$enable_host_pch_support;
ENABLE_HOST_PCH=$enableval
case "${host}" in
aarch64-*-darwin* | arm64*-*-darwin*)
if test "x${ENABLE_HOST_PCH}" = xyes; then
as_fn_error $? "PCH is not supported on aarch64/arm64 Darwin hosts" "$LINENO" 5
fi
;;
*)
;;
esac

else

# The configure line does not specify, so set appropriate values to pass to
# module configures that depend on this.
case "${host}" in
aarch64-*-darwin* | arm64*-*-darwin*)
configure_host_pch_support='--enable-host-pch-support=no'
;;
*)
configure_host_pch_support='--enable-host-pch-support=yes'
;;
esac

fi



# Configure extra directories which are host specific

case "${host}" in
Expand Down
Loading

0 comments on commit af097ef

Please sign in to comment.