blob: ceb0153f8d3029285c3cb9146b2c50824ee32237 [file] [log] [blame]
Patrick Williamsb58112e2024-03-07 11:16:36 -06001From 3e1e5c475b52651657c906e6b03ee13567cccdd7 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>
Andrew Geissler20137392023-10-12 04:59:14 -060012---
13 src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 +++++-
14 1 file changed, 5 insertions(+), 1 deletion(-)
15
16diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
17index cd2108f..b1a4d03 100644
Andrew Geissler8f840682023-07-21 09:09:43 -050018--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
19+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
Andrew Geissler20137392023-10-12 04:59:14 -060020@@ -46,15 +46,19 @@
21 #if GALLIVM_USE_NEW_PASS == 1
22 #include <llvm-c/Transforms/PassBuilder.h>
23 #elif GALLIVM_HAVE_CORO == 1
Andrew Geissler8f840682023-07-21 09:09:43 -050024+#if LLVM_VERSION_MAJOR < 17
25 #include <llvm-c/Transforms/Scalar.h>
26-#if LLVM_VERSION_MAJOR >= 7
27+#endif
28+#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17
29 #include <llvm-c/Transforms/Utils.h>
30 #endif
Andrew Geissler220dafd2023-10-04 10:18:08 -050031 #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