Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 1 | From 865762e0a767a121206d818bdd58301afbf30104 Mon Sep 17 00:00:00 2001 |
| 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> |
| 12 | --- |
| 13 | src/gallium/auxiliary/gallivm/lp_bld_init.c | 4 +++- |
| 14 | 1 file changed, 3 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 24d0823..3d4573e 100644 |
| 18 | --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c |
| 19 | +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c |
| 20 | @@ -42,8 +42,10 @@ |
| 21 | |
| 22 | #include <llvm/Config/llvm-config.h> |
| 23 | #include <llvm-c/Analysis.h> |
| 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 |
| 31 | #include <llvm-c/BitWriter.h> |
| 32 | -- |
| 33 | 2.41.0 |
| 34 | |