Peter Collingbourne 3fa07ed5b3
Rename config.host_os to config.target_os.
config.host_os is derived from CMAKE_SYSTEM_NAME
which specifies the target. See:
https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html

To reduce confusion, rename it to config.target_os.

The variable name config.target_os was already being used by the Orc
tests. Rename it to config.orc_test_target_os with a FIXME to remove.

Reviewers: JDevlieghere, MaskRay

Reviewed By: MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/149015
2025-07-17 11:12:29 -07:00

38 lines
891 B
Python

# -*- Python -*-
import os
# Setup config name.
config.name = "SafeStack-" + config.name_suffix
# Setup source root.
config.test_source_root = os.path.dirname(__file__)
# Test suffixes.
config.suffixes = [".c", ".cpp", ".m", ".mm", ".ll", ".test"]
# Add clang substitutions.
config.substitutions.append(
(
"%clang_nosafestack ",
config.clang + config.target_cflags + " -O0 -fno-sanitize=safe-stack ",
)
)
config.substitutions.append(
(
"%clang_safestack ",
config.clang + config.target_cflags + " -O0 -fsanitize=safe-stack ",
)
)
if config.lto_supported:
config.substitutions.append(
(
r"%clang_lto_safestack ",
" ".join([config.clang] + config.lto_flags + ["-fsanitize=safe-stack "]),
)
)
if config.target_os not in ["Linux", "FreeBSD", "NetBSD", "SunOS"]:
config.unsupported = True