Bug 18062 - Bootstrap with GCC 2.8.1 and CFLASG="-I${HOME}/include" and config.h in ~/include is broken
Summary: Bootstrap with GCC 2.8.1 and CFLASG="-I${HOME}/include" and config.h in ~/inc...
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-19 16:52 UTC by Václav Haisman
Modified: 2005-07-23 22:49 UTC (History)
2 users (show)

See Also:
Host: i386-unknown-freebsd4.10
Target: i386-unknown-freebsd4.10
Build: i386-unknown-freebsd4.10
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Václav Haisman 2004-10-19 16:52:15 UTC
This is a sample of build command and its verbose output with GCC 4.0.0. There
is -I/home/4/wilx/include on the command line. Notice the ordering of include
paths int its output:

wilx@logout:::~/tmp/gcc-head/objdir/gcc> gcc -v -c   -g -DENABLE_CHECKING
-DENABLE_ASSERT_CHECKING -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros
-Wold-style-definition -fno-common   -DHAVE_CONFIG_H -I/home/4/wilx/include  
-I. -I. -I../../srcdir/gcc -I../../srcdir/gcc/. -I../../srcdir/gcc/../include
-I../../srcdir/gcc/../libcpp/include  ../../srcdir/gcc/expr.c -o expr.o
Reading specs from /home/4/wilx/lib/gcc/i386-unknown-freebsd4.10/4.0.0/specs
Configured with: ../srcdir/configure --disable-nls
--enable-version-specific-runtime-libs --enable-dwarf2 --with-cpu=pentium3
--with-arch=pentium3 --with-system-zlib --disable-shared --prefix=/home/4/wilx
--enable-languages=c,c++,objc --disable-sjlj-exceptions
--enable-shared=libstdc++ --enable-shared=libobjc --with-gc=zone
Thread model: posix
gcc version 4.0.0 20041016 (experimental)
 /home/4/wilx/libexec/gcc/i386-unknown-freebsd4.10/4.0.0/cc1 -quiet -v
-I/home/4/wilx/include -I. -I. -I../../srcdir/gcc -I../../srcdir/gcc/.
-I../../srcdir/gcc/../include -I../../srcdir/gcc/../libcpp/include
-DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC -DHAVE_CONFIG_H
../../srcdir/gcc/expr.c -quiet -dumpbase expr.c -march=pentium3 -auxbase-strip
expr.o -g -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -version
-fno-common -o /var/tmp//ccbNklGP.s
ignoring nonexistent directory
"/home/4/wilx/lib/gcc/i386-unknown-freebsd4.10/4.0.0/../../../../i386-unknown-freebsd4.10/include"
ignoring duplicate directory "/home/4/wilx/include"
  as it is a non-system directory that duplicates a system directory
ignoring duplicate directory "."
ignoring duplicate directory "../../srcdir/gcc/."
#include "..." search starts here:
#include <...> search starts here:
 .
 ../../srcdir/gcc
 ../../srcdir/gcc/../include
 ../../srcdir/gcc/../libcpp/include
 /usr/local/include
 /home/4/wilx/include
 /home/4/wilx/lib/gcc/i386-unknown-freebsd4.10/4.0.0/include
 /usr/include
End of search list.
GNU C version 4.0.0 20041016 (experimental) (i386-unknown-freebsd4.10)
        compiled by GNU C version 4.0.0 20041016 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
 as -o expr.o /var/tmp//ccbNklGP.s

Now please observe GCC 2.8.1's behaviour. Notice the include paths ordering this
time too. Same environment just different bootstrap compiler.

wilx@logout:::~/tmp/gcc-head/objdir/gcc> adagcc -v -c   -g -DENABLE_CHECKING
-DENABLE_ASSERT_CHECKING -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes  -fno-common -Wno-error  -DHAVE_CONFIG_H
-I/home/4/wilx/include   -I. -I. -I../../srcdir/gcc -I../../srcdir/gcc/.
-I../../srcdir/gcc/../include -I../../srcdir/gcc/../libcpp/include  c-parse.c -o
c-parse.o
Reading specs from /usr/local/lib/gcc-lib/i386-unknown-freebsd4.10/2.8.1/specs
gcc version 2.8.1
 /usr/local/lib/gcc-lib/i386-unknown-freebsd4.10/2.8.1/cpp -lang-c -v
-I/home/4/wilx/include -I. -I. -I../../srcdir/gcc -I../../srcdir/gcc/.
-I../../srcdir/gcc/../include -I../../srcdir/gcc/../libcpp/include -undef
-D__GNUC__=2 -D__GNUC_MINOR__=8 -Di386 -Dunix -D__ELF__ -D__FreeBSD__=4
-D__i386__ -D__unix__ -D__ELF__ -D__FreeBSD__=4 -D__i386 -D__unix
-Asystem(FreeBSD) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386) -g -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wno-error -Di386
-Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -Asystem(unix) -Acpu(i386)
-Amachine(i386) -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC
-DHAVE_CONFIG_H c-parse.c /tmp/cczdxxvj.i
GNU CPP version 2.8.1 (i386 FreeBSD/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /home/4/wilx/include
 .
 ../../srcdir/gcc
 ../../srcdir/gcc/../include
 ../../srcdir/gcc/../libcpp/include
 /usr/local/include
 /usr/local/i386-unknown-freebsd4.10/include
 /usr/local/lib/gcc-lib/i386-unknown-freebsd4.10/2.8.1/include
 /usr/include
End of search list.
In file included from ../../srcdir/gcc/../libcpp/include/cpplib.h:29,
                 from c-parse.y:42:
/home/4/wilx/include/config.h:1: #error "config.h in ~/include!!!"

This time /home/4/wilx/include has made it to the first include path that is
searched. For better illustration I have changed the original ~/include/config.h
that has been installed by INN with my own one:

wilx@logout:::~/tmp/gcc-head/objdir/gcc> cat ~/include/config.h
#error "config.h in ~/include!!!"
Comment 1 Andrew Pinski 2004-10-19 16:57:05 UTC
Not a bug, since /home/4/wilx is a prefix , /home/4/wilx/include is always included after the user 
includes even though you aupply it on the command line.  The bug was 2.8.x which cannot be changed 
and is so old nobody cares about it.