add ENABLE_HOTFUNC to control HOTFUNC_OPT
This commit is contained in:
4
build.sh
4
build.sh
@ -146,7 +146,7 @@ function do_clean
|
|||||||
function build_package
|
function build_package
|
||||||
{
|
{
|
||||||
STATIC_LINK_LGPL_DEPS_OPTION=OFF
|
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
|
# 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
|
ln -sf ${TOPDIR}/build_clangd/compile_commands.json ${TOPDIR}/compile_commands.json
|
||||||
;;
|
;;
|
||||||
xperf)
|
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)
|
xdebug_asan)
|
||||||
do_build "$@" -DCMAKE_BUILD_TYPE=Debug -DOB_USE_LLD=$LLD_OPTION -DOB_USE_ASAN=$ASAN_OPTION
|
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}")
|
set(THIN_LTO_CONCURRENCY_LINK "-Wl,--thinlto-jobs=${LTO_JOBS}")
|
||||||
endif()
|
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_modules_static_name "")
|
||||||
set(ob_close_deps_static_name "")
|
set(ob_close_deps_static_name "")
|
||||||
|
|
||||||
@ -201,7 +206,7 @@ if (OB_USE_CLANG)
|
|||||||
if (OB_USE_LLD)
|
if (OB_USE_LLD)
|
||||||
set(LD_OPT "-fuse-ld=${DEVTOOLS_DIR}/bin/ld.lld")
|
set(LD_OPT "-fuse-ld=${DEVTOOLS_DIR}/bin/ld.lld")
|
||||||
set(REORDER_COMP_OPT "-ffunction-sections -fdebug-info-for-profiling")
|
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")
|
set(OB_LD_BIN "${DEVTOOLS_DIR}/bin/ld.lld")
|
||||||
endif()
|
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")
|
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)
|
if (OB_USE_LLD)
|
||||||
set(LD_OPT "-B${CMAKE_SOURCE_DIR}/rpm/.compile")
|
set(LD_OPT "-B${CMAKE_SOURCE_DIR}/rpm/.compile")
|
||||||
set(REORDER_COMP_OPT "-ffunction-sections")
|
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()
|
endif()
|
||||||
set(CMAKE_CXX_FLAGS "${LD_OPT} -fdiagnostics-color ${REORDER_COMP_OPT}")
|
set(CMAKE_CXX_FLAGS "${LD_OPT} -fdiagnostics-color ${REORDER_COMP_OPT}")
|
||||||
set(CMAKE_C_FLAGS "${LD_OPT} -fdiagnostics-color ${REORDER_COMP_OPT}")
|
set(CMAKE_C_FLAGS "${LD_OPT} -fdiagnostics-color ${REORDER_COMP_OPT}")
|
||||||
|
|||||||
Reference in New Issue
Block a user