OpenMP is missing offload parts (e.g. libomptarget.so) since upgrade to LLVM 19

Description:

Upstream LLVM moved the offload architecture of OpenMP, and therefore its libomptarget.so into a separate LLVM project starting with LLVM 19.1.0. This change was done, as there's the intention to re-use parts of this offloading framework for other paradigms, e.g. SYCL or OpenACC. With the current build recipe, this means that OpenMP target offloading is not available anymore, even though optional dependencies for CUDA and HSA-ROCr exist.

For more information, see upstream PR #75125, and the corresponding issue #75124

Comparing the package files, all *.bc files, and files related to OpenMP target offloading are missing (libomptarget.rtl.[...].so, libomptarget.devicertl.a, libomptarget.so).

Trying to use OpenMP target offloading with a simple example causes an error to appear:

/usr/bin/clang-linker-wrapper: error: unable to find library -lomptarget
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Additional info:

  • package version(s): 19.1.7
  • config and/or log files: -/-
  • link to upstream bug report, if any: packaging issue, therefore no upstream bug report

Steps to reproduce:

Short version:

$ cat test.c
int main( void )
{
    #pragma omp target
    {}
    return 0;
}
$ clang -fopenmp --offload-arch=native test.c
/usr/bin/clang-linker-wrapper: error: unable to find library -lomptarget
clang: error: linker command failed with exit code 1 (use -v to see invocation)

From a basic Arch Linux Docker container:

$ pacman -Syyuu
$ pacman -S clang llvm openmp
$ echo "int main( void ){ return 0; }" > reproducer.c
$ # Trying a NVIDIA arch, e.g. sm_80 will result in devicelib not found, as CUDA is missing.
$ # Passing -nogpulib results in pxtas not being found. Therefore, choose an AMD arch instead.
$ clang -fopenmp --offload-arch=gfx1101 -nogpulib reproducer.c
/usr/bin/clang-linker-wrapper: error: unable to find library -lomptarget
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Edited by Jan André Reuter1