Commit 3c1f8024 authored by Daniel Agar's avatar Daniel Agar

fixes #238 cmake automatically use ld.gold for linking

src/runtime/inline/* and pass -Btools/build_system for using gold
otherwise
parent 2718c3d3
......@@ -17,6 +17,7 @@ endif()
option(ENABLE_CCACHE "enable caching compiler output" ON)
option(ENABLE_GIL "threading use GIL" ON)
option(ENABLE_GOLD "enable the gold linker" ON)
option(ENABLE_GRWL "threading use GRWL" OFF)
option(ENABLE_INTEL_JIT_EVENTS "LLVM support for Intel JIT Events API" OFF)
option(ENABLE_LLVM_DEBUG "LLVM debug symbols" OFF)
......@@ -32,6 +33,16 @@ if(ENABLE_CCACHE)
endif()
endif()
# automatically use the gold linker if found
if(ENABLE_GOLD)
find_program(GOLD_LINKER ld.gold)
if(GOLD_LINKER)
message(STATUS "found the gold linker ${GOLD_LINKER}")
set(CMAKE_LINKER "${GOLD_LINKER}")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -B${CMAKE_SOURCE_DIR}/tools/build_system")
endif()
endif()
# initial clang flags (set here so they're used when building llvm)
set(CLANG_FLAGS "-Qunused-arguments -fcolor-diagnostics" CACHE STRING "Clang specific C and CXX flags")
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment