Hi!

On Fri, 9 Jan 2015 03:40:29 +0300, Ilya Verbin <iver...@gmail.com> wrote:
> Currently check_effective_target_lto properly works only in gcc/testsuite/ 
> dir,
> since it checks for ENABLE_LTO, which is defined in gcc/configure.ac.
> But it doesn't work in other subdirectories, e.g. in libgomp/testsuite/.
> This patch fixes it.
> make check and check-target-libgomp passed with/without --disable-lto on
> x86_64-linux.  OK for trunk?

Conceptually, this makes sense to me (but I can't tell off-hand
whether...

> gcc/testsuite/
>       * lib/target-supports.exp (check_effective_target_lto): Check for -flto
>       option support instead of ENABLE_LTO define from configure.

... exchanging these checks is valid in all cases -- but I certainly hope
it is).

> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -5729,11 +5729,12 @@ proc check_effective_target_gld { } {
>  # (LTO) support.
>  
>  proc check_effective_target_lto { } {
> -    global ENABLE_LTO
>      if { [istarget nvptx-*-*] } {
>       return 0;
>      }
> -    return [info exists ENABLE_LTO]
> +    return [check_no_compiler_messages lto object {
> +     void foo (void) { }
> +    } "-flto"]
>  }

As this was the only use of ENABLE_LTO in the testsuite, I suggest to
also remove it from the gcc/Makefile.in:site.exp rule.


Grüße,
 Thomas

Attachment: signature.asc
Description: PGP signature

Reply via email to