This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
header search path change with 2003-03-02 commit
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: gcc-patches at gcc dot gnu dot org, Janis Johnson <janis187 at us dot ibm dot com>
- Date: Tue, 18 Mar 2003 23:06:08 +1030
- Subject: header search path change with 2003-03-02 commit
Hi Neal,
I'm seeing lots of powerpc64-linux testsuite failures on mainline,
a typical one looks like:
Executing on host: /usr/tmp/ppc/gcc-ppc64-34/gcc/xgcc -B/usr/tmp/ppc/gcc-ppc64-34/gcc/ -w -O0 -c -o /usr/tmp/ppc/gcc-ppc64-34/gcc/testsuite/990625-1.o /src/gcc-ppc64-34/gcc/testsuite/gcc.c-torture/compile/990625-1.c (timeout = 300)
/src/gcc-ppc64-34/gcc/testsuite/gcc.c-torture/compile/990625-1.c:2:20: string.h: No such file or directory
compiler exited with status 1
output is:
/src/gcc-ppc64-34/gcc/testsuite/gcc.c-torture/compile/990625-1.c:2:20: string.h: No such file or directory
FAIL: gcc.c-torture/compile/990625-1.c, -O0
A little investigation with gcc -v shows:
ignoring nonexistent directory "/usr/tmp/ppc/gcc-ppc64-34/lib/gcc-lib/powerpc64-linux/3.4/include"
ignoring nonexistent directory "/usr/tmp/ppc/gcc-ppc64-34/lib/gcc-lib/powerpc64-linux/3.4/../../../../powerpc64-linux/sys-include"
ignoring nonexistent directory "/usr/tmp/ppc/gcc-ppc64-34/lib/gcc-lib/powerpc64-linux/3.4/../../../../powerpc64-linux/include"
#include "..." search starts here:
#include <...> search starts here:
../include
End of search list.
Hmm, no search of /usr/local/powerpc64-linux/include as gcc-3.3 does:
ignoring nonexistent directory "../../lib/gcc-lib/powerpc64-linux/3.3/include"
ignoring nonexistent directory "../../lib/gcc-lib/powerpc64-linux/3.3/../../../../powerpc64-linux/sys-include"
ignoring nonexistent directory "../../lib/gcc-lib/powerpc64-linux/3.3/../../../../powerpc64-linux/include"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/powerpc64-linux/3.3/include"
#include "..." search starts here:
#include <...> search starts here:
../include
/usr/local/powerpc64-linux/sys-include
/usr/local/powerpc64-linux/include
End of search list.
Note that powerpc64-linux-gcc is normally not a native compiler. It's
a cross-compiler that happens to generate code that can run on the host
powerpc-linux system, provided your hardware is capable.
gcc-3.3 adds the extra paths in cppinit.c:init_standard_includes near
line 829. ie. A suitable entry in cpp_include_defaults gets added
with _both_ the "translated versions of the GNU directories" and the
untranslated version. This code seems to be missing from mainline
c-incpath.c:add_standard_paths.
* c-incpath.c (add_path): Add both "translated" and non-translated
header paths.
Index: gcc/c-incpath.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-incpath.c,v
retrieving revision 1.3
diff -u -p -r1.3 c-incpath.c
--- gcc/c-incpath.c 2 Mar 2003 22:09:29 -0000 1.3
+++ gcc/c-incpath.c 18 Mar 2003 12:25:34 -0000
@@ -147,6 +147,22 @@ add_standard_paths (sysroot, iprefix, cx
else if (len && !strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
str = concat (iprefix, p->fname + len, NULL);
else
+ /* Add later. */
+ continue;
+
+ add_path (str, SYSTEM, p->cxx_aware);
+ }
+ }
+
+ for (p = cpp_include_defaults; p->fname; p++)
+ {
+ if (!p->cplusplus || cxx_stdinc)
+ {
+ char *str;
+
+ if (sysroot && p->add_sysroot)
+ continue;
+ else
str = update_path (p->fname, p->component);
add_path (str, SYSTEM, p->cxx_aware);
--
Alan Modra
IBM OzLabs - Linux Technology Centre