Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unconditionally enable LTO in linker #6350

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)