This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

using stdc++.h.gch


Geoff recently fixed the last issue with PCH support on linux. It is now
possible to use pre compiled headers on linux. Doing so is a win, by
quite a large margin.

for 'time make check-target-libstdc++-v3'

20030415 pch
722.110u 89.320s 19:26.08 69.5% 0+0k 0+0io 5429730pf+0w

20030415 no pch
1514.670u 108.510s 34:27.58 78.5%       0+0k 0+0io 2496245pf+0w

I expect similar results for the g++ testsuite.

I'm all about reclaiming 15 more minutes in my day (times x times I do
make check) by using the precompiled header support. Also, if this is
flipped on, more people will use PCH and thus it will get wider testing.

Attached is a patch that enables PCH by default, for all targets. I'd
appreciate it if people could start testing with this patch and let me
know the results. In particular, I'm curious about 64 bit linux systems,
BSD, and Solaris.

Also, I have some questions and issues.

1) What targets support PCH, and how can I identify this in autoconf?
I'm assuming that PCH should not be flipped on for everybody, and that
maybe an --enable flag will be needed, with hosts that support it
getting it automagically fipped on?

2) At some point, -H needs to show that the .gch files is being used.
What this means is still a bit up in the air.

3) Installing a zero-size stdc++.h file so that I can use stdc++.h.gch
seems weird. Is it possible to just do some kind of -include
/foo/stdc++.gch?

-benjamin


2003-04-15  Benjamin Kosnik  <bkoz at redhat dot com>

	* include/Makefile.am (allstamps): Add stamp-stdc++-precompile.
        (stamp-std-precompile): Generate stdc++.h.gch
	(install-data-local): Install generated file.
        * include/Makefile.in: Regenerate.
        * testsuite_flags.in (--build-cxx): Use pch file.

Index: testsuite_flags.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite_flags.in,v
retrieving revision 1.14
diff -c -p -r1.14 testsuite_flags.in
*** testsuite_flags.in	14 Mar 2003 22:17:26 -0000	1.14
--- testsuite_flags.in	15 Apr 2003 16:26:04 -0000
*************** case ${query} in
*** 43,50 ****
        echo ${CXX}
        ;;
      --build-cxx)
!       PCHFLAGS="-Winvalid-pch -include ${BUILD_DIR}/include/stdc++.h"
!       CC_build="@glibcpp_CXX@"
        CXX=`echo $CC_build | sed 's/xgcc/g++/g'`
        echo ${CXX}
        ;;
--- 43,50 ----
        echo ${CXX}
        ;;
      --build-cxx)
!       PCHFLAGS="-include ${BUILD_DIR}/include/stdc++.h"
!       CC_build="@glibcpp_CXX@ ${PCHFLAGS}"
        CXX=`echo $CC_build | sed 's/xgcc/g++/g'`
        echo ${CXX}
        ;;
Index: include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.54
diff -c -p -r1.54 Makefile.am
*** include/Makefile.am	14 Mar 2003 22:16:05 -0000	1.54
--- include/Makefile.am	15 Apr 2003 16:26:04 -0000
*************** pch_source = ${glibcpp_srcdir}/include/$
*** 348,354 ****
  # CLEANFILES and all-local are kept up-to-date.
  allstamps = \
  	stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
! 	stamp-backward stamp-ext stamp-target
  
  # Here are the rules for building the headers
  all-local: ${target_builddir}/c++config.h ${thread_target_headers} ${allstamps}
--- 348,354 ----
  # CLEANFILES and all-local are kept up-to-date.
  allstamps = \
  	stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
! 	stamp-backward stamp-ext stamp-target stamp-stdc++-precompile
  
  # Here are the rules for building the headers
  all-local: ${target_builddir}/c++config.h ${thread_target_headers} ${allstamps}
*************** stamp-std: ${std_headers}
*** 367,373 ****
  	  echo `date` > stamp-std ;\
  	fi
  
! PCHFLAGS=-Winvalid-pch -x c++-header $(CXXFLAGS)
  stamp-stdc++-precompile: stamp-std ${target_builddir}/c++config.h ${pch_source}
  	if [ ! -f "${pch_output}" ]; then \
  	  $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -o ${pch_output}; \
--- 367,373 ----
  	  echo `date` > stamp-std ;\
  	fi
  
! PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
  stamp-stdc++-precompile: stamp-std ${target_builddir}/c++config.h ${pch_source}
  	if [ ! -f "${pch_output}" ]; then \
  	  $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -o ${pch_output}; \
*************** stamp-c_base: ${c_base_headers} ${c_base
*** 388,398 ****
  	@if [ ! -d "${c_base_builddir}" ]; then \
  	  mkdir -p ${c_base_builddir} ;\
  	fi ;\
- 	(cd ${c_base_builddir} && for h in ${c_base_headers}; do \
- 	  official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
- 	  @LN_S@ $$h ./$${official_name} || true ;\
- 	done) ;\
  	if [ ! -f stamp-c_base ]; then \
  	  if [ ! -z "${c_base_headers_extra}" ]; then \
  	  (cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra}  . || true) ;\
  	  fi ;\
--- 388,398 ----
  	@if [ ! -d "${c_base_builddir}" ]; then \
  	  mkdir -p ${c_base_builddir} ;\
  	fi ;\
  	if [ ! -f stamp-c_base ]; then \
+ 	  (cd ${c_base_builddir} && for h in ${c_base_headers}; do \
+ 	    official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
+ 	    @LN_S@ $$h ./$${official_name} || true ;\
+ 	  done) ;\
  	  if [ ! -z "${c_base_headers_extra}" ]; then \
  	  (cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra}  . || true) ;\
  	  fi ;\
*************** install-data-local:
*** 524,529 ****
--- 524,531 ----
  	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
  	for file in ${std_headers_rename}; do \
  	  $(INSTALL_DATA) ${std_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${std_builddir}; done
+ 	$(INSTALL_DATA) ${std_builddir}/${pch_input} $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ 	$(INSTALL_DATA) ${std_builddir}/${pch_output} $(DESTDIR)${gxx_include_dir}/${std_builddir}
  	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${target_builddir}
  	for file in ${target_headers} ${target_headers_extra} \
  	 ${thread_target_headers}; do \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]