From d030f2064878c90c97aafa9c6c65fd6debc85188 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 13 Mar 2026 12:05:14 -0400 Subject: [PATCH] Disable LTO for ZLIB Signed-off-by: Juan Cruz Viotti --- cmake/FindZLIB.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/FindZLIB.cmake b/cmake/FindZLIB.cmake index cb77330..2896ddb 100644 --- a/cmake/FindZLIB.cmake +++ b/cmake/FindZLIB.cmake @@ -64,6 +64,12 @@ if(NOT ZLIB_FOUND) -fno-math-errno -fwrapv) endif() + + # Disable LTO for zlib to work around GCC LTO linker plugin not + # properly rescanning this archive for transitive dependencies + if(HYDRA_COMPILER_GCC) + target_compile_options(zlib PRIVATE -fno-lto) + endif() endif() target_include_directories(zlib PUBLIC