We should check if -flto-partition=none is defined when the compiler
does not support symver attribute and fail the build if it is not.
Fixes: https://tracker.ceph.com/issues/40060
Co-authored-by: Kefu Chai <tchaikov@gmail.com>
Signed-off-by: Boris Ranto <branto@redhat.com>
int main() {}"
HAVE_ATTR_SYMVER)
+ if(NOT HAVE_ATTR_SYMVER)
+ if(CMAKE_CXX_FLAGS MATCHES "-flto" AND NOT CMAKE_CXX_FLAGS MATCHES "-flto-partition=none")
+ # https://tracker.ceph.com/issues/40060
+ message(FATAL_ERROR "please pass -flto-partition=none as part of CXXFLAGS")
+ endif()
+ endif()
set(CMAKE_REQUIRED_FLAGS -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/version_script.txt)
check_c_source_compiles("
void func_v1() {}