Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 1 | From 6d07f6aa7f92f40d78a2db645f16f0f3e7d3c2e8 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 23 Jun 2023 01:20:38 -0700 |
| 4 | Subject: [PATCH] gallium: Fix build with llvm 17 |
| 5 | |
| 6 | These headers are not available for C files in llvm 17+ |
| 7 | and they seem to be not needed to compile after all with llvm 17 |
| 8 | so add conditions to exclude them for llvm >= 17 |
| 9 | |
| 10 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23827] |
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 12 | |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 13 | --- |
| 14 | src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 +++++- |
| 15 | 1 file changed, 5 insertions(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c |
| 18 | index cd2108f..b1a4d03 100644 |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 19 | --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c |
| 20 | +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 21 | @@ -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 Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 25 | +#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 Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 32 | #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 | |