This is the mail archive of the gcc@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: GCC_FOR_TARGET settings being overridden by toplevel Makefile


Diego Novillo <dnovillo@google.com> writes:

> 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.

That does not sound like the right approach to me.  Why not add the new
flags to GCC_FOR_TARGET at top-level?  It seems to me that
GCC_FOR_TARGET should mean the same thing at all levels.

If the flags are specific to testing, then put them in a new variable.
You can still add them to GCC_UNDER_TEST in site.exp.

Ian


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