On Mar 4, 2011, at 1:48 PM, Diego Novillo wrote:
> When running tests in a toolchain configure --with-build-sysroot, we 
> need to execute the testsuite pointing every compiler invocation to
> the build sysroot (which in our case is different than the sysroot
> that the compiler is configured with).

When testing the built compiler, we test it on the host.  The path name on the 
command line, is a path name on the build machine.  You can't use that, in 
general on the host machine.

So, for this to work, you'd need to work out a location on the host, and then 
remote_download that to the host, and then use that for the host compiler for 
testing.  So, roughly, check out copy-file.exp or additional_files for example.

In building, we use the build compiler to compile the target libraries, which 
means we can use that argument directly in that environment.

I hate the cut-n-paste programming model (still).  Though, you didn't invent 
it, so you don't have to pay the price to fix it, I'll just note it in passing.

> # Usually the one we just built.
> # Don't use this as a dependency--use $(GCC_PASSES).
> +GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ 
> -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include 
> -L$(objdir)/../ld
> +
> +# Set if the compiler was configured with --with-build-sysroot.
> 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

$(shell $(PWD_COMMAND)) is slow (unless make short circuits it).  Beyond that, 
this confuses the build != host setup I think.  See, . is special and the 
testing infrastructure works hard to appear the compiler is ., not any other 
directory.  You can't change the name for testing and have it just work.

> -     @echo "set GCC_UNDER_TEST \"$(GCC_FOR_TARGET)\"" >> ./tmp0

?  What's this?  GCC_UNDER_TEST is kinda important to testing.  I feel like I'm 
missing something trivial.

> +     @echo "set TEST_SYSROOT \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./tmp0

> +    if [info exists TEST_SYSROOT] {
> +     lappend options "additional_flags=$TEST_SYSROOT"
> +    }

So, this will cause a certain ordering on the command line.  If there is a 
testcase in the testsuite that tests that flag, this might cause the option 
under test to be overridden unless the TEST_SYSROOT option comes first on the 
command line.  You can glance at the .log file, and ensure that this option 
comes before the -O2 say, of the multilib options in a torture suite.

Reply via email to