Moore, Catherine <catherine_mo...@mentor.com> writes: > > The recent changes to the MIPS GCC Linux sysroot > > (https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01014.html) have meant > > that the include directory is now not global and is provided only for > > each multi-lib configuration. This means that for any test in the > > MIPS GCC Testsuite that requires standard library support we need to > > check if there is a multi-lib support for the test options, otherwise > it might fail to compile. > > > > This patch adds this support to the testsuite and mips.exp files. > > Firstly any test that requires standard library support has the > > implicit option "(REQUIRES_STDLIB)" added to its dg-options. Secondly > > in mips.exp a pre- processor check is performed to ensure that when > > expanding a testcase containing a "#include <stdlib.h>" using the > > current set of test options we do not get file not found errors. If > > this happens we mark the testcase as unsupported. > > > > The patch has been tested on the mti/img elf/linux-gnu toolchains, and > > there have been no new regressions. > > > > The patch and ChangeLog are below. > > > > Ok to commit? > > > > > Yes. This looks good.
I had some comments on this that I hadn't got round to posting. The fix in this patch is not general enough as the missing header problem comes in two (related) forms: 1) Using the new MTI and IMG sysroot layout we can end up with GCC looking for headers in a sysroot that simply does not exist. The current patch handles this. 2) Using any sysroot layout (i.e. a simple mips-linux-gnu) it is possible for the stdlib.h header to be found but the ABI dependent gnu-stubs header may not be installed depending on soft/hard nan1985/nan2008. The test for stdlib.h needs to therefore verify that preprocessing succeeds rather than just testing for an error relating to stdlib.h. This could be done by adding a further option to mips_preprocess to indicate the processor output should go to a file and that the caller wants the messages emitted by the compiler instead. A second issue is that you have added (REQUIRES_STDLIB) to too many tests. You only need to add it to tests that request a compiler option (via dg-options) that could potentially lead to forcing soft/hard nan1985/nan2008 directly or indirectly. So -mips32r6 implies nan2008 so you need it -mips32r5 implies nan1985 so you need it. There are at least two tests which don't need the option but you need to check them all so we don't run the check needlessly. Thanks, Matthew