From c5c0fa4e707c9861b33c6ebb3257e379aa4a1bb4 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Mon, 7 Oct 2024 13:44:46 +0300 Subject: [PATCH] CMakeLists.txt: strip by default on release, use -Bsymbolic-functions and --hash-style=gnu for optimized symbol resoltuion --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19d00a2..1bb6c19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,7 +159,8 @@ function(give_options_without_warnings target) -fdata-sections -ffunction-sections -funroll-loops - -fomit-frame-pointer) + -fomit-frame-pointer + -s) set(BUILD_FLAGS_DEBUG -O0 @@ -180,7 +181,9 @@ function(give_options_without_warnings target) # -Wl,--no-undefined # TODO: use later for implementing no-libc $<$:${BUILD_FLAGS_RELEASE}> $<$:${BUILD_FLAGS_DEBUG}> - $<$:-Wl,-rpath,$ORIGIN/>) + $<$:-Wl,-rpath,$ORIGIN/> + -Bsymbolic-functions + -Wl,--hash-style=gnu) target_compile_definitions(${target} PUBLIC ORGANIZATION_NAME="${ORGANIZATION_NAME}"