On 09 Jan 10:29, Thomas Schwinge wrote:
> 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.

Done.
Here is an updated and retested patch.  OK for trunk?


gcc/
        * Makefile.in (site.exp): Do not set ENABLE_LTO.
gcc/testsuite/
        * lib/target-supports.exp (check_effective_target_lto): Check for -flto
        option support instead of ENABLE_LTO from Makefile.


diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 5f9261f..44a4214 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3606,9 +3606,6 @@ site.exp: ./config.status Makefile
          echo "set PLUGINCFLAGS \"$(PLUGINCFLAGS)\"" >> ./site.tmp; \
          echo "set GMPINC \"$(GMPINC)\"" >> ./site.tmp; \
        fi
-       @if test "@enable_lto@" = "yes" ; then \
-         echo "set ENABLE_LTO 1" >> ./site.tmp; \
-       fi
 # If newlib has been configured, we need to pass -B to gcc so it can find
 # newlib's crt0.o if it exists.  This will cause a "path prefix not used"
 # message if it doesn't, but the testsuite is supposed to ignore the message -
diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index f5c6db8..2f069c3 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5736,11 +5736,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"]
 }
 
 # Return 1 if -mx32 -maddress-mode=short can compile, 0 otherwise.


  -- Ilya

Reply via email to