[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#995618: mesa: tries to uses non-available LLVM JIT on riscv64



Source: mesa
Version: 21.2.2-1
Severity: important
Tags: patch
X-Debbugs-Cc: debian-riscv@lists.debian.org

Mesa version 20.3.4-1 enabled LLVM support on riscv64. However while
RISC-V is supported by LLVM, JIT is not yet supported. Support is being
worked on, and might be in LLVM 14 or 15.

This causes programs (e.g. gtk4, clutter, epiphany, etc.) to abort when
Mesa tries to execute JIT code through LLVM:

| 'generic' is not a recognized processor for this target (ignoring processor)
| 'generic' is not a recognized processor for this target (ignoring processor)
| WARNING: This target JIT is not designed for the host you are running.  If bad things happen, please choose a different -march switch.
| 'generic' is not a recognized processor for this target (ignoring processor)
| 'generic' is not a recognized processor for this target (ignoring processor)
| 'generic' is not a recognized processor for this target (ignoring processor)
| 'generic' is not a recognized processor for this target (ignoring processor)
| 'generic' is not a recognized processor for this target (ignoring processor)
| 'generic' is not a recognized processor for this target (ignoring processor)
| 'generic' is not a recognized processor for this target (ignoring processor)
| 'generic' is not a recognized processor for this target (ignoring processor)
| LLVM ERROR: Cannot select: 0x2aaab99e38: ch = store<(store 4 into %ir.1 + 4, basealign 16), trunc to i32> 0x2aaab99a28, 0x2aaab96330, 0x2aaab9a4b8, undef:i64
|   0x2aaab96330: i64,ch = load<(load 2 from %ir.0 + 6), zext from i16> 0x2aaab4c658, 0x2aaab9a658, undef:i64
|     0x2aaab9a658: i64 = add 0x2aaab95eb8, Constant:i64<6>
|       0x2aaab95eb8: i64,ch = CopyFromReg 0x2aaab4c658, Register:i64 %0
|         0x2aaab95e50: i64 = Register %0
|       0x2aaab99c30: i64 = Constant<6>
|     0x2aaab96058: i64 = undef
|   0x2aaab9a4b8: i64 = add nuw 0x2aaab95f88, Constant:i64<4>
|     0x2aaab95f88: i64,ch = CopyFromReg 0x2aaab4c658, Register:i64 %1
|       0x2aaab95f20: i64 = Register %1
|     0x2aaab96740: i64 = Constant<4>
|   0x2aaab96058: i64 = undef

The attached patch fixes that by reverting the corresponding changes.
Could you please include it in the next upload?

Thanks,
Aurelien
diff -u mesa-21.2.2/debian/changelog mesa-21.2.2/debian/changelog
--- mesa-21.2.2/debian/changelog
+++ mesa-21.2.2/debian/changelog
@@ -1,3 +1,9 @@
+mesa (21.2.2-1+riscv64) unreleased; urgency=medium
+
+  * Disable LLVM support on riscv64, it doesn't have JIT.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Fri, 01 Oct 2021 19:21:24 +0000
+
 mesa (21.2.2-1) unstable; urgency=medium
 
   * New upstream release.
diff -u mesa-21.2.2/debian/control mesa-21.2.2/debian/control
--- mesa-21.2.2/debian/control
+++ mesa-21.2.2/debian/control
@@ -43,10 +43,10 @@
  libelf-dev [amd64 arm64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
  libwayland-dev (>= 1.15.0) [linux-any],
  libwayland-egl-backend-dev (>= 1.15.0) [linux-any],
- llvm-12-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
- libclang-12-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
- libclang-cpp12-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
- libclc-12-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64],
+ llvm-12-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64],
+ libclang-12-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64],
+ libclang-cpp12-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64],
+ libclc-12-dev [amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64],
  wayland-protocols (>= 1.9),
  zlib1g-dev,
  libglvnd-dev (>= 1.3.2),
@@ -412,7 +412,7 @@
 
 Package: mesa-opencl-icd
 Section: libs
-Architecture: amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64
+Architecture: amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64
 Pre-Depends: ${misc:Pre-Depends}
 Depends:
  libclc-12,
diff -u mesa-21.2.2/debian/rules mesa-21.2.2/debian/rules
--- mesa-21.2.2/debian/rules
+++ mesa-21.2.2/debian/rules
@@ -54,7 +54,7 @@
 
   # radv/lavapipe needs LLVM and the Vulkan loader, so only build on the subset of
   # arches where we have LLVM enabled and where the Vulkan loader is built.
-  ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64))
+  ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64))
 	VULKAN_DRIVERS += amd swrast
   endif
 
@@ -105,7 +105,7 @@
 
   # LLVM is required for building r300g, radeonsi and llvmpipe drivers.
   # It's also required for building OpenCL support.
-  ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sparc64))
+  ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 mips64el mipsel powerpc ppc64 ppc64el s390x sparc64))
 	GALLIUM_DRIVERS += radeonsi
 	confflags_GALLIUM += -Dllvm=enabled
 	confflags_GALLIUM += -Dgallium-opencl=icd

Reply to: