Skip to content

Commit 535f2f2

Browse files
committed
Avoid unecessary changes to libc++ cmake
Created using spr 1.3.4
1 parent 3990524 commit 535f2f2

File tree

4 files changed

+8
-23
lines changed

4 files changed

+8
-23
lines changed

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unkn
192192
set(RUNTIMES_${target}_LLVM_TOOLS_DIR "${CMAKE_BINARY_DIR}/bin" CACHE BOOL "")
193193
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
194194

195+
# Enable FatLTO for Linux and baremetal runtimes
196+
set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
197+
set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
198+
195199
# Use .build-id link.
196200
list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
197201
endif()
@@ -274,6 +278,10 @@ if(FUCHSIA_SDK)
274278
set(RUNTIMES_${target}+asan+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
275279
set(RUNTIMES_${target}+asan+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
276280

281+
# Enable FatLTO for Fuchsia runtimes
282+
set(RUNTIMES_${target}_LLVM_ENABLE_LTO ON CACHE BOOL "")
283+
set(RUNTIMES_${target}_LLVM_ENABLE_FATLTO ON CACHE BOOL "")
284+
277285
# Use .build-id link.
278286
list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
279287
endforeach()

libcxx/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ option(LIBCXX_ENABLE_WIDE_CHARACTERS
102102
support the C functionality for wide characters. When wide characters are
103103
not supported, several parts of the library will be disabled, notably the
104104
wide character specializations of std::basic_string." ON)
105-
option(LIBCXX_ENABLE_FATLTO
106-
"Whether to compile libc++ with FatLTO enabled." ON)
107-
option(LIBCXX_ENABLE_LTO
108-
"Whether to compile libc++ with LTO enabled." ON)
109105

110106
# To use time zone support in libc++ the platform needs to have the IANA
111107
# database installed. Libc++ will fail to build if this is enabled on a

libcxx/src/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,6 @@ if (APPLE AND LLVM_USE_SANITIZER)
169169
endif()
170170
endif()
171171

172-
173-
if(LIBCXX_ENABLE_LTO)
174-
list(APPEND LIBCXX_COMPILE_FLAGS "-flto")
175-
list(APPEND LIBCXX_LINK_FLAGS "-flto")
176-
endif()
177-
if(LIBCXX_ENABLE_FATLTO)
178-
list(APPEND LIBCXX_COMPILE_FLAGS "-ffat-lto-objects")
179-
list(APPEND LIBCXX_LINK_FLAGS "-ffat-lto-objects")
180-
endif()
181-
182172
split_list(LIBCXX_COMPILE_FLAGS)
183173
split_list(LIBCXX_LINK_FLAGS)
184174

libcxxabi/src/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,6 @@ if ( APPLE )
143143
endif()
144144
endif()
145145

146-
if(LIBCXX_ENABLE_LTO)
147-
list(APPEND LIBCXXABI_COMPILE_FLAGS "-flto")
148-
list(APPEND LIBCXXABI_LINK_FLAGS "-flto")
149-
endif()
150-
if(LIBCXX_ENABLE_FATLTO)
151-
list(APPEND LIBCXXABI_COMPILE_FLAGS "-ffat-lto-objects")
152-
list(APPEND LIBCXXABI_LINK_FLAGS "-ffat-lto-objects")
153-
endif()
154-
155146
split_list(LIBCXXABI_COMPILE_FLAGS)
156147
split_list(LIBCXXABI_LINK_FLAGS)
157148

0 commit comments

Comments
 (0)