This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR bootstrap/10169: Prototype getopt in mips-tfile.c


Hi DJ,
> > Unfortunately, when mips-file is being built the order of include
> > directories has changed and "stdio.h" instead pulls in libiberty's
> > getopt.h,
>
> I think changing this is the proper fix for this problem.  System
> headers shouldn't be pulling local headers.

Yep, that's what I was affraid of.

During stage1 and stage2 of a bootstrap on alphaev67-dec-osf5.1 adding
"-v" reports the following search paths:

stage2/cc1 -quiet -v -I. -I. -I../../gcc/gcc -I../../gcc/gcc/.
-I../../gcc/gcc/config -I../../gcc/gcc/../include -iprefix
/home/roger/GCC/clean/gcc/stage2/../lib/gcc-lib/alphaev67-dec-osf5.1/3.4/
-isystem include -isystem stage2/include -isystem
/usr/local/alphaev67-dec-osf5.1/bin/include -DIN_GCC -DHAVE_CONFIG_H
-DTARGET_NAME="alphaev67-dec-osf5.1" ../../gcc/gcc/toplev.c -quiet -dumpbase
toplev.c -auxbase-strip toplev.o -g -O2 -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Werror
-version -fno-common -o /tmp/cclefIAL.s
ignoring nonexistent directory "stage2/include"
ignoring nonexistent directory "/usr/local/alphaev67-dec-osf5.1/bin/include"
ignoring nonexistent directory "/home/roger/GCC/clean/gcc/lib/gcc-lib/alphaev67-dec-osf5.1/3.4/include"
ignoring nonexistent directory "/home/roger/GCC/clean/gcc/lib/gcc-lib/alphaev67-dec-osf5.1/3.4/../../../../alphaev67-dec-osf5.1/include"
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/alphaev67-dec-osf5.1/3.4/include"
ignoring nonexistent directory "/usr/local/alphaev67-dec-osf5.1/include"
ignoring duplicate directory "."
ignoring duplicate directory "../../gcc/gcc"
#include "..." search starts here:
#include <...> search starts here:
 .
 ../../gcc/gcc
 ../../gcc/gcc/config
 ../../gcc/include
 include
 /usr/local/include
 /usr/include
End of search list.


The problem is that <stdio.h> includes <getopt.h> which find libiberty's
version in ../../gcc/include before the system version in /usr/include.

Any suggestions for how to place ../../gcc/include after /usr/include?

This is out of my league, and I'm concerned about how easy it is to
break other targets messing with this part of the build machinery.
Help! Please.

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]