Patrick Williams | b58112e | 2024-03-07 11:16:36 -0600 | [diff] [blame] | 1 | From 3e1e5c475b52651657c906e6b03ee13567cccdd7 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 | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 12 | --- |
| 13 | src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 +++++- |
| 14 | 1 file changed, 5 insertions(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c |
| 17 | index cd2108f..b1a4d03 100644 |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 18 | --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c |
| 19 | +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c |
Andrew Geissler | 2013739 | 2023-10-12 04:59:14 -0600 | [diff] [blame] | 20 | @@ -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 Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 24 | +#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 Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 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 | |