Author: cdavis Date: Tue Sep 4 13:57:50 2018 New Revision: 341404 URL: http://llvm.org/viewvc/llvm-project?rev=341404&view=rev Log: [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 Modified: libunwind/trunk/CMakeLists.txt libunwind/trunk/cmake/config-ix.cmake Modified: libunwind/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=341404&r1=341403&r2=341404&view=diff ============================================================================== --- libunwind/trunk/CMakeLists.txt (original) +++ libunwind/trunk/CMakeLists.txt Tue Sep 4 13:57:50 2018 @@ -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() Modified: libunwind/trunk/cmake/config-ix.cmake URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/cmake/config-ix.cmake?rev=341404&r1=341403&r2=341404&view=diff ============================================================================== --- libunwind/trunk/cmake/config-ix.cmake (original) +++ libunwind/trunk/cmake/config-ix.cmake Tue Sep 4 13:57:50 2018 @@ -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) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits