This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Run more ld tests when not native


On Tue, 3 Jan 2017, Alan Modra wrote:

> diff --git a/ld/testsuite/ld-pie/pie.exp b/ld/testsuite/ld-pie/pie.exp
> index e9d1162..44d9f09 100644
> --- a/ld/testsuite/ld-pie/pie.exp
> +++ b/ld/testsuite/ld-pie/pie.exp
> @@ -25,6 +25,11 @@ if { ![istarget *-*-linux*]
>      return
>  }
>  
> +# Check to see if the C compiler works
> +if { [which $CC] == 0 } {
> +    return
> +}
> +
>  # Check if -pie is supported or not.
>  send_log "$CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie"
>  catch "exec $CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie" exec_output

 If you've decided to broaden coverage like this, then I think that beyond 
a simple check that $CC can be found in $PATH a proper installation check 
for the standard system libraries ought to be made, such as by trying to 
build a trivial executable comprised of `int main(void) { return 0; }'.  
This check might be executed once only per LD test suite invocation and 
cached rather than repeatedly for each dependent test script, taking 
advantage of all the test suite being executed in the same namespace (so 
that a plain global variable will do).  This is to avoid spurious failures 
in the case where a partial development environment has been installed 
only, e.g. binutils and a bootstrap compiler, but no C library.

 FWIW,

  Maciej


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