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

Abinav Puthan Purayil via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 00:26:46 PDT 2022


abinavpp added a comment.

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.


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