From: Charles Davis Date: Tue, 4 Sep 2018 20:57:50 +0000 (+0000) Subject: [CMake] Don't use -rtlib=compiler-rt with -nodefaultlibs. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c08654b17118106919500a51e9623fbc8470b3a;p=platform%2Fupstream%2Fllvm.git [CMake] Don't use -rtlib=compiler-rt with -nodefaultlibs. Summary: This switch only has an effect at link time. It changes the default compiler support library to `compiler-rt`. With `-nodefaultlibs`, this library won't get linked anyway; Clang actually warns about that. Reviewers: mstorsjo, rnk Subscribers: dberris, mgorny, christof, cfe-commits Differential Revision: https://reviews.llvm.org/D51645 llvm-svn: 341404 --- diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index d73c0dd..bab9e08 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -234,7 +234,7 @@ endif() # Configure compiler. include(config-ix) -if (LIBUNWIND_USE_COMPILER_RT) +if (LIBUNWIND_USE_COMPILER_RT AND NOT LIBUNWIND_HAS_NODEFAULTLIBS_FLAG) list(APPEND LIBUNWIND_LINK_FLAGS "-rtlib=compiler-rt") endif() diff --git a/libunwind/cmake/config-ix.cmake b/libunwind/cmake/config-ix.cmake index 2d4da64..f4f9ee8 100644 --- a/libunwind/cmake/config-ix.cmake +++ b/libunwind/cmake/config-ix.cmake @@ -23,7 +23,6 @@ if (LIBUNWIND_HAS_NODEFAULTLIBS_FLAG) list(APPEND CMAKE_REQUIRED_LIBRARIES c) endif () if (LIBUNWIND_USE_COMPILER_RT) - list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt) find_compiler_rt_library(builtins LIBUNWIND_BUILTINS_LIBRARY) list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBUNWIND_BUILTINS_LIBRARY}") elseif (LIBUNWIND_HAS_GCC_S_LIB)