blob: 165708145a73b198219f0e745f464158bd4c2849 [file] [log] [blame]
From c8e9776abc3dfd3f2411797a90a03e7fa16263ef Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 23 Jun 2023 01:20:38 -0700
Subject: [PATCH] gallium: Fix build with llvm 17
These headers are not available for C files in llvm 17+
and they seem to be not needed to compile after all with llvm 17
so add conditions to exclude them for llvm >= 17
Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23827]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -42,8 +42,10 @@
#include <llvm/Config/llvm-config.h>
#include <llvm-c/Analysis.h>
+#if LLVM_VERSION_MAJOR < 17
#include <llvm-c/Transforms/Scalar.h>
-#if LLVM_VERSION_MAJOR >= 7
+#endif
+#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17
#include <llvm-c/Transforms/Utils.h>
#endif
#include <llvm-c/BitWriter.h>
@@ -53,8 +55,10 @@
#if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64)
#include <llvm-c/Transforms/IPO.h>
#endif
+#if LLVM_VERSION_MAJOR < 17
#include <llvm-c/Transforms/Coroutines.h>
#endif
+#endif
unsigned gallivm_perf = 0;