On Thu, 21 Oct 2021 12:37:55 +0200 Timo =?utf-8?Q?R=C3=B6hling?= 
<roehl...@debian.org> wrote:
-    add_cxx_compiler_flag(-flto)
+    add_cxx_compiler_flag(-ffat-lto-objects)

I just saw https://salsa.debian.org/science-team/benchmark/-/merge_requests/2
Reading the documentation again, I think *both* options are
required:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6b2b81..bc06d52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -215,7 +215,7 @@ else()
# Link time optimisation
   if (BENCHMARK_ENABLE_LTO)
-    add_cxx_compiler_flag(-flto)
+    add_cxx_compiler_flag(-flto -ffat-lto-objects)
     add_cxx_compiler_flag(-Wno-lto-type-mismatch)
     if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
       find_program(GCC_AR gcc-ar)


I can confirm that this still fixes the linker issue for non-LTO
builds.

Cheers
Timo

--
⢀⣴⠾⠻⢶⣦⠀   ╭────────────────────────────────────────────────────╮
⣾⠁⢠⠒⠀⣿⡁   │ Timo Röhling                                       │
⢿⡄⠘⠷⠚⠋⠀   │ 9B03 EBB9 8300 DF97 C2B1  23BF CC8C 6BDD 1403 F4CA │
⠈⠳⣄⠀⠀⠀⠀   ╰────────────────────────────────────────────────────╯

Attachment: signature.asc
Description: PGP signature

Reply via email to