[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / compiler-rt / lib / msan / CMakeLists.txt
bloba0b9c61584c98da6616b0466c6777d750691eeec
1 include_directories(..)
3 # Runtime library sources and build flags.
4 set(MSAN_RTL_SOURCES
5   msan.cpp
6   msan_allocator.cpp
7   msan_chained_origin_depot.cpp
8   msan_dl.cpp
9   msan_interceptors.cpp
10   msan_linux.cpp
11   msan_report.cpp
12   msan_thread.cpp
13   msan_poisoning.cpp
14   )
16 set(MSAN_RTL_CXX_SOURCES
17   msan_new_delete.cpp
18   )
20 set(MSAN_RTL_HEADERS
21   msan.h
22   msan_allocator.h
23   msan_chained_origin_depot.h
24   msan_dl.h
25   msan_flags.h
26   msan_flags.inc
27   msan_interface_internal.h
28   msan_origin.h
29   msan_poisoning.h
30   msan_report.h
31   msan_thread.h
32   )
34 set(MSAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS})
35 if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
36   append_list_if(COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC -ftls-model=initial-exec MSAN_RTL_CFLAGS)
37 endif()
38 append_rtti_flag(OFF MSAN_RTL_CFLAGS)
39 if(NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
40   append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE MSAN_RTL_CFLAGS)
41 endif()
42 # Prevent clang from generating libc calls.
43 append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding MSAN_RTL_CFLAGS)
45 set(MSAN_RUNTIME_LIBRARIES)
47 # Static runtime library.
48 add_compiler_rt_component(msan)
50 foreach(arch ${MSAN_SUPPORTED_ARCH})
51   add_compiler_rt_runtime(clang_rt.msan
52     STATIC
53     ARCHS ${arch}
54     SOURCES ${MSAN_RTL_SOURCES}
55             $<TARGET_OBJECTS:RTInterception.${arch}>
56             $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
57             $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
58             $<TARGET_OBJECTS:RTSanitizerCommonCoverage.${arch}>
59             $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
60             $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.${arch}>
61             $<TARGET_OBJECTS:RTUbsan.${arch}>
62     ADDITIONAL_HEADERS ${MSAN_RTL_HEADERS}
63     CFLAGS ${MSAN_RTL_CFLAGS}
64     PARENT_TARGET msan)
65   add_compiler_rt_runtime(clang_rt.msan_cxx
66     STATIC
67     ARCHS ${arch}
68     SOURCES ${MSAN_RTL_CXX_SOURCES}
69     ADDITIONAL_HEADERS ${MSAN_RTL_HEADERS}
70     CFLAGS ${MSAN_RTL_CFLAGS}
71     PARENT_TARGET msan)
72   list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch}
73                                      clang_rt.msan_cxx-${arch})
74   if(SANITIZER_USE_SYMBOLS)
75     add_sanitizer_rt_symbols(clang_rt.msan
76       ARCHS ${arch}
77       EXTRA msan.syms.extra)
78     add_sanitizer_rt_symbols(clang_rt.msan_cxx
79       ARCHS ${arch}
80       EXTRA msan.syms.extra)
81     add_dependencies(msan clang_rt.msan-${arch}-symbols
82                           clang_rt.msan_cxx-${arch}-symbols)
83   endif()
84 endforeach()
86 add_compiler_rt_resource_file(msan_ignorelist msan_ignorelist.txt msan)
87 list(APPEND MSAN_RUNTIME_LIBRARIES msan_ignorelist)
89 if(COMPILER_RT_INCLUDE_TESTS)
90   add_subdirectory(tests)
91 endif()