[PATCH] Annocheck: Ignore more tests for LLVM and Clang

Tulio Magno Quites Machado Filho tuliom@ascii.art.br
Thu Jun 11 19:43:58 GMT 2026


From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>

Skip tests cf-protection, optimization, property-note, stack-clash and
stack-prot when LLVM or Clang is found because the plugins for LLVM and
Clang are not enabled by default on Fedora and CentOS.
---
 annocheck/hardened.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/annocheck/hardened.c b/annocheck/hardened.c
index f03760b..a981c6a 100644
--- a/annocheck/hardened.c
+++ b/annocheck/hardened.c
@@ -10202,6 +10202,10 @@ finish (annocheck_data * data)
 		skip (data, i, SOURCE_FINAL_SCAN, "gcc static libraries do not have annobin data or debug information");
 	      else if (is_comboot_module (data))
 		skip (data, i, SOURCE_FINAL_SCAN, "COMBOOT modules do not use stack protection");
+	      else if (LLVM_compiler_used ())
+		skip (data, i, SOURCE_FINAL_SCAN, "Annobin plugin is not currently required for LLVM compilers");
+	      else if (! GCC_compiler_used () && LLVM_compiler_seen ())
+		skip (data, i, SOURCE_FINAL_SCAN, "no notes have been found. Annobin plugin is not currently required for LLVM compilers");
 	      else if (C_compiler_seen ())
 		warn_about_missing_notes (data, i);
 	      else if (per_file.warned_dw_at_producer)
@@ -10242,7 +10246,12 @@ finish (annocheck_data * data)
 	      else if (is_comboot_module (data))
 		skip (data, i, SOURCE_FINAL_SCAN, "COMBOOT modules do not have annobin data or debug information");
 	      else if (C_compiler_seen ())
-		warn_about_missing_notes (data, i);
+		if (LLVM_compiler_used ())
+		  skip (data, i, SOURCE_FINAL_SCAN, "Annobin plugin is not currently required for LLVM compilers");
+		else if (! GCC_compiler_used () && LLVM_compiler_seen ())
+		  skip (data, i, SOURCE_FINAL_SCAN, "no notes have been found. Annobin plugin is not currently required for LLVM compilers");
+		else
+		  warn_about_missing_notes (data, i);
 	      else if (per_file.warned_dw_at_producer)
 		skip (data, i, SOURCE_FINAL_SCAN, "could not check for options in the DWARF DW_AT_producer string");
 	      else if (assembler_seen ())
@@ -10276,6 +10285,10 @@ finish (annocheck_data * data)
 		{
 		  if (exception_for_gcc)
 		    skip (data, i, SOURCE_FINAL_SCAN, "gcc static libraries do not have annobin data or debug information");
+		  else if (LLVM_compiler_used ())
+		    skip (data, i, SOURCE_FINAL_SCAN, "Annobin plugin is not currently required for LLVM compilers");
+		  else if (! GCC_compiler_used () && LLVM_compiler_seen ())
+		    skip (data, i, SOURCE_FINAL_SCAN, "no notes have been found. Annobin plugin is not currently required for LLVM compilers");
 		  else if (GCC_compiler_seen ())
 		    warn_about_missing_notes (data, i);
 		  else
@@ -10311,6 +10324,10 @@ finish (annocheck_data * data)
 		  else
 		    skip (data, i, SOURCE_FINAL_SCAN, "property notes are not currently supported by Rust binaries");
 		}
+	      else if (LLVM_compiler_used ())
+		skip (data, i, SOURCE_FINAL_SCAN, "Annobin plugin is not currently required for LLVM compilers");
+	      else if (! GCC_compiler_used () && LLVM_compiler_seen ())
+		skip (data, i, SOURCE_FINAL_SCAN, "no notes have been found. The Annobin plugin is not currently required for LLVM compilers");
 	      else if (is_aarch64 ())
 		{
 		  if (test_enabled (TEST_BRANCH_PROTECTION))
@@ -10374,7 +10391,9 @@ finish (annocheck_data * data)
 		skip (data, i, SOURCE_FINAL_SCAN, "kernel tools do not use control flow protection");	
 	      else if (test_enabled (TEST_PROPERTY_NOTE))
 		{
-		  if (untested (TEST_PROPERTY_NOTE))
+		  if (! GCC_compiler_used () && LLVM_compiler_seen ())
+		    skip (data, i, SOURCE_FINAL_SCAN, "no notes have been found. The Annobin plugin is not currently required for LLVM compilers");
+		  else if(untested (TEST_PROPERTY_NOTE))
 		    fail (data, i, SOURCE_FINAL_SCAN, "no .note.gnu.property section = no control flow information");
 		  else if (! already_passed (TEST_PROPERTY_NOTE))
 		    fail (data, i, SOURCE_FINAL_SCAN, ".note.gnu.property section did not contain the expected notes");
-- 
2.50.1



More information about the Annobin mailing list