Lines Matching +full:libunwind +full:- +full:build
6 set(LLVM_SUBPROJECT_TITLE "libunwind")
28 message(FATAL_ERROR "Libunwind doesn't build for MSVC targets, and that is almost certainly not what you want to do "
29 "anyway since libunwind is tied to the Itanium C++ ABI, and MSVC targets must use the MS C++ ABI.")
39 option(LIBUNWIND_ENABLE_CET "Build libunwind with CET enabled." OFF)
40 option(LIBUNWIND_ENABLE_GCS "Build libunwind with GCS enabled." OFF)
41 option(LIBUNWIND_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
44 option(LIBUNWIND_ENABLE_SHARED "Build libunwind as a shared library." ON)
45 option(LIBUNWIND_ENABLE_STATIC "Build libunwind as a static library." ON)
46 option(LIBUNWIND_ENABLE_CROSS_UNWINDING "Enable cross-platform unwinding support." OFF)
48 option(LIBUNWIND_ENABLE_THREADS "Build libunwind with threading support." ON)
50 option(LIBUNWIND_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
51 option(LIBUNWIND_INCLUDE_DOCS "Build the libunwind documentation." ${LLVM_INCLUDE_DOCS})
52 option(LIBUNWIND_INCLUDE_TESTS "Build the libunwind tests." ${LLVM_INCLUDE_TESTS})
53 option(LIBUNWIND_IS_BAREMETAL "Build libunwind for baremetal targets." OFF)
56 option(LIBUNWIND_INSTALL_HEADERS "Install the libunwind headers." ON)
57 option(LIBUNWIND_ENABLE_FRAME_APIS "Include libgcc-compatible frame apis." OFF)
61 option(LIBUNWIND_INSTALL_LIBRARY "Install the libunwind library." ON)
63 "Install the static libunwind library." ON
66 "Install the shared libunwind library." ON
70 "Version of libunwind. This will be reflected in the name of the shared library produced.
71 For example, -DLIBUNWIND_LIBRARY_VERSION=x.y will result in the library being named
72 libunwind.x.y.dylib, along with the usual symlinks pointing to that. On Apple platforms,
77 set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-shared-mingw.cfg.in")
79 set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-static-mingw.cfg.in")
82 set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-shared.cfg.in")
84 set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-static.cfg.in")
88 If a relative path is provided, it is assumed to be relative to '<monorepo>/libunwind/test/configs'.")
92 message(STATUS "Using libunwind testing configuration: ${LIBUNWIND_TEST_CONFIG}")
97 message(FATAL_ERROR "libunwind must be built as either a shared or static library.")
101 message(FATAL_ERROR "libunwind CET support is not available for MSVC!")
113 # https://web.archive.org/web/20180828210612/https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking
123 CMAKE_FLAGS -DCMAKE_C_LINK_EXECUTABLE='echo')
136 "Path where built libunwind headers should be installed.")
138 "Path where built libunwind runtime libraries should be installed.")
140 set(LIBUNWIND_SHARED_OUTPUT_NAME "unwind" CACHE STRING "Output name for the shared libunwind runtime library.")
141 set(LIBUNWIND_STATIC_OUTPUT_NAME "unwind" CACHE STRING "Output name for the static libunwind runtime library.")
150 "Path where built libunwind libraries should be installed.")
159 "Path where built libunwind libraries should be installed.")
172 "Additional libraries libunwind is linked to which can be provided in cache")
174 # Include macros for adding and removing libunwind flags.
182 include(config-ix)
185 list(APPEND LIBUNWIND_LINK_FLAGS "-rtlib=compiler-rt")
188 add_compile_flags_if_supported(-Werror=return-type)
191 add_compile_flags_if_supported(-fcf-protection=full)
192 add_compile_flags_if_supported(-mshstk)
194 message(SEND_ERROR "Compiler doesn't support CET -fcf-protection option!")
197 message(SEND_ERROR "Compiler doesn't support CET -mshstk option!")
202 add_compile_flags_if_supported(-mbranch-protection=standard)
204 message(SEND_ERROR "Compiler doesn't support GCS -mbranch-protection option!")
213 add_compile_flags_if_supported(-Wno-dll-attribute-on-redeclaration)
217 add_compile_flags(-mfp64)
224 add_cxx_compile_flags_if_supported(-fstrict-aliasing)
225 add_cxx_compile_flags_if_supported(-EHsc)
229 # The reason why this was added is that when building libunwind for
230 # ARM Linux, we need to pass the -funwind-tables flag in order for it to
235 # to __aeabi_unwind_cpp_pr0, which is defined in libunwind itself,
238 # This leads to libunwind not being built with this flag, which makes
239 # libunwind quite useless in this setup.
242 add_compile_flags_if_supported(-funwind-tables)
246 message(SEND_ERROR "The -funwind-tables flag must be supported "
250 add_cxx_compile_flags_if_supported(-fno-exceptions)
251 add_cxx_compile_flags_if_supported(-fno-rtti)
255 list(APPEND LIBUNWIND_COMPILE_FLAGS -nostdinc++)
256 # Remove -stdlib flags to prevent them from causing an unused flag warning.
257 string(REPLACE "--stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
258 string(REPLACE "--stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
259 string(REPLACE "-stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
260 string(REPLACE "-stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
268 add_compile_flags(-D_DEBUG)
274 add_compile_flags(-UNDEBUG)
278 add_compile_flags(-DNDEBUG)
282 # Cross-unwinding
284 add_compile_flags(-D_LIBUNWIND_IS_NATIVE_ONLY)
289 add_compile_flags(-D_LIBUNWIND_SUPPORT_FRAME_APIS)
292 # Threading-support
294 add_compile_flags(-D_LIBUNWIND_HAS_NO_THREADS)
299 # __ARM_WMMX is a compiler pre-define (as per the ACLE 2.0). Clang does not
303 add_compile_flags(-D__ARM_WMMX)
320 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
325 add_definitions(-D_LIBUNWIND_LINK_DL_LIB)
328 add_definitions(-D_LIBUNWIND_LINK_PTHREAD_LIB)