unused code removal during linkage

This commit is contained in:
2023-05-19 19:44:39 +06:00
parent f4e666640e
commit ededa875d6
2 changed files with 5 additions and 3 deletions

2
cbuild

Submodule cbuild updated: e8e42424d3...991ee072b3

View File

@@ -46,7 +46,9 @@ case "$TASK" in
# -fuse-linker-plugin is required to use static libs with lto # -fuse-linker-plugin is required to use static libs with lto
# -fprofile-use enables compiler to use profiling info files to optimize executable # -fprofile-use enables compiler to use profiling info files to optimize executable
# -fprofile-prefix-path sets path where profiling info about objects are be saved # -fprofile-prefix-path sets path where profiling info about objects are be saved
C_ARGS="-O2 -flto=auto -fuse-linker-plugin -fprofile-use -fprofile-prefix-path=$(realpath $OBJDIR)/objects" # -fdata-sections -ffunction-sections -Wl,--gc-sections removes unused code
C_ARGS="-O2 -flto=auto -fuse-linker-plugin -fprofile-use -fprofile-prefix-path=$(realpath $OBJDIR)/objects \
-fdata-sections -ffunction-sections -Wl,--gc-sections"
CPP_ARGS="$C_ARGS" CPP_ARGS="$C_ARGS"
LINKER_ARGS="$CPP_ARGS" LINKER_ARGS="$CPP_ARGS"
PRE_TASK_SCRIPT= PRE_TASK_SCRIPT=
@@ -82,7 +84,7 @@ case "$TASK" in
;; ;;
# creates static library # creates static library
build_static_lib) build_static_lib)
C_ARGS="-O2 -fpic" C_ARGS="-O2 -fpic -fdata-sections -ffunction-sections"
CPP_ARGS="$C_ARGS" CPP_ARGS="$C_ARGS"
PRE_TASK_SCRIPT= PRE_TASK_SCRIPT=
TASK_SCRIPT=cbuild/default_tasks/build_static_lib.sh TASK_SCRIPT=cbuild/default_tasks/build_static_lib.sh