This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
3.4 PATCH: Only use libstdc++v3 PCH file if built successfully
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 6 Jun 2003 00:05:55 +0200 (MEST)
- Subject: 3.4 PATCH: Only use libstdc++v3 PCH file if built successfully
When bootstrapping current mainline for mips-sgi-irix6.5o32, PCH generation
fails:
/vol/gcc/obj/gcc-3.4-20030528/6.5o32-cc-as/gcc/xgcc -shared-libgcc -B/vol/gcc/obj/gcc-3.4-20030528/6.5o32-cc-as/gcc/ -nostdinc++ -L/vol/gcc/obj/gcc-3.4-20030528/6.5o32-cc-as/mips-sgi-irix6.5o32/libstdc++-v3/src -L/vol/gcc/obj/gcc-3.4-20030528/6.5o32-cc-as/mips-sgi-irix6.5o32/libstdc++-v3/src/.libs -B/vol/gcc/share/mips-sgi-irix6.5o32/bin/ -B/vol/gcc/share/mips-sgi-irix6.5o32/lib/ -isystem /vol/gcc/share/mips-sgi-irix6.5o32/include -isystem /vol/gcc/share/mips-sgi-irix6.5o32/sys-include -Winvalid-pch -Wno-deprecated -x c++-header -g -O2 -nostdinc++ -I/vol/gcc/obj/gcc-3.4-20030528/6.5o32-cc-as/mips-sgi-irix6.5o32/libstdc++-v3/include/mips-sgi-irix6.5o32 -I/vol/gcc/obj/gcc-3.4-20030528/6.5o32-cc-as/mips-sgi-irix6.5o32/libstdc++-v3/include -I/vol/gnu/src/gcc/gcc-dist/libstdc++-v3/libsupc++ /vol/gnu/src/gcc/gcc-dist/libstdc++-v3/include/stdc++.h -O0 -g -o ./mips-sgi-irix6.5o32/bits/stdc++.h.gch/O0g
/vol/gnu/src/gcc/gcc-dist/libstdc++-v3/include/stdc++.h:86: fatal error: error
writing to /var/tmp//cc1LwIHd.s: Bad file number
compilation terminated.
The error is from toplev.c (finalize): the
ferror (asm_out_file) != 0
test fails, but strangely running cc1plus under par/trace reveals no system
call at all that failed with EBADF ;-( I'll have to investigate this
further.
With stabs the default debugging format, the configure test for .gch
generation succeeded, but PCH generation still failed with the above error.
I had to manually fix include/Makefile to fix this wrong test result.
When I recently switched to dwarf-2 by default, the configure test now
fails and the bootstrap finishes, but the whole testsuite fails: PCHFLAGS
(i.e. -include bits/stdc++.h) is passed to every compilation, but the file
couldn't be generated, so the compilations fail:
cc1plus: bits/stdc++.h: No such file or directory
The following patch fixes this. Tested both by rerunning make check in
libstdc++-v3 and a full bootstrap/regtest.
Ok for mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Wed Jun 4 22:07:39 2003 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* acinclude.m4 (GLIBCPP_CHECK_PCH): Only set glibcpp_PCHFLAGS if
.gch compilation works.
* aclocal.m4, configure: Regenerate.
* testsuite_flags.in (--build-cxx): Use glibcpp_PCHFLAGS to
initialize PCHFLAGS.
Index: libstdc++-v3/acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.239
diff -u -p -r1.239 acinclude.m4
--- libstdc++-v3/acinclude.m4 23 May 2003 02:31:03 -0000 1.239
+++ libstdc++-v3/acinclude.m4 5 Jun 2003 22:01:53 -0000
@@ -1464,6 +1464,12 @@ AC_DEFUN(GLIBCPP_CHECK_PCH, [
CXXFLAGS="$ac_save_CXXFLAGS"
AM_CONDITIONAL(GLIBCPP_BUILD_PCH, test "$glibcpp_pch_comp" = yes)
+ if test "$glibcpp_pch_comp" = yes; then
+ glibcpp_PCHFLAGS="-include bits/stdc++.h"
+ else
+ glibcpp_PCHFLAGS=""
+ fi
+ AC_SUBST(glibcpp_PCHFLAGS)
])
dnl
Index: libstdc++-v3/testsuite_flags.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite_flags.in,v
retrieving revision 1.17
diff -u -p -r1.17 testsuite_flags.in
--- libstdc++-v3/testsuite_flags.in 26 Apr 2003 04:01:47 -0000 1.17
+++ libstdc++-v3/testsuite_flags.in 5 Jun 2003 22:01:53 -0000
@@ -43,7 +44,7 @@ case ${query} in
echo ${CXX}
;;
--build-cxx)
- PCHFLAGS="-include bits/stdc++.h"
+ PCHFLAGS="@glibcpp_PCHFLAGS@"
CXX_build="@glibcpp_CXX@ ${PCHFLAGS}"
CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'`
echo ${CXX}