1# -*- Python -*- 2 3import os 4 5# Setup config name. 6config.name = "ShadowCallStack" 7 8# Setup source root. 9config.test_source_root = os.path.dirname(__file__) 10 11# Test suffixes. 12config.suffixes = [".c", ".cpp", ".m", ".mm", ".ll", ".test"] 13 14# Add clang substitutions. 15config.substitutions.append( 16 ( 17 "%clang_noscs ", 18 config.clang 19 + " -O0 -fno-sanitize=shadow-call-stack " 20 + config.target_cflags 21 + " ", 22 ) 23) 24 25scs_arch_cflags = config.target_cflags 26if config.target_arch == "aarch64": 27 scs_arch_cflags += " -ffixed-x18 " 28config.substitutions.append( 29 ( 30 "%clang_scs ", 31 config.clang + " -O0 -fsanitize=shadow-call-stack " + scs_arch_cflags + " ", 32 ) 33) 34 35if config.host_os not in ["Linux"] or config.target_arch not in ["aarch64", "riscv64"]: 36 config.unsupported = True 37