I report this as follow up to bug 21145 that has been wrongly marked as
duplicate of 19601. The bug I reported is not AWK problem and thus it is not
duplicate of the bug. My problem is caused by wrong includes search paths and
headers with same names. 

I have installed autogen-5.6.4 which installs file /usr/local/include/options.h.
File insn-conditions.c includes flags.h and that includes options.h that
contains extern declarations for all flags. For some to me unknown reason both
FreeBSD port gcc40 and my own builds of GCC 4.0.0 do add -I/usr/local/include to
compiler's command line for insn-conditions.c and that prepends the path to
search path for includes before GCC's include paths which makes the compiler
include wrong options.h from /usr/local/include.

I suspect that the -I/usr/local/include is added because of libiconv that is
installed in in /usr/local prefix. Resulting command is this:

gcc -c   -g -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC   -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
 -Wno-error  -DHAVE_CONFIG_H -DGENERATOR_FILE -I/usr/local/include   -I. -Ibuild
-I../../srcdir/gcc -I../../srcdir/gcc/build -I../../srcdir/gcc/../include
-I../../srcdir/gcc/../libcpp/include -I/usr/local/include  \
 -o build/insn-conditions.o insn-conditions.c

Note the double occurrence of -I/usr/local/include. 

I think this is genuine GCC configuratin scrip bug.


Bootstrap compiler:
[EMAIL PROTECTED]:::~/gcc-head/objdir/gcc> gcc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.2 [FreeBSD] 20040728

Configurations flags:
../srcdir/configure --disable-nls --enable-version-specific-runtime-libs
--enable-dwarf2 --with-cpu=athlon-tbird --with-arch=athlon-tbird
--with-system-zlib --disable-shared --enable-languages=c,c++,objc
--disable-sjlj-exceptions --enable-shared=libstdc++ --enable-shared=libobjc
--program-suffix=-4.0 --enable-objc-gc

-- 
           Summary: Bootstrap, configuration problem and insn-conditions.c
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: v dot haisman at sh dot cvut dot cz
                CC: gcc-bugs at gcc dot gnu dot org,v dot haisman at sh dot
                    cvut dot cz
 GCC build triplet: i386-unknown-freebsd5.4
  GCC host triplet: i386-unknown-freebsd5.4
GCC target triplet: i386-unknown-freebsd5.4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21268

Reply via email to