Conversation
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
🤖 Augment PR SummarySummary: Disables LTO when building the vendored Motivation: Works around a GCC LTO linker plugin issue where the 🤖 Was this summary useful? React with 👍 or 👎 |
| # 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) |
There was a problem hiding this comment.
If the project enables LTO globally (e.g., via INTERPROCEDURAL_OPTIMIZATION/CMAKE_INTERPROCEDURAL_OPTIMIZATION), it’s worth double-checking that adding -fno-lto here reliably overrides any injected -flto so zlib is truly built non-LTO in those configurations. Otherwise the GCC LTO plugin issue this comment mentions could still reproduce.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="cmake/FindZLIB.cmake">
<violation number="1" location="cmake/FindZLIB.cmake:70">
P2: Scope this LTO workaround to static zlib builds; as written it also disables LTO for shared builds that are not affected by the archive-rescan issue.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| # Disable LTO for zlib to work around GCC LTO linker plugin not | ||
| # properly rescanning this archive for transitive dependencies | ||
| if(HYDRA_COMPILER_GCC) |
There was a problem hiding this comment.
P2: Scope this LTO workaround to static zlib builds; as written it also disables LTO for shared builds that are not affected by the archive-rescan issue.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cmake/FindZLIB.cmake, line 70:
<comment>Scope this LTO workaround to static zlib builds; as written it also disables LTO for shared builds that are not affected by the archive-rescan issue.</comment>
<file context>
@@ -64,6 +64,12 @@ if(NOT ZLIB_FOUND)
+
+ # 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()
</file context>
| if(HYDRA_COMPILER_GCC) | |
| if(HYDRA_COMPILER_GCC AND NOT BUILD_SHARED_LIBS) |
Signed-off-by: Juan Cruz Viotti jv@jviotti.com