Commit b0db3e65 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #635 from dagar/jemalloc

jemalloc
parents b50ffe4b d627af55
......@@ -28,3 +28,6 @@
path = test/integration/pyxl
url = https://github.com/dropbox/pyxl.git
ignore = untracked
[submodule "jemalloc"]
path = jemalloc
url = git://github.com/jemalloc/jemalloc.git
......@@ -72,6 +72,26 @@ if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND NOT ENABLE_LLVM_DEBUG)
set(CMAKE_CXX_FLAGS_DEBUG "-O3" CACHE STRING "" FORCE)
endif()
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/gitmodules
COMMAND git submodule update --init
COMMAND cmake -E touch ${CMAKE_BINARY_DIR}/gitmodules
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/.gitmodules)
add_custom_target(gitsubmodules DEPENDS ${CMAKE_BINARY_DIR}/gitmodules)
# jemalloc
ExternalProject_Add(libjemalloc
PREFIX jemalloc-build
SOURCE_DIR ${CMAKE_SOURCE_DIR}/jemalloc
DEPENDS gitsubmodules
UPDATE_COMMAND autoconf
CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/jemalloc/configure --prefix=${CMAKE_BINARY_DIR}/jemalloc --enable-autogen --enable-prof-libunwind
INSTALL_COMMAND make install_bin install_lib
LOG_UPDATE ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON)
execute_process(COMMAND cat llvm_revision.txt WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE LLVMREV OUTPUT_STRIP_TRAILING_WHITESPACE)
# llvm, clang, and libunwind patches
......@@ -86,13 +106,6 @@ set(LIBUNWIND_PATCHES
${CMAKE_SOURCE_DIR}/libunwind_patches/9999-is-patched-marker.patch
)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/gitmodules
COMMAND git submodule update --init
COMMAND cmake -E touch ${CMAKE_BINARY_DIR}/gitmodules
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/.gitmodules)
add_custom_target(gitsubmodules DEPENDS ${CMAKE_BINARY_DIR}/gitmodules)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/libunwind/pyston_patched
COMMAND git submodule update libunwind
COMMAND python ${CMAKE_SOURCE_DIR}/tools/git_am_automated.py libunwind ${LIBUNWIND_PATCHES}
......@@ -213,7 +226,8 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/linkdeps_dummy.c COMMAND ${CMAKE_C
add_executable(pyston $<TARGET_OBJECTS:PYSTON_MAIN_OBJECT> $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON> linkdeps_dummy.c)
# Wrap the stdlib in --whole-archive to force all the symbols to be included and eventually exported
target_link_libraries(pyston -Wl,--whole-archive stdlib -Wl,--no-whole-archive pthread m z readline sqlite3 gmp ssl crypto unwind pypa liblz4 double-conversion ${LLVM_LIBS} ${LIBLZMA_LIBRARIES} ${OPTIONAL_LIBRARIES})
target_link_libraries(pyston -Wl,--whole-archive stdlib -Wl,--no-whole-archive pthread m z readline sqlite3 gmp ssl crypto unwind pypa liblz4 double-conversion ${LLVM_LIBS} ${LIBLZMA_LIBRARIES} ${OPTIONAL_LIBRARIES} -L${CMAKE_BINARY_DIR}/jemalloc/lib -Wl,-rpath,${CMAKE_BINARY_DIR}/jemalloc/lib jemalloc)
add_dependencies(pyston libjemalloc)
# copy src/codegen/parse_ast.py to the build directory
add_custom_command(TARGET pyston POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/src/codegen/parse_ast.py ${CMAKE_BINARY_DIR}/src/codegen/parse_ast.py)
......
Subproject commit 46c0af68bd248b04df75e4f92d5fb804c3d75340
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