Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BoehmGC to 8.2 #307

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ add_executable(nekovm
if (STATIC_BOEHMGC OR WIN32)
ExternalProject_Add(libatomic_ops
${EP_CONFIGS}
URL https://github.com/ivmai/libatomic_ops/releases/download/v7.6.14/libatomic_ops-7.6.14.tar.gz
URL_MD5 ee8251f5091b7938d18be4dda843a515
URL https://github.com/ivmai/libatomic_ops/releases/download/v7.8.2/libatomic_ops-7.8.2.tar.gz
URL_HASH SHA256=d305207fe207f2b3fb5cb4c019da12b44ce3fcbc593dfd5080d867b1a2419b51
CONFIGURE_COMMAND echo skip config
BUILD_COMMAND echo skip build
INSTALL_COMMAND echo skip install
Expand All @@ -276,23 +276,23 @@ if (STATIC_BOEHMGC OR WIN32)
set (
BoehmGC_CONFIGS
DEPENDS libatomic_ops
URL https://github.com/ivmai/bdwgc/releases/download/v7.6.16/gc-7.6.16.tar.gz
URL_MD5 74fb76b6bccf0874cec65b794535a7dd
URL https://github.com/ivmai/bdwgc/releases/download/v8.2.8/gc-8.2.8.tar.gz
URL_HASH SHA256=7649020621cb26325e1fb5c8742590d92fb48ce5c259b502faf7d9fb5dabb160
)

set(GC_INCLUDE_DIR ${CMAKE_BINARY_DIR}/libs/src/BoehmGC-build/include)

if (WIN32)
set(GC_LIBRARIES
${CMAKE_BINARY_DIR}/libs/src/BoehmGC-build/${CMAKE_CFG_INTDIR}/gcmt-dll.lib
${CMAKE_BINARY_DIR}/libs/src/BoehmGC-build/${CMAKE_CFG_INTDIR}/gc.lib
)
ExternalProject_Add(BoehmGC
${EP_CONFIGS}
${BoehmGC_CONFIGS}
CMAKE_ARGS
-Wno-dev
-Denable_threads=ON
-Denable_parallel_mark=OFF
-Denable_thread_local_alloc=OFF
-DCMAKE_USE_WIN32_THREADS_INIT=ON
-DCMAKE_CXX_STANDARD=14
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/libs/src/libatomic_ops ${CMAKE_BINARY_DIR}/libs/src/BoehmGC/libatomic_ops
Expand All @@ -301,14 +301,14 @@ if (STATIC_BOEHMGC OR WIN32)
${CMAKE_BINARY_DIR}/libs/src/BoehmGC/include
${CMAKE_BINARY_DIR}/libs/src/BoehmGC-build/include/gc
)
add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gcmt-dll.dll
add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gc.dll
DEPENDS BoehmGC
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/libs/src/BoehmGC-build/${CMAKE_CFG_INTDIR}/gcmt-dll.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/libs/src/BoehmGC-build/${CMAKE_CFG_INTDIR}/gc.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
)
add_custom_target(gcmt-dll.dll ALL
DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gcmt-dll.dll
add_custom_target(gc.dll ALL
DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gc.dll
)
add_dependencies(nekovm gcmt-dll.dll)
add_dependencies(nekovm gc.dll)
else()
if (APPLE)
set(GC_CFLAGS "-w -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
Expand Down Expand Up @@ -573,7 +573,7 @@ if (WIN32)
include(InstallRequiredSystemLibraries)
install (
FILES
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gcmt-dll.dll
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gc.dll
DESTINATION .
)
else()
Expand Down
3 changes: 3 additions & 0 deletions vm/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ static void null_warn_proc( char *msg, int arg ) {
}

void neko_gc_init() {
#ifdef NEKO_JIT_ENABLE
GC_set_pages_executable(1);
#endif
# ifndef NEKO_WINDOWS
// we can't set this on windows with old GC since
// it's already initialized through its own DllMain
Expand Down