Skip to content

Commit

Permalink
Unconditionally enable LTO in linker (#6350)
Browse files Browse the repository at this point in the history
Co-authored-by: Amaury Chamayou <[email protected]>
  • Loading branch information
maxtropets and achamayou authored Jul 10, 2024
1 parent 8294adf commit 0153c57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- The `cchost` configuration file now includes an `idle_connection_timeout` option. This controls how long the node will keep idle connections (for user TLS sessions) before automatically closing them. This may be set to `null` to restore the previous behaviour, where idle connections are never closed. By default connections will be closed after 60s of idle time.

### Changed

- Set LTO on for both debug/release linkages to support linking against CCF libraries if the client code has been built in debug mode.

## [5.0.0-rc0]

[5.0.0-rc0]: https://github.com/microsoft/CCF/releases/tag/ccf-5.0.0-rc0
Expand Down
4 changes: 3 additions & 1 deletion cmake/preproject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ endif()
if("${COMPILE_TARGET}" STREQUAL "snp" OR "${COMPILE_TARGET}" STREQUAL "virtual")
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND NOT TSAN)
add_compile_options(-flto)
add_link_options(-flto)
endif()
# Unconditionally make linker aware of possible LTO happening. Otherwise
# targets built in Debug and linked against this will fail linkage.
add_link_options(-flto)
endif()

set(CMAKE_CXX_STANDARD 20)

0 comments on commit 0153c57

Please sign in to comment.