From e408b35b96b138f91e003434e70e4b428ab6e58e Mon Sep 17 00:00:00 2001 From: Guilherme Amadio Date: Mon, 12 Jun 2023 16:23:11 +0200 Subject: [PATCH] [XrdPosix] Do not compile XrdPosixPreload with link-time optimizations Fixes: #2032 --- src/XrdPosix.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/XrdPosix.cmake b/src/XrdPosix.cmake index df769110d45..e8db4bc2f99 100644 --- a/src/XrdPosix.cmake +++ b/src/XrdPosix.cmake @@ -70,6 +70,12 @@ set_target_properties( VERSION ${XRD_POSIX_PRELOAD_VERSION} SOVERSION ${XRD_POSIX_PRELOAD_SOVERSION} ) +# This is a special library meant to be loaded with LD_PRELOAD. +# It is meant to replace symbols from the system and as such +# must not be compiled with link-time optimizations. + +target_compile_options(XrdPosixPreload PRIVATE -fno-lto) + #------------------------------------------------------------------------------- # Install #-------------------------------------------------------------------------------