On Thu, 7 Dec 2017, Thomas Preudhomme wrote:

> That seems to go counter to the --prefix option of contrib/test_installed
> which is meant to test a compiler at an arbitrary path. This suggest the
> compiler is not expected to be in PATH or in any dejagnu configuration file.
> Seems most of the testsuite seems to work fine with just GCC_UNDER_TEST, why
> not make it compile testglue using the value of that variable as well?

My comments were on the general principle of installed testing, not 
contrib/test_installed specifically.

That is: you have a toolchain installed and want to run some DejaGnu tests 
with it.  Those tests are not necessarily tests of GCC; they might include 
GDB or newlib tests, for example.  Your board file needs to describe how 
to compile for the board, which is exactly what "set_board_info compiler" 
is for (and sometimes also "set_board_info cflags", "set_board_info 
ldflags", "set_board_info ldscript", especially if you have e.g. a 
bare-metal compiler configuration that only generates useful programs when 
a linker script for a particular board is specified - or if e.g. you're 
testing a GNU/Linux toolchain with glibc not installed in the target 
system's root directory, you need a board file that sets ldflags to use 
appropriate -Wl,-dynamic-linker -Wl,-rpath options).

So a generically useful board file describes the "compiler for the board".  
The compiler for the board may or may not be the same as the compiler 
being tested, if the testsuite you're running is a testsuite for a 
compiler at all.  (And if you're running the GCC compat tests you have 
*three* compilers involved - the compiler for the board, the GCC being 
tested and the other compiler you're testing ABI compatibility with.)

The argument for compiling testglue with the "compiler for the board" is 
simply that testglue is not part of the GCC testsuite at all; it's part of 
DejaGnu and needs to be built even in cases where you're running a 
non-compiler testsuite.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to