From 86944b9db1c1a7afff36f82f59be9439c702db76 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 31 Jan 2023 23:19:06 +0100 Subject: [PATCH] Fix disabling amdgpu on non-Linux --- debian/changelog | 3 +++ debian/patches/amdgpu-nonlinux.patch | 20 ++++++++++++++++++++ debian/patches/series | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 debian/patches/amdgpu-nonlinux.patch diff --git a/debian/changelog b/debian/changelog index a9e6c011..16191b65 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,9 @@ llvm-toolchain-15 (1:15.0.7-2) UNRELEASED; urgency=medium * Update print lldb python patch, following what was done in automake for newer python + [ Samuel Thibault ] + * Fix disabling amdgpu on non-Linux. + -- Sylvestre Ledru Sun, 15 Jan 2023 10:54:41 +0100 llvm-toolchain-15 (1:15.0.7-1) unstable; urgency=medium diff --git a/debian/patches/amdgpu-nonlinux.patch b/debian/patches/amdgpu-nonlinux.patch new file mode 100644 index 00000000..2c0098ed --- /dev/null +++ b/debian/patches/amdgpu-nonlinux.patch @@ -0,0 +1,20 @@ +https://reviews.llvm.org/D143017 + +[Libomptarget] Fix disabling amdgpu on non-Linux. + +Previously, on non-Linux, amdgpu would get enabled whatever the CPU +architecture. + +Index: llvm-toolchain-15-15.0.7/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt +=================================================================== +--- llvm-toolchain-15-15.0.7.orig/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt ++++ llvm-toolchain-15-15.0.7/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt +@@ -27,7 +27,7 @@ if(NOT LIBOMPTARGET_DEP_LIBELF_FOUND) + return() + endif() + +-if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux") ++if(NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux")) + libomptarget_say("Not building AMDGPU plugin: only support AMDGPU in Linux x86_64, ppc64le, or aarch64 hosts") + return() + endif() diff --git a/debian/patches/series b/debian/patches/series index bee43cb8..b918a51a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -158,3 +158,5 @@ protobuf_3.21.patch add-arm-vcmpz-test.patch fix-mesa-build.patch link-grpc.diff + +amdgpu-nonlinux.patch