Skip to content

Commit

Permalink
Add support for mixed references mode in CMake builds
Browse files Browse the repository at this point in the history
In mixed references static mode, split the omr gc library into omrgc
and omrgc_full so that the appropriate library can be used.

Only set OMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES in mixed references
static mode.

Signed-off-by: Sharon Wang <sharon-wang-cpsc@outlook.com>
  • Loading branch information
sharon-wang committed Nov 19, 2020
1 parent 61a4993 commit 8cbff4b
Show file tree
Hide file tree
Showing 5 changed files with 285 additions and 84 deletions.
9 changes: 9 additions & 0 deletions cmake/config.cmake
Expand Up @@ -105,6 +105,7 @@ set(OMR_TOOLS_USE_NATIVE_ENCODING ON CACHE BOOL
###

set(OMR_GC_LIB "omrgc" CACHE STRING "Name of the GC library to use")
set(OMR_GC_FULL_LIB "omrgc_full" CACHE STRING "Name of the Full References GC library to use for Mixed References Mode")
set(OMR_HOOK_LIB "j9hookstatic" CACHE STRING "Name of the hook library to link against")
set(OMR_PORT_LIB "omrport" CACHE STRING "Name of the port library to link against")
set(OMR_THREAD_LIB "j9thrstatic" CACHE STRING "Name of the thread library to link against")
Expand All @@ -115,6 +116,7 @@ set(OMR_TRACE_LIB "omrtrace" CACHE STRING "Name of the trace library to link aga
###

set(OMR_GC_GLUE_TARGET "NOTFOUND" CACHE STRING "The gc glue target, must be interface library")
set(OMR_GC_GLUE_FULL_TARGET "NOTFOUND" CACHE STRING "The gc glue full target, must be interface library")
set(OMR_UTIL_GLUE_TARGET "NOTFOUND" CACHE STRING "The util glue target, must be interface library")
set(OMR_RAS_GLUE_TARGET "NOTFOUND" CACHE STRING "The ras glue target, must be interface library")
set(OMR_CORE_GLUE_TARGET "NOTFOUND" CACHE STRING "The core glue target, must be and interface library")
Expand Down Expand Up @@ -161,14 +163,21 @@ set_property(CACHE OMR_GC_POINTER_MODE PROPERTY STRINGS "full" "compressed" "mix
if(OMR_GC_POINTER_MODE STREQUAL "full")
set(OMR_GC_COMPRESSED_POINTERS OFF CACHE INTERNAL "")
set(OMR_GC_FULL_POINTERS ON CACHE INTERNAL "")
set(OMR_MIXED_REFERENCES_MODE_STATIC OFF CACHE INTERNAL "")
elseif(OMR_GC_POINTER_MODE STREQUAL "compressed")
omr_assert(FATAL_ERROR TEST NOT OMR_ENV_DATA32 MESSAGE "OMR_GC_POINTER_MODE must be \"full\" on 32 bit platforms")
set(OMR_GC_COMPRESSED_POINTERS ON CACHE INTERNAL "")
set(OMR_GC_FULL_POINTERS OFF CACHE INTERNAL "")
set(OMR_MIXED_REFERENCES_MODE_STATIC OFF CACHE INTERNAL "")
elseif(OMR_GC_POINTER_MODE STREQUAL "mixed")
omr_assert(FATAL_ERROR TEST NOT OMR_ENV_DATA32 MESSAGE "OMR_GC_POINTER_MODE must be \"full\" on 32 bit platforms")
set(OMR_GC_COMPRESSED_POINTERS ON CACHE INTERNAL "")
set(OMR_GC_FULL_POINTERS ON CACHE INTERNAL "")
if(OMR_MIXED_REFERENCES_MODE STREQUAL "static")
set(OMR_MIXED_REFERENCES_MODE_STATIC ON CACHE INTERNAL "")
else()
set(OMR_MIXED_REFERENCES_MODE_STATIC OFF CACHE INTERNAL "")
endif()
else()
message(FATAL_ERROR "OMR_GC_FULL_POINTERS must be set to one of \"full\", \"compressed\", or \"mixed\"")
endif()
Expand Down

0 comments on commit 8cbff4b

Please sign in to comment.