Skip to content

Commit 4d61d78

Browse files
author
Github Executorch
committed
Update
[ghstack-poisoned]
1 parent d863233 commit 4d61d78

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,16 @@ endif()
206206
if(EXECUTORCH_OPTIMIZE_SIZE)
207207
# -Os: Optimize for size.
208208
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
209+
if(NOT WIN32 AND NOT MSVC)
210+
# Suppress .eh_frame generation to reduce binary size. Safe because
211+
# ExecuTorch builds with -fno-exceptions.
212+
set(CMAKE_CXX_FLAGS_RELEASE
213+
"${CMAKE_CXX_FLAGS_RELEASE} -fno-asynchronous-unwind-tables -fno-unwind-tables"
214+
)
215+
set(CMAKE_C_FLAGS_RELEASE
216+
"${CMAKE_C_FLAGS_RELEASE} -fno-asynchronous-unwind-tables -fno-unwind-tables"
217+
)
218+
endif()
209219
else()
210220
# -O2: Moderate opt.
211221
set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")

0 commit comments

Comments
 (0)