optimisation: add lto odr-type-merging and partition=none

This commit is contained in:
Danny Robson 2019-01-16 14:32:07 +11:00
parent 525f597d64
commit b4db7136eb

View File

@ -28,11 +28,17 @@ if (LTO)
append_link_flag("-fuse-linker-plugin") append_link_flag("-fuse-linker-plugin")
append_link_flag("-flto") 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. # situations where we may accidentally use regular/fat objects.
append_compile_flag("-flto") append_compile_flag("-flto")
append_compile_flag("-fno-fat-lto-objects") 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 # Throw in some optimisation flags that are LTO specific. We don't
# particularly care about checking Debug/Release here because LTO is # particularly care about checking Debug/Release here because LTO is
# pretty heavyweight anyway. # pretty heavyweight anyway.