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
Ubuntu Sponsors Pending
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.

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

Subscribers

People subscribed via source and target branches