public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* using stdc++.h.gch
@ 2003-04-15 18:00 Benjamin Kosnik
  2003-04-15 20:39 ` Geoff Keating
  2003-04-23 13:16 ` [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using Vladimir Merzliakov
  0 siblings, 2 replies; 10+ messages in thread
From: Benjamin Kosnik @ 2003-04-15 18:00 UTC (permalink / raw)
  To: libstdc++, gcc; +Cc: law, geoffk


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@redhat.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 \

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-04-24  1:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-15 18:00 using stdc++.h.gch Benjamin Kosnik
2003-04-15 20:39 ` Geoff Keating
2003-04-15 20:50   ` Benjamin Kosnik
2003-04-23 13:16 ` [PCH bug] anonymous variadic macros were introduced in C99 warning at pch using Vladimir Merzliakov
2003-04-23 18:52   ` Geoff Keating
2003-04-23 19:13     ` Vladimir Merzliakov
2003-04-23 22:20       ` Geoff Keating
2003-04-23 22:35         ` Vladimir Merzliakov
2003-04-24  3:20           ` Geoff Keating
2003-04-23 21:03   ` Benjamin Kosnik

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).