From 8ab762557fb057af1a3015211ee116a975027e78 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 4 Feb 2023 18:04:05 +0000 Subject: [PATCH] [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 --- compiler-rt/test/lit.common.cfg.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index a391a25..a4d2495 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -733,3 +733,10 @@ if config.host_os == 'Darwin': 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" -- 2.7.4