On 4/2/20 4:09 AM, Tobias Burnus wrote:
Interestingly, only those two testcases use the effective-target check:
gcc.dg/analyzer/sigsetjmp-5.c, gcc.dg/analyzer/sigsetjmp-6.c

Regarding the link test: No header file is included – it just
defines the function ("extern char $funcname();") and calls it.

This is the same way configure scripts test for the existence of a library function; the test case is just an arbitrary reference to the named function that will generate an undefined symbol error from the linker if the standard libraries don't provide a definition.

The check fails as "sigsetjmp" does not exist in glibc –
the symbol is "__sigsetjmp" in glibc.

I've checked in this followup patch to make it also test for the presence of __sigsetjmp, and verified that the test case now runs and passes on x86_64_linux-gnu.

-Sandra
commit a950bb6e95236bb60ec17cda36763945d3d0a714
Author: Sandra Loosemore <san...@codesourcery.com>
Date:   Thu Apr 2 13:37:58 2020 -0700

    Fix check_effective_target_sigsetjmp for glibc targets.
    
    2020-04-02  Sandra Loosemore  <san...@codesourcery.com>
    
    	gcc/testsuite/
    	* lib/target-supports.exp (check_effective_target_sigsetjmp): Test
    	for __sigsetjmp as well as sigsetjmp.

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 050cecd..cd8d7e1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-02  Sandra Loosemore  <san...@codesourcery.com>
+
+	* lib/target-supports.exp (check_effective_target_sigsetjmp): Test
+	for __sigsetjmp as well as sigsetjmp.
+
 2020-04-02  Fritz Reese  <fore...@gcc.gnu.org>
 
 	PR fortran/85982
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 3654e7b..0dfe3ae 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -9036,9 +9036,15 @@ proc check_effective_target_stpcpy {} {
 }
 
 # Returns 1 if "sigsetjmp" is available on the target system.
+# Also check if "__sigsetjmp" is defined since that's what glibc
+# uses.
 
 proc check_effective_target_sigsetjmp {} {
-    return [check_function_available "sigsetjmp"]
+    if { [check_function_available "sigsetjmp"]
+         || [check_function_available "__sigsetjmp"] } {
+	return 1
+    }
+    return 0
 }
 
 # Check whether the vectorizer tests are supported by the target and

Reply via email to