From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6958 invoked by alias); 15 Apr 2003 17:25:03 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 6944 invoked from network); 15 Apr 2003 17:25:03 -0000 Received: from unknown (HELO mx2.redhat.com) (12.150.115.133) by sources.redhat.com with SMTP; 15 Apr 2003 17:25:03 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.11.6/8.11.6) with ESMTP id h3FHFMZ27805; Tue, 15 Apr 2003 13:15:22 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h3FHP0W19998; Tue, 15 Apr 2003 13:25:01 -0400 Received: from belmont.constant.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with SMTP id h3FHOxS01378; Tue, 15 Apr 2003 10:24:59 -0700 Date: Tue, 15 Apr 2003 18:00:00 -0000 From: Benjamin Kosnik To: libstdc++@gcc.gnu.org, gcc@gcc.gnu.org Cc: law@redhat.com, geoffk@geoffk.org Subject: using stdc++.h.gch Message-Id: <20030415122353.64376cda.bkoz@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00713.txt.bz2 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 * 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 \