[all-commits] [llvm/llvm-project] c7c68f: [Libomptarget] Allow the CPU targets to be built w...

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Jan 9 12:02:05 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c7c68f1764ddd38d940946007c634b4bacb902b2
      https://github.com/llvm/llvm-project/commit/c7c68f1764ddd38d940946007c634b4bacb902b2
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
    M openmp/libomptarget/plugins-nextgen/CMakeLists.txt
    A openmp/libomptarget/plugins-nextgen/generic-elf-64bit/dynamic_ffi/ffi.cpp
    A openmp/libomptarget/plugins-nextgen/generic-elf-64bit/dynamic_ffi/ffi.h
    M openmp/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp

  Log Message:
  -----------
  [Libomptarget] Allow the CPU targets to be built without libffi (#77495)

Summary:
The CPU targets currently rely on `libffi` to invoke the "kernel"
functions. Previously we would not build these if this dependency was
not found. This patch copies th eapproach used for things like CUDA and
HSA to dynamically load this if it is not found.

The one sketchy thing this does is hard-code the default ABI for the
target. These are normally defined on a per-file basis in the FFI
source, so I had to fish out the expected values. We only use two types,
so ideally we will always be able to use the default ABI.

It's possible we could remove this dependency entirely in the future as
well.




More information about the All-commits mailing list