Skip to content

Commit

Permalink
dill 2024-06-07 (74031092) (#4197)
Browse files Browse the repository at this point in the history
Code extracted from:

    https://github.com/GTkorvo/dill.git

at commit 74031092890f7abe764e4bb163cc11f32a7a5874 (master).

Upstream Shortlog
-----------------

Co-authored-by: dill Upstream <robot@adios2>
  • Loading branch information
eisenhauer and dill Upstream authored Jun 18, 2024
1 parent 354b52a commit 09ec4ab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
29 changes: 15 additions & 14 deletions thirdparty/dill/dill/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ check_type_size("void*" CMAKE_SIZEOF_VOID_P)
check_type_size("long" SIZEOF_LONG)
set(NATIVE_CG TRUE)
unset(NATIVE_ARCH)
set(DILL_NATIVE_ONLY_DEFAULT ON)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "i.86|x86_64|AMD64|amd64")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(NATIVE_ARCH x86_64)
Expand Down Expand Up @@ -148,9 +149,10 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s64fx")
set(HOST_SPARCV9 1)
set(ARCH_FILE sparc)
else()
message(STATUS "NO CG for Processor \"${CMAKE_SYSTEM_PROCESSOR}\"")
message(STATUS "DILL - NO Native CG for Processor \"${CMAKE_SYSTEM_PROCESSOR}\"")
set(NATIVE_CG FALSE)
set(NATIVE_ARCH UNSUPPORTED)
set(DILL_NATIVE_ONLY_DEFAULT OFF)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
Expand Down Expand Up @@ -186,7 +188,7 @@ set(ARM_HARD_FLOAT ${HARDFP_AVAILABLE})

option(DILL_IGNORE_NATIVE "Build to do emulation, regardless of architecture"
OFF)
option(DILL_NATIVE_ONLY "Build to native code only" ON)
option(DILL_NATIVE_ONLY "Build to native code only" ${DILL_NATIVE_ONLY_DEFAULT})
if(DILL_IGNORE_NATIVE)
set(NATIVE_CG FALSE)
set(NATIVE_ARCH UNSUPPORTED)
Expand All @@ -198,23 +200,23 @@ else()
find_package(LibFFI)
endif()
if(LIBFFI_FOUND)
message(STATUS "Enabling emulation")
message(STATUS "DILL - Enabling emulation")
set(EMULATION_POSSIBLE TRUE)
elseif((DILL_IGNORE_NATIVE OR (NATIVE_ARCH STREQUAL "UNSUPPORTED")) AND NOT DILL_NATIVE_ONLY)
find_program (AUTOCONF autoconf)
find_program (AUTOMAKE automake)
if ((AUTOCONF STREQUAL "AUTOCONF-NOTFOUND") OR (AUTOMAKE STREQUAL "AUTOMAKE-NOTFOUND"))
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# I am top-level project.
message(FATAL_ERROR "DILL_IGNORE_NATIVE set or native architecture unsupported, but autoconf or automake not found, so unable to build libffi")
message(FATAL_ERROR "DILL - DILL_IGNORE_NATIVE set or native architecture unsupported, but autoconf or automake not found, so unable to build libffi")
else()
# I am called from other project with add_subdirectory().
message(STATUS "DILL_IGNORE_NATIVE set or native architecture unsupported, but autoconf or automake not found, so unable to build libffi")
message(STATUS "DILL - DILL_IGNORE_NATIVE set or native architecture unsupported, but autoconf or automake not found, so unable to build libffi")
return()
endif()
endif()
set(LIBFFI_INTERNAL ON)
message(STATUS "Using private copy of libffi")
message(STATUS "DILL - Using private copy of libffi")
include(ExternalProject)
if(BUILD_SHARED_LIBS)
set(libffi_shared_args --enable-shared --disable-static)
Expand Down Expand Up @@ -258,10 +260,10 @@ elseif((DILL_IGNORE_NATIVE OR (NATIVE_ARCH STREQUAL "UNSUPPORTED")) AND NOT DILL
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" COMPONENT ${DILL_HEADER_COMPONENT})
endif()

message(STATUS "Enabling emulation")
message(STATUS "DILL - Enabling emulation")
set(EMULATION_POSSIBLE TRUE)
else()
message(STATUS "Disabling emulation")
message(STATUS "DILL - Disabling emulation")
set(EMULATION_POSSIBLE FALSE)
endif()

Expand Down Expand Up @@ -294,7 +296,7 @@ message (STATUS "base.ops argument is ${BASE_OPS_ARG}")
option(DILL_MULTI_TARGET "Build all available target architectures" OFF)

if(DILL_MULTI_TARGET)
message(STATUS "arch files is ${arch_files}")
message(STATUS "DILL - arch files is ${arch_files}")
list(APPEND SRC_list ${arch_files})
elseif(NOT ${NATIVE_ARCH} STREQUAL "UNSUPPORTED")
list(APPEND SRC_list dill_${ARCH_FILE}.c ${ARCH_FILE}.c ${ARCH_FILE}_rt.c)
Expand All @@ -312,7 +314,7 @@ if(DILL_MULTI_TARGET OR NATIVE_CG OR EMULATION_POSSIBLE)
endif()
if(NOT DILL_MULTI_TARGET AND NOT NATIVE_CG)
message(STATUS
"Configure has detected no native dynamic code generation support
"DILL - Configure has detected no native dynamic code generation support
for this architecture (\"${NATIVE_ARCH}\"). However, the libffi
library was found, so a library configured for emulation will be built."
)
Expand All @@ -323,15 +325,14 @@ else()
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# I am top-level project.
message(FATAL_ERROR
"Configure has detected no native dynamic code generation support
"DILL - Configure has detected no native dynamic code generation support
for this architecture (\"${NATIVE_ARCH}\"), -DDILL_MULTI_TARGET=ON
was not specified, and no emulation is possible (libffi library
not found) NO LIBRARY WILL BE BUILT" )
else()
message(STATUS
"No native dynamic code generation support for this architecture
(\"${CMAKE_SYSTEM_PROCESSOR}\"), -DDILL_MULTI_TARGET=ON was not specified, and no emulation
is possible (libffi library not found) NO DILL LIBRARY WILL BE BUILT, but this is not a failure")
"DILL - No native dynamic code generation support for this architecture and no emulation
is possible (libffi library not found or failed to build) NO DILL LIBRARY WILL BE BUILT, but this is not a failure")
return()
endif()
endif()
Expand Down
4 changes: 1 addition & 3 deletions thirdparty/dill/dill/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ emu_func(ffi_cif* cif, void* vret, void* args[], void* client_data)
}
}

extern void* emulate_clone_code(c, new_base, available_size) dill_stream c;
void* new_base;
int available_size;
extern void* emulate_clone_code(dill_stream c, void* new_base, int available_size)
{
return c->p->fp;
}
Expand Down

0 comments on commit 09ec4ab

Please sign in to comment.