From 28b6eef286b0d9b34c1202ab8236a9ffcb9e9e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 14 Feb 2024 17:20:40 +0900 Subject: [PATCH] Shrink eh_frame section in naot executables (#98355) `-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. --- src/coreclr/nativeaot/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coreclr/nativeaot/CMakeLists.txt b/src/coreclr/nativeaot/CMakeLists.txt index 65c69a5db901b..4b10cefe57387 100644 --- a/src/coreclr/nativeaot/CMakeLists.txt +++ b/src/coreclr/nativeaot/CMakeLists.txt @@ -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)