currently the C++ include directories for biarch builds (i.e. i486-linux-gnu, x86_64-linux-gnu) are not set properly for the non-default target. At least the c++config.h header differs. On i486-linux-gnu a x86_64-linux dir is installed, but is not used, for powerpc-linux-gnu, no powerpc64-linux-gnu directory is installed, although c++config.h differs as well.
Looking at the FC builds, c++config.h is replaced by a wrapper file to include the proper c++config.h. I experimented with the standard include directories to include one of the both directories dpending on the current mode, currently there seems to be no way to deduce the names of the directories from the build infrastructure, i.e. something like MULTILIB_DIRS is missing. The following hack (for the 4.0 branch) does work for me, but is not suited for upstream inclusion. Matthias --- gcc/cppdefault.h~ 2004-11-03 04:23:49.000000000 +0100 +++ gcc/cppdefault.h 2005-07-08 20:58:14.016437112 +0200 @@ -43,6 +43,7 @@ C++. */ const char add_sysroot; /* FNAME should be prefixed by cpp_SYSROOT. */ + const char biarch; /* 32/64 bit biarch include */ }; extern const struct default_include cpp_include_defaults[]; --- gcc/c-incpath.c~ 2005-01-23 16:05:27.000000000 +0100 +++ gcc/c-incpath.c 2005-07-08 21:09:40.572064792 +0200 @@ -139,6 +139,13 @@ now. */ if (sysroot && p->add_sysroot) continue; + if (p->biarch) + { + if (p->biarch == 64 && !(target_flags & MASK_64BIT)) + continue; + if (p->biarch == 32 && (target_flags & MASK_64BIT)) + continue; + } if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len)) { char *str = concat (iprefix, p->fname + len, NULL); @@ -150,6 +157,14 @@ for (p = cpp_include_defaults; p->fname; p++) { + if (p->biarch) + { + if (p->biarch == 64 && !(target_flags & MASK_64BIT)) + continue; + if (p->biarch == 32 && (target_flags & MASK_64BIT)) + continue; + } + if (!p->cplusplus || cxx_stdinc) { char *str; --- gcc/Makefile.in~ 2005-04-04 21:45:13.000000000 +0200 +++ gcc/Makefile.in 2005-07-08 21:04:29.808308064 +0200 @@ -2680,6 +2680,8 @@ -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \ -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \ -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \ + -DTARGET32_MACHINE=\"i486-linux-gnu\" \ + -DTARGET64_MACHINE=\"x86_64-linux-gnu\" \ @TARGET_SYSTEM_ROOT_DEFINE@ cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ --- gcc/cppdefault.c~ 2004-11-03 03:23:49.000000000 +0000 +++ gcc/cppdefault.c 2005-07-09 10:19:46.762899104 +0000 @@ -50,9 +70,15 @@ /* Pick up GNU C++ generic include files. */ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0 }, #endif +#if defined (CROSS_COMPILE) + /* Pick up GNU C++ target-dependent include files. */ + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 32 }, +#else #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR /* Pick up GNU C++ target-dependent include files. */ - { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0 }, + { GPLUSPLUS_INCLUDE_DIR "/" TARGET32_MACHINE, "G++", 1, 1, 0, 32 }, + { GPLUSPLUS_INCLUDE_DIR "/" TARGET64_MACHINE, "G++", 1, 1, 0, 64 }, +#endif #endif #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR /* Pick up GNU C++ backward and deprecated include files. */