[PATCH] D128544: [Orc][JITLink] Add a shared memory based implementation of MemoryMapper

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 04:55:34 PDT 2022


thakis added a comment.

In D128544#3650873 <https://reviews.llvm.org/D128544#3650873>, @abinavpp wrote:

> In D128544#3650815 <https://reviews.llvm.org/D128544#3650815>, @argentite wrote:
>
>> Hi! I am not very familiar with powerpc but it seems like POSIX shared memory APIs should be available.
>> From this page <https://docs.oracle.com/cd/E86824_01/html/E54772/librt-3lib.html> I suspect `shm_` family of functions could be in `librt` instead of `libc`.
>
> I don't think this is specific to PPC, shm_* APIs are in librt right? I can see "Link with -lrt." in the synopsis of https://man7.org/linux/man-pages/man3/shm_open.3.html. So I guess doing something like:
>
>   diff --git a/llvm/lib/ExecutionEngine/CMakeLists.txt b/llvm/lib/ExecutionEngine/CMakeLists.txt
>   index a5607872c706..cdb7b3e622c3 100644
>   --- a/llvm/lib/ExecutionEngine/CMakeLists.txt
>   +++ b/llvm/lib/ExecutionEngine/CMakeLists.txt
>   @@ -24,7 +24,7 @@ add_llvm_component_library(LLVMExecutionEngine
>      )
>    
>    if(BUILD_SHARED_LIBS)
>   -  target_link_libraries(LLVMExecutionEngine PUBLIC LLVMRuntimeDyld)
>   +  target_link_libraries(LLVMExecutionEngine PUBLIC LLVMRuntimeDyld rt)
>    endif()
>    
>    add_subdirectory(Interpreter)
>   diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
>   index 415876abd65f..9a2709a4d6af 100644
>   --- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
>   +++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
>   @@ -12,7 +12,7 @@ add_llvm_component_library(LLVMOrcTargetProcess
>      ${LLVM_MAIN_INCLUDE_DIR}/llvm/ExecutionEngine/Orc
>    
>      LINK_LIBS
>   -  ${LLVM_PTHREAD_LIB}
>   +  ${LLVM_PTHREAD_LIB} rt
>    
>      LINK_COMPONENTS
>      OrcShared
>
> should get the shared-lib build fixed in Linux, but I'm not sure about other platforms.

This looks right to me, but it shouldn't be done on windows and apple platforms i think. (Not sure about the bsds.)

Maybe look for what we do for HAVE_LIBRT in llvm/cmake/config-ix.cmake and set a var like LLVM_RT_LIB there and use that here (similar to LLVM_PTHREAD_LIB).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128544/new/

https://reviews.llvm.org/D128544



More information about the llvm-commits mailing list