Bug#996956: libbenchmark-dev: libbenchmark_main.a has no actual object code

Timo Röhling roehling at debian.org
Thu Oct 21 11:48:35 BST 2021


On Thu, 21 Oct 2021 12:37:55 +0200 Timo =?utf-8?Q?R=C3=B6hling?= <roehling at 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 │
⠈⠳⣄⠀⠀⠀⠀   ╰────────────────────────────────────────────────────╯
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20211021/91d9497e/attachment.sig>


More information about the debian-science-maintainers mailing list