Bug#1087280: llvm-toolchain-19: Please re-enable OpenMP (without offloading) on riscv64 (and mips64el and loong64)

Aurelien Jarno aurel32 at debian.org
Sun Nov 10 16:30:03 GMT 2024


Source: llvm-toolchain-19
Version: 1:19.1.3-1
Severity: important
Tags: patch
X-Debbugs-Cc: debian-riscv at lists.debian.org, debian-mips at lists.debian.org, debian-loongarch at lists.debian.org
User: debian-riscv at lists.debian.org
Usertags: riscv64

Dear maintainer,

Upstream LLVM has two levels of support for OpenMP, either with or
without offloading. The debian package currently enables offloading
unconditionally on all architectures supporting OpenMP.

Up to upstream version 18, it was possible to build the offloading
support even without host offloading support, but following the upstream
move of the libomptarget code to the offload subproject this is not
possible anymore, causing an FTBFS on architectures not supporting
offloading. As a consequence OpenMP has been purely disabled on
loong64, mips64el and riscv64. This causes some packages to FTBFS on
those architectures.

I believe the right way to do that is to re-enable OpenMP, while keeping
offloading disabled on those architectures. This is what the patch below
does. I have tested it successfully on riscv64, but not on mips64el nor
loong64.

Regards
Aurelien


--- llvm-toolchain-19-19.1.3/debian/control
+++ llvm-toolchain-19-19.1.3/debian/control
@@ -623,7 +623,7 @@
 
 Package: libomp-19-dev
 Section: libdevel
-Architecture: amd64 arm64 armhf ppc64 ppc64el hurd-amd64
+Architecture: amd64 arm64 armhf ppc64 ppc64el hurd-amd64 loong64 mips64el riscv64
 Depends: libomp5-19 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
 Suggests: libomp-19-doc
 Breaks: libiomp-dev (<< 3.7-1)
@@ -637,7 +637,7 @@
 
 Package: libomp5-19
 Multi-Arch: same
-Architecture: amd64 arm64 armhf ppc64 ppc64el hurd-amd64
+Architecture: amd64 arm64 armhf ppc64 ppc64el hurd-amd64 loong64 mips64el riscv64
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Provides: ${t64:Provides}, libomp-x.y
 Conflicts: libomp-x.y
diff -Nru llvm-toolchain-19-19.1.3/debian/libomp5-X.Y.install.in llvm-toolchain-19-19.1.3/debian/libomp5-X.Y.install.in
--- llvm-toolchain-19-19.1.3/debian/libomp5-X.Y.install.in	2024-10-15 15:10:06.000000000 +0200
+++ llvm-toolchain-19-19.1.3/debian/libomp5-X.Y.install.in	2024-11-09 18:02:58.000000000 +0100
@@ -1,5 +1,5 @@
 #!/usr/bin/dh-exec
 
 usr/lib/llvm- at LLVM_VERSION@/lib/libomp*.so.5
-[amd64 hurd-amd64 arm64 mips64el ppc64el ppc64 riscv64 loong64] usr/lib/llvm- at LLVM_VERSION@/lib/libomptarget*.so. at LLVM_VERSION@. at LLVM_VERSION_MINOR@
+[amd64 hurd-amd64 arm64 ppc64el ppc64] usr/lib/llvm- at LLVM_VERSION@/lib/libomptarget*.so. at LLVM_VERSION@. at LLVM_VERSION_MINOR@
 
--- llvm-toolchain-19-19.1.3/debian/libomp-X.Y-dev.install.in
+++ llvm-toolchain-19-19.1.3/debian/libomp-X.Y-dev.install.in
@@ -7,16 +7,16 @@
 [!armhf !mips64el] /usr/lib/llvm- at LLVM_VERSION@/lib/libarcher_static.a
 [!armhf !mips64el] /usr/lib/llvm- at LLVM_VERSION@/lib/libarcher.so
 
-[amd64 hurd-amd64 ppc64el arm64 loong64 mips64el ppc64 riscv64] /usr/lib/llvm- at LLVM_VERSION@/lib/libomptarget.devicertl.a
+[amd64 hurd-amd64 ppc64el arm64 ppc64] /usr/lib/llvm- at LLVM_VERSION@/lib/libomptarget.devicertl.a
 
-[amd64 hurd-amd64 ppc64el arm64 loong64 mips64el ppc64 riscv64] /usr/lib/llvm- at LLVM_VERSION@/lib/libomptarget-*.bc
+[amd64 hurd-amd64 ppc64el arm64 ppc64] /usr/lib/llvm- at LLVM_VERSION@/lib/libomptarget-*.bc
 
 usr/lib/llvm- at LLVM_VERSION@/lib/cmake/openmp/*.cmake
 
-[amd64 hurd-amd64 arm64 loong64 mips64el ppc64el ppc64 riscv64] usr/lib/llvm- at LLVM_VERSION@/bin/llvm-omp-device-info
-[amd64 hurd-amd64 arm64 loong64 mips64el ppc64el ppc64 riscv64] usr/lib/llvm- at LLVM_VERSION@/bin/llvm-omp-kernel-replay
+[amd64 hurd-amd64 arm64 ppc64el ppc64] usr/lib/llvm- at LLVM_VERSION@/bin/llvm-omp-device-info
+[amd64 hurd-amd64 arm64 ppc64el ppc64] usr/lib/llvm- at LLVM_VERSION@/bin/llvm-omp-kernel-replay
 
-[amd64 hurd-amd64 arm64 loong64 mips64el ppc64el ppc64 riscv64] usr/bin/llvm-omp-device-info- at LLVM_VERSION@
-[amd64 hurd-amd64 arm64 loong64 mips64el ppc64el ppc64 riscv64] usr/bin/llvm-omp-kernel-replay- at LLVM_VERSION@
+[amd64 hurd-amd64 arm64 ppc64el ppc64] usr/bin/llvm-omp-device-info- at LLVM_VERSION@
+[amd64 hurd-amd64 arm64 ppc64el ppc64] usr/bin/llvm-omp-kernel-replay- at LLVM_VERSION@
 
 [!armhf !hurd-amd64] usr/lib/llvm- at LLVM_VERSION@/share/gdb/python/ompd/
--- llvm-toolchain-19-19.1.3/debian/rules
+++ llvm-toolchain-19-19.1.3/debian/rules
@@ -423,12 +423,16 @@
 endif
 
 # Enable openmp (or not)
-OMP_ARCHS = amd64 arm64 armhf ppc64 ppc64el hurd-amd64
+OMP_OFFLOAD_ARCHS = amd64 arm64 armhf ppc64 ppc64el hurd-amd64
+OMP_ARCHS = $(OMP_OFFLOAD_ARCHS) loong64 mips64el riscv64
 OPENMP_ENABLE=yes
 ifeq (,$(filter $(DEB_HOST_ARCH), $(OMP_ARCHS)))
   OPENMP_ENABLE=no
 else
-  RUNTIMES += ;openmp;offload
+  RUNTIMES += ;openmp
+  ifneq (,$(filter $(DEB_HOST_ARCH), $(OMP_OFFLOAD_ARCHS)))
+      RUNTIMES += ;offload
+  endif
   STAGE_ALL_CMAKE_EXTRA += -DLIBOMP_LIBFLAGS="-lm"
 ifeq ($(LIBUNWIND_ENABLE),yes)
   STAGE_ALL_CMAKE_EXTRA += -DOPENMP_USE_LLVM_UNWINDER=ON



More information about the Pkg-llvm-team mailing list