1*7c3d14c8STreehugger Robot# -*- Python -*- 2*7c3d14c8STreehugger Robot 3*7c3d14c8STreehugger Robotimport os 4*7c3d14c8STreehugger Robot 5*7c3d14c8STreehugger Robot# Setup config name. 6*7c3d14c8STreehugger Robotconfig.name = 'SafeStack' 7*7c3d14c8STreehugger Robot 8*7c3d14c8STreehugger Robot# Setup source root. 9*7c3d14c8STreehugger Robotconfig.test_source_root = os.path.dirname(__file__) 10*7c3d14c8STreehugger Robot 11*7c3d14c8STreehugger Robot# Test suffixes. 12*7c3d14c8STreehugger Robotconfig.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test'] 13*7c3d14c8STreehugger Robot 14*7c3d14c8STreehugger Robot# Add clang substitutions. 15*7c3d14c8STreehugger Robotconfig.substitutions.append( ("%clang_nosafestack ", config.clang + " -O0 -fno-sanitize=safe-stack ") ) 16*7c3d14c8STreehugger Robotconfig.substitutions.append( ("%clang_safestack ", config.clang + " -O0 -fsanitize=safe-stack ") ) 17*7c3d14c8STreehugger Robot 18*7c3d14c8STreehugger Robotif config.lto_supported: 19*7c3d14c8STreehugger Robot config.available_features.add('lto') 20*7c3d14c8STreehugger Robot config.substitutions.append((r"%clang_lto_safestack ", ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-flto -fsanitize=safe-stack ']))) 21*7c3d14c8STreehugger Robot 22*7c3d14c8STreehugger Robot# SafeStack tests are currently supported on Linux, FreeBSD and Darwin only. 23*7c3d14c8STreehugger Robotif config.host_os not in ['Linux', 'FreeBSD', 'Darwin']: 24*7c3d14c8STreehugger Robot config.unsupported = True 25*7c3d14c8STreehugger Robot 26*7c3d14c8STreehugger Robot# Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL 27*7c3d14c8STreehugger Robot# because the test fail due some runtime issue. 28*7c3d14c8STreehugger Robotif config.target_arch != 'aarch64': 29*7c3d14c8STreehugger Robot config.available_features.add('stable-runtime') 30