[compiler-rt] 8ab7625 - [compiler-rt] Disable default config files for tests

Sam James via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 4 10:04:29 PST 2023


Author: Sam James
Date: 2023-02-04T18:04:23Z
New Revision: 8ab762557fb057af1a3015211ee116a975027e78

URL: https://github.com/llvm/llvm-project/commit/8ab762557fb057af1a3015211ee116a975027e78
DIFF: https://github.com/llvm/llvm-project/commit/8ab762557fb057af1a3015211ee116a975027e78.diff

LOG: [compiler-rt] Disable default config files for tests

Without this, if hardening measures like FORTIFY_SOURCE are are in
/etc/clang/*.cfg, many sanitizer tests will die before the sanitizer
can trap the problem being tested, because e.g. the _chk variants
of common functions will abort first.

This gets the number of failing tests down from 42->3 for me (and the
remaining 3 are unrelated).

See: 52ce6776cf98e993c6ec04ae54b52e1354fff917
See: 136f77805fd89cd30e69b3d1204fbf7efedd9a12
Closes: https://github.com/llvm/llvm-project/issues/60394

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D143322

Added: 
    

Modified: 
    compiler-rt/test/lit.common.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py
index a391a25235446..a4d2495beddb9 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -733,3 +733,10 @@ def is_windows_lto_supported():
       sh_quote(get_ios_commands_dir())
     ))
   )
+
+# It is not realistically possible to account for all options that could
+# possibly be present in system and user configuration files, so disable
+# default configs for the test runs. In particular, anything hardening
+# related is likely to cause issues with sanitizer tests, because it may
+# preempt something we're looking to trap (e.g. FORTIFY_SOURCE vs our ASAN).
+config.environment["CLANG_NO_DEFAULT_CONFIG"] = "1"


        


More information about the llvm-commits mailing list