Skip to content

Conversation

@openroad-ci
Copy link
Collaborator

  • Detailed information in the previous PR Enabled LTO (Link Time Optimization) except for gui. #9069
  • The previous PR caused ORFS fails in gui::save_image call. It was because LTO is mistakenly enabled for GUI static library in CMake env. This PR resolves the issue.
  • Moreover, Bazel build setting is changed slightly.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
…UI library.

- Unlike CMake, Bazel builds Qt from the source code, so Bazel can use LTO for Qt.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables Link-Time Optimization (LTO) for both Bazel and CMake builds to improve performance. For CMake, it introduces logic to detect operating systems where LTO is known to cause issues (Debian 11, Rocky Linux 8) and disables it accordingly. It also correctly disables LTO for the gui target, which was causing crashes. The changes are well-implemented. I've provided a couple of suggestions for the main CMakeLists.txt to improve the clarity of the build logs and the maintainability of the OS-checking logic.

CMakeLists.txt Outdated
Comment on lines 127 to 137
# Check for Debian 11 (Bullseye)
if(OS_ID STREQUAL "debian" AND OS_VERSION_ID STREQUAL "11")
set(LTO_UNSUPPORTED_OS TRUE)
message(STATUS "Detected Debian 11: LTO will be disabled due to known build issues")
endif()

# Check for Rocky Linux 8
if(OS_ID STREQUAL "rocky" AND OS_VERSION_ID MATCHES "^8")
set(LTO_UNSUPPORTED_OS TRUE)
message(STATUS "Detected Rocky Linux 8: LTO will be disabled due to known build issues")
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The separate checks for different unsupported operating systems can be combined into a single if statement using OR. This would make the code more concise and easier to extend with more unsupported OS versions in the future. The status message can also be made more generic to report which OS was detected.

  # Check for unsupported OS for LTO
  if((OS_ID STREQUAL "debian" AND OS_VERSION_ID STREQUAL "11") OR
     (OS_ID STREQUAL "rocky" AND OS_VERSION_ID MATCHES "^8"))
    set(LTO_UNSUPPORTED_OS TRUE)
    message(STATUS "Detected unsupported OS (${OS_ID} ${OS_VERSION_ID}): LTO will be disabled due to known build issues")
  endif()

Comment on lines +152 to +154
if(UPPER_BUILD_TYPE STREQUAL "RELEASE")
set(LTO_STATUS "enabled")
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The status message for LTO can be misleading. When the build type is not RELEASE, it reports LTO as "disabled", which is true for the current build but doesn't convey that LTO is configured and will be used for RELEASE builds. This could cause confusion. It would be more informative to indicate that LTO is configured for Release builds even when the current build type is different.

    if(UPPER_BUILD_TYPE STREQUAL "RELEASE")
      set(LTO_STATUS "enabled")
    else()
      set(LTO_STATUS "configured for Release builds")
    endif()

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@jhkim-pii jhkim-pii requested a review from maliberty January 14, 2026 09:48
@maliberty
Copy link
Member

Please run a secure CI to ensure we don't have any issues.

@gadfort FYI if you want to test it.

@gadfort
Copy link
Collaborator

gadfort commented Jan 14, 2026

@maliberty mine just finished (I started it earlier when I saw the PR): https://github.com/siliconcompiler/scgallery/actions/runs/21002832081

Looks to be passing for me

Please run a secure CI to ensure we don't have any issues.

@gadfort FYI if you want to test it.

@maliberty
Copy link
Member

I see a secure CI run was done already and passed.

@maliberty maliberty merged commit 4bec0d5 into The-OpenROAD-Project:master Jan 14, 2026
13 checks passed
@maliberty maliberty deleted the secure-enable-lto branch January 14, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants