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: [PATCH] PR ld/20436: Skip LTO tests for --disable-plugin


On Mon, Aug 08, 2016 at 12:28:31PM -0700, H.J. Lu wrote:
> diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
> index cd9e930..3c27ca7 100644
> --- a/ld/testsuite/lib/ld-lib.exp
> +++ b/ld/testsuite/lib/ld-lib.exp
> @@ -1808,13 +1808,35 @@ proc check_sysroot_available { } {
>      return $ld_sysroot_available_saved
>  }
>  
> +# Returns 1 if plugin is disabled in gcc.  Returns 0 otherwise.
> +proc check_gcc_plugin_disabled { } {
> +    global CC
> +
> +    if {![info exists CC]} {
> +	set CC [find_gcc]
> +    }
> +    if { $CC == "" } {
> +      return 0
> +    }
> +    set state [remote_exec host $CC -v]
> +    for { set i 0 } { $i < [llength $state] } { incr i } {
> +	set v [lindex $state $i]
> +	if { [ string match "*--disable-plugin*" $v ] } {
> +	    verbose "plugin is disabled by $v"
> +	    return 1;
> +	}
> +    }
> +
> +    return 0;
> +}
> +
>  # Returns true if the target compiler supports LTO
>  proc check_lto_available { } {
>      global lto_available_saved
>      global CC
>  
>      if {![info exists lto_available_saved]} {
> -        if { [which $CC] == 0 } {
> +        if { [which $CC] == 0 || [ check_gcc_plugin_disabled ] } {
>  	    set lto_available_saved 0
>  	    return 0
>  	}

I think this would be cleaner with check_gcc_plugin_disabled return
value inverted and the function called check_gcc_plugin_enabled.
Then the last hunk could be written as

        if { [!check_gcc_plugin_enabled] } {

OK with that change.

-- 
Alan Modra
Australia Development Lab, IBM


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