blob: 237f940f0bfe0c94124f694800a1a3021d4d7944 [file] [log] [blame]
Andrew Geissler20137392023-10-12 04:59:14 -06001From 6d07f6aa7f92f40d78a2db645f16f0f3e7d3c2e8 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 Geissler8f840682023-07-21 09:09:43 -050012
Andrew Geissler20137392023-10-12 04:59:14 -060013---
14 src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 +++++-
15 1 file changed, 5 insertions(+), 1 deletion(-)
16
17diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
18index cd2108f..b1a4d03 100644
Andrew Geissler8f840682023-07-21 09:09:43 -050019--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
20+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
Andrew Geissler20137392023-10-12 04:59:14 -060021@@ -46,15 +46,19 @@
22 #if GALLIVM_USE_NEW_PASS == 1
23 #include <llvm-c/Transforms/PassBuilder.h>
24 #elif GALLIVM_HAVE_CORO == 1
Andrew Geissler8f840682023-07-21 09:09:43 -050025+#if LLVM_VERSION_MAJOR < 17
26 #include <llvm-c/Transforms/Scalar.h>
27-#if LLVM_VERSION_MAJOR >= 7
28+#endif
29+#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17
30 #include <llvm-c/Transforms/Utils.h>
31 #endif
Andrew Geissler220dafd2023-10-04 10:18:08 -050032 #if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64)
33 #include <llvm-c/Transforms/IPO.h>
34 #endif
35+#if LLVM_VERSION_MAJOR < 17
36 #include <llvm-c/Transforms/Coroutines.h>
37 #endif
38+#endif
39
40 unsigned gallivm_perf = 0;
41