2015-06-16 05:08:47 +08:00
|
|
|
# -*- Python -*-
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
# Setup config name.
|
|
|
|
config.name = 'SafeStack'
|
|
|
|
|
|
|
|
# Setup source root.
|
|
|
|
config.test_source_root = os.path.dirname(__file__)
|
|
|
|
|
|
|
|
# Test suffixes.
|
2019-08-06 03:25:35 +08:00
|
|
|
config.suffixes = ['.c', '.cpp', '.m', '.mm', '.ll', '.test']
|
2015-06-16 05:08:47 +08:00
|
|
|
|
|
|
|
# Add clang substitutions.
|
|
|
|
config.substitutions.append( ("%clang_nosafestack ", config.clang + " -O0 -fno-sanitize=safe-stack ") )
|
|
|
|
config.substitutions.append( ("%clang_safestack ", config.clang + " -O0 -fsanitize=safe-stack ") )
|
|
|
|
|
|
|
|
if config.lto_supported:
|
2022-04-20 01:29:44 +08:00
|
|
|
config.substitutions.append((r"%clang_lto_safestack ", ' '.join([config.clang] + config.lto_flags + ['-fsanitize=safe-stack '])))
|
2015-06-16 05:08:47 +08:00
|
|
|
|
2018-08-15 03:46:16 +08:00
|
|
|
if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD']:
|
2015-06-16 05:08:47 +08:00
|
|
|
config.unsupported = True
|