From b4db7136eb99c00c63cda9226cd26c5f025e995f Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 16 Jan 2019 14:32:07 +1100 Subject: [PATCH] optimisation: add lto odr-type-merging and partition=none --- nc_optimisation.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nc_optimisation.cmake b/nc_optimisation.cmake index 28de5d8..27125c1 100644 --- a/nc_optimisation.cmake +++ b/nc_optimisation.cmake @@ -28,11 +28,17 @@ if (LTO) append_link_flag("-fuse-linker-plugin") append_link_flag("-flto") - # Actually enable LTO object creation, but try very hard to avoid + # Enable LTO on the compilation side, but try very hard to avoid # situations where we may accidentally use regular/fat objects. append_compile_flag("-flto") append_compile_flag("-fno-fat-lto-objects") + # Try to squeeze out some more diagnostics via LTO + append_compile_flag("-flto-odr-type-merging") + + # GCC: Attempt to use a more aggressive whole-program style of LTO + append_compile_flag("-flto-partition=none") + # Throw in some optimisation flags that are LTO specific. We don't # particularly care about checking Debug/Release here because LTO is # pretty heavyweight anyway.