This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

FLAGS_FOR_TARGET: use -nostdinc for Canadian crosses


After a long private thread, DJ and I agreed that this patch would be
an improvement over the current situation of FLAGS_FOR_TARGET in case
of Canadian crosses.  I'm checking this in.

Index: ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>, DJ Delorie  <dj@redhat.com>

	* configure.in (FLAGS_FOR_TARGET): Use -nostdinc even for Canadian
	crosses, but add gcc/include to the header search path for them.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/configure.in,v
retrieving revision 1.69
diff -u -p -r1.69 configure.in
--- configure.in	2000/08/25 07:04:49	1.69
+++ configure.in	2000/09/02 07:13:36
@@ -1244,11 +1245,27 @@ case " $skipdirs " in
      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include -isystem $$s/newlib/libc/sys/cygwin -isystem $$s/newlib/libc/sys/cygwin32' ;;
    esac
 
-   # If we're using a pre-built compiler (which is the case for
-   # Canadian crosses or when gcc isn't being built), don't discard
-   # standard headers.
-   if test "${build}" = "${host}" && test -d ${topsrcdir}/gcc; then
+   # If we're not building GCC, don't discard standard headers.
+   if test -d ${topsrcdir}/gcc; then
      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
+
+     if test "${build}" != "${host}"; then
+       # On Canadian crosses, CC_FOR_TARGET will have already been set
+       # by `configure', so we won't have an opportunity to add -Bgcc/
+       # to it.  This is right: we don't want to search that directory
+       # for binaries, but we want the header files in there, so add
+       # them explicitly.
+       FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
+
+       # Someone might think of using the pre-installed headers on
+       # Canadian crosses, in case the installed compiler is not fully
+       # compatible with the compiler being built.  In this case, it
+       # would be better to flag an error than risking having
+       # incompatible object files being constructed.  We can't
+       # guarantee that an error will be flagged, but let's hope the
+       # compiler will do it, when presented with incompatible header
+       # files.
+     fi
    fi
 
    # If we're building newlib, use its generic headers last, but search

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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