Skip to content

Commit 4a9a06f

Browse files
authored
Merge pull request #316 from jolavillette/CMakeLtoOptOut
build(cmake): add RS_NO_LTO opt-out for the Release LTO
2 parents 931ef57 + 2b17add commit 4a9a06f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,10 @@ endif()
890890
# because enabling it causes the MinGW linker (ld) to run out of memory or exhaust the maximum
891891
# number of exported symbols, or emit "multiple definition" errors during LTO code generation.
892892
# While this makes the binary fatter and slower, it prevents fatal build failures.
893-
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT WIN32)
893+
# The same escape hatch (-DRS_NO_LTO=ON) also works around lto1 internal compiler
894+
# errors (segfault in the IPA icf pass) with the older GCC 10 LTO plugin, e.g. when
895+
# building on Debian 11 to produce a portable (old-glibc) AppImage.
896+
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT WIN32 AND NOT RS_NO_LTO)
894897
set_property(TARGET ${PROJECT_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
895898
endif()
896899

0 commit comments

Comments
 (0)