Check if -pg links in check_profiling_available
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 13 Jan 2015 21:13:36 +0000 (21:13 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 13 Jan 2015 21:13:36 +0000 (13:13 -0800)
* lib/target-supports.exp (check_profiling_available): Check if
-pg links.

From-SVN: r219560

gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp

index a0163c3875f4f104c180f28d5f6bc052bb212c00..5e58e7d1675c55cdb741aa2d4e34cad24a1e25a8 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * lib/target-supports.exp (check_profiling_available): Check if
+       -pg links.
+
 2015-01-13  Jan Hubicka  <hubicka@ucw.cz>
 
        PR ipa/64565
index 0ac96466d4ba362cdbfa379ad049aa666493db02..61bff53754b5b969318f5ff8a366069c7af6ddf3 100644 (file)
@@ -549,7 +549,16 @@ proc check_profiling_available { test_what } {
        }
     }
 
-    return $profiling_available_saved
+    # -pg link test result can't be cached since it may change between
+    # runs.
+    set profiling_working $profiling_available_saved
+    if { $profiling_available_saved == 1
+         && ![check_no_compiler_messages_nocache profiling executable {
+             int main() { return 0; } } "-pg"] } {
+       set profiling_working 0
+    }
+
+    return $profiling_working
 }
 
 # Check to see if a target is "freestanding". This is as per the definition