# -*- Python -*- import os # Setup config name. config.name = 'Scudo' + config.name_suffix # Setup source root. config.test_source_root = os.path.dirname(__file__) # Path to the static library base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.scudo-%s.a" % config.target_arch) whole_archive = "-Wl,-whole-archive %s -Wl,-no-whole-archive " % base_lib # Test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] # C flags. c_flags = ([config.target_cflags] + ["-std=c++11", "-pthread", "-fPIE", "-pie", "-O0", "-UNDEBUG", "-ldl", "-lrt", "-Wl,--gc-sections"]) def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " # Add clang substitutions. config.substitutions.append( ("%clang_scudo ", build_invocation(c_flags) + whole_archive) ) # Hardened Allocator tests are currently supported on Linux only. if config.host_os not in ['Linux']: config.unsupported = True