[PATCH] D23005: [CMake] Pass -nostdlib if supported

Jonas Hahnfeld via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 22:59:01 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL277419: [CMake] Pass -nostdlib if supported (authored by Hahnfeld).

Changed prior to commit:
  https://reviews.llvm.org/D23005?vs=66285&id=66430#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23005

Files:
  compiler-rt/trunk/CMakeLists.txt
  compiler-rt/trunk/cmake/config-ix.cmake

Index: compiler-rt/trunk/cmake/config-ix.cmake
===================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake
+++ compiler-rt/trunk/cmake/config-ix.cmake
@@ -26,6 +26,7 @@
 check_cxx_compiler_flag(-ffreestanding       COMPILER_RT_HAS_FFREESTANDING_FLAG)
 check_cxx_compiler_flag("-Werror -fno-function-sections" COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG)
 check_cxx_compiler_flag(-std=c++11           COMPILER_RT_HAS_STD_CXX11_FLAG)
+check_cxx_compiler_flag(-nostdlib            COMPILER_RT_HAS_NOSTDLIB_FLAG)
 check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC)
 check_cxx_compiler_flag(-fno-lto             COMPILER_RT_HAS_FNO_LTO_FLAG)
 check_cxx_compiler_flag("-Werror -msse3" COMPILER_RT_HAS_MSSE3_FLAG)
Index: compiler-rt/trunk/CMakeLists.txt
===================================================================
--- compiler-rt/trunk/CMakeLists.txt
+++ compiler-rt/trunk/CMakeLists.txt
@@ -111,6 +111,8 @@
 endif()
 
 append_string_if(COMPILER_RT_HAS_STD_CXX11_FLAG -std=c++11 CMAKE_CXX_FLAGS)
+# we don't need to link with the C++ library
+append_string_if(COMPILER_RT_HAS_NOSTDLIB_FLAG -nostdlib CMAKE_CXX_FLAGS)
 
 # Emulate C99 and C++11's __func__ for MSVC prior to 2013 CTP.
 if(NOT COMPILER_RT_HAS_FUNC_SYMBOL)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23005.66430.patch
Type: text/x-patch
Size: 1311 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160802/bc9f64ff/attachment.bin>


More information about the llvm-commits mailing list