提交 966f8f8d 编写于 作者: D dimstars 提交者: ob-robot

add ENABLE_HOTFUNC to control HOTFUNC_OPT

上级 16d0c2d3
......@@ -146,7 +146,7 @@ function do_clean
function build_package
{
STATIC_LINK_LGPL_DEPS_OPTION=OFF
do_build "$@" -DOB_BUILD_PACKAGE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOB_USE_LLD=$LLD_OPTION -DENABLE_FATAL_ERROR_HANG=OFF -DENABLE_AUTO_FDO=ON -DENABLE_THIN_LTO=ON -DOB_STATIC_LINK_LGPL_DEPS=$STATIC_LINK_LGPL_DEPS_OPTION
do_build "$@" -DOB_BUILD_PACKAGE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOB_USE_LLD=$LLD_OPTION -DENABLE_FATAL_ERROR_HANG=OFF -DENABLE_AUTO_FDO=ON -DENABLE_THIN_LTO=ON -DENABLE_HOTFUNC=ON -DOB_STATIC_LINK_LGPL_DEPS=$STATIC_LINK_LGPL_DEPS_OPTION
}
# build - configurate project and prepare to compile, by calling make
......@@ -184,7 +184,7 @@ function build
ln -sf ${TOPDIR}/build_clangd/compile_commands.json ${TOPDIR}/compile_commands.json
;;
xperf)
do_build "$@" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_AUTO_FDO=ON -DENABLE_THIN_LTO=ON -DOB_USE_LLD=$LLD_OPTION
do_build "$@" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_AUTO_FDO=ON -DENABLE_THIN_LTO=ON -DOB_USE_LLD=$LLD_OPTION -DENABLE_HOTFUNC=ON
;;
xdebug_asan)
do_build "$@" -DCMAKE_BUILD_TYPE=Debug -DOB_USE_LLD=$LLD_OPTION -DOB_USE_ASAN=$ASAN_OPTION
......
......@@ -68,6 +68,11 @@ if(ENABLE_THIN_LTO)
set(THIN_LTO_CONCURRENCY_LINK "-Wl,--thinlto-jobs=${LTO_JOBS}")
endif()
set(HOTFUNC_OPT "")
if(ENABLE_HOTFUNC)
set(HOTFUNC_OPT "-Wl,--no-warn-symbol-ordering,--symbol-ordering-file,${HOTFUNC_PATH}")
endif()
set(ob_close_modules_static_name "")
set(ob_close_deps_static_name "")
......@@ -201,7 +206,7 @@ if (OB_USE_CLANG)
if (OB_USE_LLD)
set(LD_OPT "-fuse-ld=${DEVTOOLS_DIR}/bin/ld.lld")
set(REORDER_COMP_OPT "-ffunction-sections -fdebug-info-for-profiling")
set(REORDER_LINK_OPT "-Wl,--no-rosegment,--build-id=sha1,--no-warn-symbol-ordering,--symbol-ordering-file,${HOTFUNC_PATH}")
set(REORDER_LINK_OPT "-Wl,--no-rosegment,--build-id=sha1 ${HOTFUNC_OPT}")
set(OB_LD_BIN "${DEVTOOLS_DIR}/bin/ld.lld")
endif()
set(CMAKE_CXX_FLAGS "--gcc-toolchain=${GCC9} ${DEBUG_PREFIX} ${AUTO_FDO_OPT} ${THIN_LTO_OPT} -fcolor-diagnostics ${REORDER_COMP_OPT} -fmax-type-align=8 ${CMAKE_ASAN_FLAG} -std=gnu++11")
......@@ -233,7 +238,7 @@ else()
if (OB_USE_LLD)
set(LD_OPT "-B${CMAKE_SOURCE_DIR}/rpm/.compile")
set(REORDER_COMP_OPT "-ffunction-sections")
set(REORDER_LINK_OPT "-Wl,--no-warn-symbol-ordering,--symbol-ordering-file,${HOTFUNC_PATH}")
set(REORDER_LINK_OPT "${HOTFUNC_OPT}")
endif()
set(CMAKE_CXX_FLAGS "${LD_OPT} -fdiagnostics-color ${REORDER_COMP_OPT}")
set(CMAKE_C_FLAGS "${LD_OPT} -fdiagnostics-color ${REORDER_COMP_OPT}")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册