From 071926e94edabd47fed6639a1100a8e65de996a8 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 29 Jun 2024 22:07:18 +0200 Subject: [PATCH] Enable LTO by default --- .github/workflows/osrm-backend.yml | 6 +----- CHANGELOG.md | 1 + CMakeLists.txt | 2 +- scripts/ci/windows-build.bat | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 613c29a56..762e5dc0c 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -304,7 +304,6 @@ jobs: CXXCOMPILER: clang++-13 ENABLE_CONAN: ON NODE_PACKAGE_TESTS_ONLY: ON - ENABLE_LTO: ON - name: conan-linux-debug-node build_node_package: true @@ -316,7 +315,6 @@ jobs: CXXCOMPILER: clang++-13 ENABLE_CONAN: ON NODE_PACKAGE_TESTS_ONLY: ON - ENABLE_LTO: ON - name: conan-macos-x64-release-node build_node_package: true @@ -329,7 +327,6 @@ jobs: CUCUMBER_TIMEOUT: 60000 ENABLE_ASSERTIONS: ON ENABLE_CONAN: ON - ENABLE_LTO: ON - name: conan-macos-arm64-release-node build_node_package: true @@ -342,7 +339,6 @@ jobs: CUCUMBER_TIMEOUT: 60000 ENABLE_ASSERTIONS: ON ENABLE_CONAN: ON - ENABLE_LTO: ON name: ${{ matrix.name}} continue-on-error: ${{ matrix.continue-on-error }} @@ -527,7 +523,7 @@ jobs: -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ -DENABLE_CCACHE=ON \ -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DCMAKE_ENABLE_LTO=${ENABLE_LTO:-OFF} + -DCMAKE_ENABLE_LTO=${ENABLE_LTO:-ON} make --jobs=${JOBS} if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b0eb65a8..23170c79d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - NodeJS: - CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452) - Misc: + - CHANGED: Use Link Time Optimisation whenever possible. [#6967](https://github.com/Project-OSRM/osrm-backend/pull/6967) - CHANGED: Use struct instead of tuple to define UnpackedPath. [#6974](https://github.com/Project-OSRM/osrm-backend/pull/6974) - CHANGED: Micro performance optimisation in map matching. [#6976](https://github.com/Project-OSRM/osrm-backend/pull/6976) - CHANGED: Re-use priority queue in StaticRTree. [#6952](https://github.com/Project-OSRM/osrm-backend/pull/6952) diff --git a/CMakeLists.txt b/CMakeLists.txt index f114ee8d5..046d8877f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF) option(ENABLE_DEBUG_LOGGING "Use debug logging in release mode" OFF) option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF) option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF) -option(ENABLE_LTO "Use LTO if available" OFF) +option(ENABLE_LTO "Use Link Time Optimisation" ON) option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF) option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF) option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF) diff --git a/scripts/ci/windows-build.bat b/scripts/ci/windows-build.bat index 7b3f86146..2102c9340 100644 --- a/scripts/ci/windows-build.bat +++ b/scripts/ci/windows-build.bat @@ -11,7 +11,7 @@ mkdir build IF %ERRORLEVEL% NEQ 0 GOTO ERROR cd build IF %ERRORLEVEL% NEQ 0 GOTO ERROR -cmake -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DENABLE_LTO=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "Visual Studio 17 2022" .. +cmake -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "Visual Studio 17 2022" .. IF %ERRORLEVEL% NEQ 0 GOTO ERROR msbuild OSRM.sln ^