Skip to content

Commit

Permalink
Shrink eh_frame section in naot executables (#98355)
Browse files Browse the repository at this point in the history
`-fno-exceptions` is not enough to stop generating `.eh_frames`. We need to also pass `-fno-asynchronous-unwind-tables`.

Saves 50 kB on an app using WKS gc. Possibly more on SRV GC since that has two copies of the GC.

Note that we still get unwinding information for the debugger because `-g` is going to force generation of `.debug_frame` instead. But `.debug_frame` goes to the symbols file.
  • Loading branch information
MichalStrehovsky authored Feb 14, 2024
1 parent ad25468 commit 28b6eef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/coreclr/nativeaot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ endif (MSVC)

if(CLR_CMAKE_HOST_UNIX)
add_compile_options(-fno-exceptions) # Native AOT runtime doesn't use C++ exception handling
add_compile_options(-fno-asynchronous-unwind-tables)
add_compile_options(-nostdlib)

if(CLR_CMAKE_TARGET_APPLE)
Expand Down

0 comments on commit 28b6eef

Please sign in to comment.