ld: Skip bootstrap tests for -fprofile-generate=
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 22 Oct 2020 13:10:08 +0000 (06:10 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 22 Oct 2020 14:03:59 +0000 (07:03 -0700)
Make plug_opt available to all linker tests.  Skip bootstrap tests when
linker is compiled with -fprofile-generate=.

* testsuite/ld-plugin/lto.exp (plug_opt): Moved to ...
* testsuite/config/default.exp (plug_opt): Here.  New.
* testsuite/ld-bootstrap/bootstrap.exp: Skip when linker is
compiled with -fprofile-generate=.

ld/ChangeLog
ld/testsuite/config/default.exp
ld/testsuite/ld-bootstrap/bootstrap.exp
ld/testsuite/ld-plugin/lto.exp

index 2e6cfd4a8b2f68585815f52ed68336fc70b25079..540ebae7930816ca7ebb4fa3a899445dc0362513 100644 (file)
@@ -1,3 +1,10 @@
+2020-10-22  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * testsuite/ld-plugin/lto.exp (plug_opt): Moved to ...
+       * testsuite/config/default.exp (plug_opt): Here.  New.
+       * testsuite/ld-bootstrap/bootstrap.exp: Skip when linker is
+       compiled with -fprofile-generate=.
+
 2020-10-22  H.J. Lu  <hongjiu.lu@intel.com>
 
        * testsuite/config/default.exp (NOLTO_CFLAGS): New.
index e5730ff565476770e32dfdd3728d4098806e529a..73d61dec27207549cf0ce0115dc833ac624c2844 100644 (file)
@@ -424,3 +424,20 @@ if { [istarget alpha*-*-*vms*] } {
     }
     unset f src
 }
+
+set plugin_names {
+    liblto_plugin.so
+    liblto_plugin-0.dll
+    cyglto_plugin-0.dll
+}
+set plug_opt ""
+foreach plug $plugin_names {
+    set plug_so [run_host_cmd $CC "--print-prog-name $plug"]
+    if { $plug_so eq $plug } then {
+       set plug_so [run_host_cmd $CC "--print-file-name $plug"]
+    }
+    if { $plug_so ne $plug } then {
+       set plug_opt "--plugin $plug_so"
+       break
+    }
+}
index 43928fb6483fd2d2f11dbb03c27686bf281d6543..2342d509fc0e44523998c3ab74a8cecaa8eb868a 100644 (file)
@@ -29,7 +29,13 @@ if ![isnative] {
     return
 }
 
-# Determine if plugin support is present.
+# Skip for -fprofile-generate=.
+catch "exec $nm $plug_opt $OFILES" exec_output
+send_log "foo: $exec_output"
+if { [ string match "*__gcov_*" $exec_output ] } {
+    return
+}
+
 remote_exec host "$nm --help" "" "/dev/null" "plugin-support"
 set tmp [file_contents "plugin-support"]
 regexp ".*\(--plugin\).*\n" $tmp foo plugins
index abb712575f40eefceb9cc2b0bf9a98d6402c04f6..9f9f2d13ced3d7f93b21eeab041a59f273d354be 100644 (file)
@@ -41,22 +41,6 @@ proc restore_notify { } {
   set CXXFLAGS "$saved_CXXFLAGS"
 }
 
-set plugin_names {
-    liblto_plugin.so
-    liblto_plugin-0.dll
-    cyglto_plugin-0.dll
-}
-set plug_opt ""
-foreach plug $plugin_names {
-    set plug_so [run_host_cmd $CC "--print-prog-name $plug"]
-    if { $plug_so eq $plug } then {
-       set plug_so [run_host_cmd $CC "--print-file-name $plug"]
-    }
-    if { $plug_so ne $plug } then {
-       set plug_opt "--plugin $plug_so"
-       break
-    }
-}
 set lto_fat ""
 set lto_no_fat ""
 if { [check_lto_fat_available] } {
This page took 0.029008 seconds and 4 git commands to generate.