blob: 165708145a73b198219f0e745f464158bd4c2849 [file] [log] [blame]
Andrew Geissler220dafd2023-10-04 10:18:08 -05001From c8e9776abc3dfd3f2411797a90a03e7fa16263ef Mon Sep 17 00:00:00 2001
Andrew Geissler8f840682023-07-21 09:09:43 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 23 Jun 2023 01:20:38 -0700
4Subject: [PATCH] gallium: Fix build with llvm 17
5
6These headers are not available for C files in llvm 17+
7and they seem to be not needed to compile after all with llvm 17
8so add conditions to exclude them for llvm >= 17
9
10Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23827]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
Andrew Geissler220dafd2023-10-04 10:18:08 -050013 src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 ++++--
14 1 file changed, 4 insertions(+), 2 deletions(-)
Andrew Geissler8f840682023-07-21 09:09:43 -050015
Andrew Geissler8f840682023-07-21 09:09:43 -050016--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
17+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
18@@ -42,8 +42,10 @@
19
20 #include <llvm/Config/llvm-config.h>
21 #include <llvm-c/Analysis.h>
22+#if LLVM_VERSION_MAJOR < 17
23 #include <llvm-c/Transforms/Scalar.h>
24-#if LLVM_VERSION_MAJOR >= 7
25+#endif
26+#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17
27 #include <llvm-c/Transforms/Utils.h>
28 #endif
29 #include <llvm-c/BitWriter.h>
Andrew Geissler220dafd2023-10-04 10:18:08 -050030@@ -53,8 +55,10 @@
31 #if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64)
32 #include <llvm-c/Transforms/IPO.h>
33 #endif
34+#if LLVM_VERSION_MAJOR < 17
35 #include <llvm-c/Transforms/Coroutines.h>
36 #endif
37+#endif
38
39 unsigned gallivm_perf = 0;
40