diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -54,6 +54,10 @@ CMAKE_TOOLCHAIN_FILE[arm-linux-gnueabihf]=LinuxARM.cmake CMAKE_TOOLCHAIN_FILE[aarch64-linux-gnu]=LinuxAArch64.cmake + # Allow extra cmake option to be specified for each host + declare -A CMAKE_EXTRA_OPTIONS + CMAKE_EXTRA_OPTIONS[arm-linux-gnueabihf]="-DUSE_LD_GOLD=OFF" + INSTALL_COMPONENTS="bitcoind bitcoin-qt bitcoin-seeder" FAKETIME_HOST_PROGS="" @@ -163,7 +167,8 @@ -DENABLE_STATIC_LIBSTDCXX=ON \ -DENABLE_GLIBC_BACK_COMPAT=ON \ -DCMAKE_INSTALL_PREFIX=${INSTALLPATH} \ - -DCCACHE=OFF + -DCCACHE=OFF \ + ${CMAKE_EXTRA_OPTIONS[${i}]} ninja ninja security-check diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,6 +27,7 @@ option(START_WITH_UPNP "Make UPnP the default to map ports" OFF) option(ENABLE_CLANG_TIDY "Enable clang-tidy checks for Bitcoin ABC" OFF) option(ENABLE_PROFILING "Select the profiling tool to use" OFF) +option(USE_LD_GOLD "Try to use gold as a linker if available" ON) # If ccache is available, then use it. find_program(CCACHE ccache) @@ -59,6 +60,10 @@ include(AddCompilerFlags) +if(USE_LD_GOLD) + add_linker_flags(-fuse-ld=gold) +endif() + # Prefer -g3, defaults to -g if unavailable foreach(LANGUAGE C CXX) set(COMPILER_DEBUG_LEVEL -g)