Merge ~slavik81/ubuntu/+source/glibc:fix-rocm-hipamd-ftbfs into ubuntu/+source/glibc:ubuntu/devel

Proposed by Cory Bloor
Status: Needs review
Proposed branch: ~slavik81/ubuntu/+source/glibc:fix-rocm-hipamd-ftbfs
Merge into: ubuntu/+source/glibc:ubuntu/devel
Diff against target: 47 lines (+31/-0)
2 files modified
debian/patches/arm/lp2032624-amdgpu.patch (+30/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Graham Inggs (community) Needs Information
git-ubuntu import Pending
Review via email: mp+464058@code.launchpad.net

Description of the change

Add d/p/arm/lp2032624-amdgpu.patch to disable SVE vector types on aarch64 when __HIP_DEVICE_COMPILE__ is set, as this macro is provided by clang to indicates that the code is being built for the GPU, rather than for the CPU. SVE vector types are not available on the GPU.

The rocm-hipamd library and its rdepends FTBFS due to the addition of these vector types in glibc 2.38 (LP2032624). This patch should fix that problem (at least for rocm-hipamd).

To post a comment you must log in.
Revision history for this message
Graham Inggs (ginggs) wrote :

Based on comment 22 in LP: #2032624, I am marking this merge request 'Needs information'.

review: Needs Information

Unmerged commits

abd2e5d... by Cordell Bloor <email address hidden>

Add d/p/arm/lp2032624-amdgpu.patch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/patches/arm/lp2032624-amdgpu.patch b/debian/patches/arm/lp2032624-amdgpu.patch
0new file mode 1006440new file mode 100644
index 0000000..ce72d8a
--- /dev/null
+++ b/debian/patches/arm/lp2032624-amdgpu.patch
@@ -0,0 +1,30 @@
1From: Cordell Bloor <cgmb@slerp.xyz>
2Date: Wed, 10 Apr 2024 16:49:24 -0600
3Subject: [PATCH] arm64/math-vec.h: drop SVE vector types in device code
4
5These headers get included when building HIP libraries on the aarch64
6platform. The headers are used when building both CPU code and GPU
7code, but the SVE vector types are not supported on the GPU.
8
9The clang compiler sets __HIP_DEVICE_COMPILE__ when it is building
10code for the GPU, so disable __SVE_VEC_MATH_SUPPORTED when that macro
11is detected.
12
13Bug-Ubuntu: https://bugs.launchpad.net/glibc/+bug/2032624
14Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30909
15Forwarded: No
16
17Index: glibc/sysdeps/aarch64/fpu/bits/math-vector.h
18===================================================================
19--- glibc.orig/sysdeps/aarch64/fpu/bits/math-vector.h
20+++ glibc/sysdeps/aarch64/fpu/bits/math-vector.h
21@@ -101,7 +101,8 @@ typedef __attribute__ ((__neon_vector_ty
22 typedef __attribute__ ((__neon_vector_type__ (2))) double __f64x2_t;
23 #endif
24
25-#if __GNUC_PREREQ(10, 0) || __glibc_clang_prereq(11, 0)
26+#if (__GNUC_PREREQ(10, 0) || __glibc_clang_prereq(11, 0)) \
27+ && !defined(__HIP_DEVICE_COMPILE__)
28 # define __SVE_VEC_MATH_SUPPORTED
29 typedef __SVFloat32_t __sv_f32_t;
30 typedef __SVFloat64_t __sv_f64_t;
diff --git a/debian/patches/series b/debian/patches/series
index 24d7df1..696d833 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -23,6 +23,7 @@ arm/local-sigaction.diff
23arm/local-vfp-sysdeps.diff23arm/local-vfp-sysdeps.diff
24arm/unsubmitted-ldso-multilib.diff24arm/unsubmitted-ldso-multilib.diff
25arm/local-arm-futex.diff25arm/local-arm-futex.diff
26arm/lp2032624-amdgpu.patch
2627
27hppa/local-inlining.diff28hppa/local-inlining.diff
2829

Subscribers

People subscribed via source and target branches