This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC_FOR_TARGET settings being overridden by toplevel Makefile
- From: Diego Novillo <dnovillo at google dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>, DJ Delorie <dj at redhat dot com>, gcc at gnu dot org, Simon Baldwin <simonb at google dot com>
- Date: Wed, 2 Mar 2011 11:20:01 -0800
- Subject: GCC_FOR_TARGET settings being overridden by toplevel Makefile
We are trying to add some flags to GCC_FOR_TARGET so that when
check-gcc runs, it includes a few extra sysroot and -isystem options.
To do this, we've modified the definition in gcc/Makefile.in to add
these extra options:
-GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./
-B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem
$(build_tooldir)/sys-include -L$(objdir)/../ld
+SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
+GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $(shell $(PWD_COMMAND))/xgcc
$(SYSROOT_CFLAGS_FOR_TARGET) -B$(shell ($PWD_COMMAND))/
-B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem
$(build_tooldir)/sys-include -L$(objdir)/../ld
Additionally, we redefine GCC_UNDER_TEST to use GCC_FOR_TARGET in site.exp:
@@ -4843,6 +4844,7 @@ site.exp: ./config.status Makefile
@echo "set CXXFLAGS \"\"" >> ./tmp0
@echo "set HOSTCC \"$(CC)\"" >> ./tmp0
@echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./tmp0
+ @echo "set GCC_UNDER_TEST \"$(GCC_FOR_TARGET)\"" >> ./tmp0
When 'make check' runs from within the gcc/ directory, everything is
fine, but when we run 'make check-gcc' from the toplevel build
directory, the value for GCC_FOR_TARGET is explicitly passed to
gcc/Makefile, which makes it ignore the new flags. This causes
massive failures because of the missing arguments.
I think that the simplest solution will be to define GCC_FOR_TARGET
with 'override GCC_FOR_TARGET = ...' in gcc/Makefile.in and in any
other Makefiles that need to use the additional flags.
Does this sound like the right approach or should we be passing these
flags some other way? We need something that passes our sysroot
settings to all the testsuites.
Thanks. Diego.