Running gas testsuite

Stephen Casner casner@acm.org
Mon May 18 00:48:55 GMT 2020


On Sun, 17 May 2020, Andrew Burgess wrote:

> So maybe double check that your build tree is correctly configured to
> your source tree, and that your source tree doesn't have any missing
> files under gas/testsuite ?

I figured out the true nature of the problem, and it may have to do
with how "correctly configured" is defined.

The problem I observed occurs if configure is invoked with a relative
pathname rather than an absolute pathname.  That becomes a problem
through this chain of steps in the build-dir/gas/Makefile:

  - srcdir is relative, e.g. ../../gas

  - The site.exp rule makes build-dir/gas/site.exp including the line

    set srcdir ../../gas

  - The check-DEJAGNU rule includes these commands:

    cp site.exp testsuite/site.exp
    cd testsuite; ... runtest ...

That cp is not valid because then the relative path for srcdir is no
longer correct when in the testsuite directory.  That's why runtest
reported the error I mentioned when it does not $srcdir/testsuite and
the files necessary to configure the tests.

I had found that removing the "cd testsuite" allowed the test to run
because then the first copy of site.exp is used from the directory
where its definition of srcdir is still valid.

Is it declared that configure should never be invoked with a relative
pathname?  If so, configure should check and refuse to run if invoked
with a relative pathname.

Otherwise there are a few ways the Makefile could be made more robust:

  - The tests for gas could be run directly in build-dir/gas rather
    than in a subdirectory "testsuite".  That's how the tests for ld
    and the binutils tools are run.

  - Any relative pathnames in site.exp could be adjusted when copying
    to subdirectory "testsuite".

  - The site.exp srcdir line could be constructed from abs_srcdir
    instead.

In my opinion this should be considered a bug.  My choice would be the
first of these options (eliminate build-dir/gas/testsuite) so then the
results are in a consistent place for gas, ld, and binutils.  I note
that the code in the check-DEJAGNU rule of Makefile.am for both gas
and ld dates from the import in 1999, so the inconsistency is not by
any recent design.

                                                        -- Steve


More information about the Binutils mailing list