public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Commit: Fix check_lto_available proc
@ 2014-07-07 13:41 Nick Clifton
  2014-07-07 14:01 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2014-07-07 13:41 UTC (permalink / raw)
  To: binutils

Hi Guys,

  I am checking in the patch below to fix the check_lto_available proc
  in the linker testsuite library, so that it will test for the presence
  of a compiler first.  Before this patch it was just assuming that a
  compiler was available and that it could check it for LTO support.

Cheers
  Nick

ld/testsuite/ChangeLog
2014-07-07  Nick Clifton  <nickc@redhat.com>

	* lib/ld-lib.exp (check_lto_available): Check that a compiler is
	available before testing for LTO support.

diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index a657a97..9f7a414 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1666,6 +1666,10 @@ proc check_lto_available { } {
     global CC
 
     if {![info exists lto_available_saved]} {
+        if { [which $CC] == 0 } {
+	    set lto_available_saved 0
+	    return 0
+	}
 	# Check if gcc supports -flto -fuse-linker-plugin
 	set flags ""
 	if [board_info [target_info name] exists cflags] {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Commit: Fix check_lto_available proc
  2014-07-07 13:41 Commit: Fix check_lto_available proc Nick Clifton
@ 2014-07-07 14:01 ` Alan Modra
  2014-07-07 14:09   ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2014-07-07 14:01 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

On Mon, Jul 07, 2014 at 02:40:57PM +0100, Nick Clifton wrote:
> diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
> index a657a97..9f7a414 100644
> --- a/ld/testsuite/lib/ld-lib.exp
> +++ b/ld/testsuite/lib/ld-lib.exp
> @@ -1666,6 +1666,10 @@ proc check_lto_available { } {
>      global CC
>  
>      if {![info exists lto_available_saved]} {
> +        if { [which $CC] == 0 } {
> +	    set lto_available_saved 0
> +	    return 0
> +	}
>  	# Check if gcc supports -flto -fuse-linker-plugin
>  	set flags ""
>  	if [board_info [target_info name] exists cflags] {

I removed that test a few hours ago, thinking that the test in
run_host_cmd would be sufficient.  :-(  What did I miss?

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Commit: Fix check_lto_available proc
  2014-07-07 14:01 ` Alan Modra
@ 2014-07-07 14:09   ` Alan Modra
  2014-07-07 14:23     ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2014-07-07 14:09 UTC (permalink / raw)
  To: Nick Clifton, binutils

On Mon, Jul 07, 2014 at 11:31:27PM +0930, Alan Modra wrote:
> I removed that test a few hours ago, thinking that the test in
> run_host_cmd would be sufficient.  :-(  What did I miss?

Never mind, I'm an idiot.  The test in run_host_cmd results in perror.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Commit: Fix check_lto_available proc
  2014-07-07 14:09   ` Alan Modra
@ 2014-07-07 14:23     ` Alan Modra
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2014-07-07 14:23 UTC (permalink / raw)
  To: Nick Clifton, binutils

I've restored the same check in check_lto_shared_available.

    	* lib/ld-lib.exp (check_lto_shared_available): Reinstate compiler
    	check here too.

diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 9f7a414..9dac6be 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1700,6 +1700,10 @@ proc check_lto_shared_available { } {
     global CC
 
     if {![info exists lto_shared_available_saved]} {
+        if { [which $CC] == 0 } {
+	    set lto_shared_available_saved 0
+	    return 0
+	}
 	# Check if gcc supports -flto -fuse-linker-plugin -shared
 	set flags ""
 	if [board_info [target_info name] exists cflags] {

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-07 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-07 13:41 Commit: Fix check_lto_available proc Nick Clifton
2014-07-07 14:01 ` Alan Modra
2014-07-07 14:09   ` Alan Modra
2014-07-07 14:23     ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).