From 0ac4130b7d9e002aecaba7a813aca2b3cfe764bb Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 1 Oct 2022 23:35:27 +0200 Subject: [PATCH] cmake: Correctly split/gc sections while linking Repeat the flags while linking for LTO --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff7667fa5..f49377df7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -267,7 +267,7 @@ if(CMAKE_CROSSCOMPILING) # split and gc sections add_compile_options(-ffunction-sections -fdata-sections) - add_link_options(-Wl,--gc-sections) + add_link_options(-ffunction-sections -fdata-sections -Wl,--gc-sections) # LTO (with custom options) add_compile_options(-flto -fno-fat-lto-objects)