소스 검색

cmake: Correctly split/gc sections while linking

Repeat the flags while linking for LTO
Yuri D'Elia 1 년 전
부모
커밋
0ac4130b7d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      CMakeLists.txt

+ 1 - 1
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)