summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Wühr <f.wuehr@rational-online.com>2022-08-30 16:10:43 +0200
committerKhem Raj <raj.khem@gmail.com>2022-08-30 07:35:53 -0700
commit92e0da74f36e6cc4e9b37c0a5976888afcab8ca1 (patch)
tree769d3b1483d4f91020782877ce952682a0dadd75
parent93552c79eed5daa44a24bf4b7a063a2ade739e97 (diff)
downloadmeta-clang-92e0da74f36e6cc4e9b37c0a5976888afcab8ca1.tar.gz
Fix mesa build with newer clang (port fixes from mesa)
-rw-r--r--recipes-graphics/mesa/mesa/0001-gallium-add-missing-header-for-powf.patch41
-rw-r--r--recipes-graphics/mesa/mesa/0001-gallium-gallivm-remove-unused-header-include-for-newer-LLVM.patch33
-rw-r--r--recipes-graphics/mesa/mesa/0001-gallivm-add-InstSimplify-pass.patch29
-rw-r--r--recipes-graphics/mesa/mesa/0001-gallivm-fix-build-on-llvm-12-due-to-LLVMAddConstantPropagationPass-removal.patch31
-rw-r--r--recipes-graphics/mesa/mesa_%.bbappend8
5 files changed, 142 insertions, 0 deletions
diff --git a/recipes-graphics/mesa/mesa/0001-gallium-add-missing-header-for-powf.patch b/recipes-graphics/mesa/mesa/0001-gallium-add-missing-header-for-powf.patch
new file mode 100644
index 0000000..851ec39
--- /dev/null
+++ b/recipes-graphics/mesa/mesa/0001-gallium-add-missing-header-for-powf.patch
@@ -0,0 +1,41 @@
1From ff8daa013621019f1606dc0c188b16f1ce34fea7 Mon Sep 17 00:00:00 2001
2From: Vinson Lee <vlee@freedesktop.org>
3Date: Mon, 6 Apr 2020 18:21:54 -0700
4Subject: gallivm: Add missing header for powf.
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Fix build error after llvm-11 commit 3a29393b4709 ("Remove
10math.h/cmath include from DataTypes.h").
11
12src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c: In function ‘lp_build_linear_to_srgb’:
13src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:194:44: error: implicit declaration of function ‘powf’ [-Werror=implicit-function-declaration]
14 194 | exp2f_c * powf(coeff_f, 1.0f / exp_f));
15 | ^~~~
16src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:194:44: warning: incompatible implicit declaration of built-in function ‘powf’
17src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:78:1: note: include ‘<math.h>’ or provide a declaration of ‘powf’
18 77 | #include "lp_bld_format.h"
19 +++ |+#include <math.h>
20 78 |
21
22Signed-off-by: Vinson Lee <vlee@freedesktop.org>
23Reviewed-by: Roland Scheidegger <sroland@vmware.com>
24Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4473>
25---
26 src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c | 1 +
27 1 file changed, 1 insertion(+)
28
29diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c b/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c
30index d5cf698b060..5cd6ebe7149 100644
31--- a/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c
32+++ b/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c
33@@ -68,6 +68,7 @@
34
35
36 #include "util/u_debug.h"
37+#include "util/u_math.h"
38
39 #include "lp_bld_type.h"
40 #include "lp_bld_const.h"
41--
diff --git a/recipes-graphics/mesa/mesa/0001-gallium-gallivm-remove-unused-header-include-for-newer-LLVM.patch b/recipes-graphics/mesa/mesa/0001-gallium-gallivm-remove-unused-header-include-for-newer-LLVM.patch
new file mode 100644
index 0000000..2347182
--- /dev/null
+++ b/recipes-graphics/mesa/mesa/0001-gallium-gallivm-remove-unused-header-include-for-newer-LLVM.patch
@@ -0,0 +1,33 @@
1From 52aa730d07618513d6c055618069b2f4680974cc Mon Sep 17 00:00:00 2001
2From: Jan Zielinski <jan.zielinski@intel.com>
3Date: Mon, 27 Apr 2020 13:34:59 +0200
4Subject: [PATCH] gallium/gallivm: remove unused header include for newer LLVM
5
6In the top of the trunk LLVM (11) llvm/IR/CallSite.h header
7has been removed. The file compiles without this include also
8for LLVM 8, but I'm not sure about 9, 10, and older versions
9so I disable it only for the latest LLVM
10
11Reviewed-by: Roland Scheidegger <sroland@vmware.com>
12Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4748>
13---
14 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 ++
15 1 file changed, 2 insertions(+)
16
17diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
18index 40cc96824f3e..df7196190c5e 100644
19--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
20+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
21@@ -65,7 +65,9 @@
22
23 #include <llvm/Support/TargetSelect.h>
24
25+#if LLVM_VERSION_MAJOR < 11
26 #include <llvm/IR/CallSite.h>
27+#endif
28 #include <llvm/IR/IRBuilder.h>
29 #include <llvm/IR/Module.h>
30 #include <llvm/Support/CBindingWrapping.h>
31--
32GitLab
33
diff --git a/recipes-graphics/mesa/mesa/0001-gallivm-add-InstSimplify-pass.patch b/recipes-graphics/mesa/mesa/0001-gallivm-add-InstSimplify-pass.patch
new file mode 100644
index 0000000..8846bf3
--- /dev/null
+++ b/recipes-graphics/mesa/mesa/0001-gallivm-add-InstSimplify-pass.patch
@@ -0,0 +1,29 @@
1From 1d018bc7fde744b5fc71108887a51e5bfaff8776 Mon Sep 17 00:00:00 2001
2From: Roland Scheidegger <sroland@vmware.com>
3Date: Wed, 2 Sep 2020 04:04:50 +0200
4Subject: [PATCH] gallivm: add InstSimplify pass
5
6This is the recommended replacement for the removed ConstantPropagation
7pass, and llvm now added c binding for it.
8
9Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6585>
10---
11 src/gallium/auxiliary/gallivm/lp_bld_init.c | 2 ++
12 1 file changed, 2 insertions(+)
13
14diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
15index 1eb4892a4a6c..fe3ef4a48df5 100644
16--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
17+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
18@@ -171,6 +171,8 @@ create_pass_manager(struct gallivm_state *gallivm)
19 LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
20 #if LLVM_VERSION_MAJOR <= 11
21 LLVMAddConstantPropagationPass(gallivm->passmgr);
22+#else
23+ LLVMAddInstructionSimplifyPass(gallivm->passmgr);
24 #endif
25 LLVMAddInstructionCombiningPass(gallivm->passmgr);
26 LLVMAddGVNPass(gallivm->passmgr);
27--
28GitLab
29
diff --git a/recipes-graphics/mesa/mesa/0001-gallivm-fix-build-on-llvm-12-due-to-LLVMAddConstantPropagationPass-removal.patch b/recipes-graphics/mesa/mesa/0001-gallivm-fix-build-on-llvm-12-due-to-LLVMAddConstantPropagationPass-removal.patch
new file mode 100644
index 0000000..0c7004c
--- /dev/null
+++ b/recipes-graphics/mesa/mesa/0001-gallivm-fix-build-on-llvm-12-due-to-LLVMAddConstantPropagationPass-removal.patch
@@ -0,0 +1,31 @@
1From 52cac068621a5998f486f8e44f9c2d9d045d1c31 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com>
3Date: Mon, 31 Aug 2020 21:59:39 -0400
4Subject: [PATCH] gallivm: fix build on LLVM 12 due to
5 LLVMAddConstantPropagationPass removal
6
7Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3465
8Cc: 20.1 20.2 <mesa-stable@lists.freedesktop.org>
9Reviewed-by: Dave Airlie <airlied@redhat.com>
10Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6531>
11---
12 src/gallium/auxiliary/gallivm/lp_bld_init.c | 2 ++
13 1 file changed, 2 insertions(+)
14
15diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
16index 6ebc9ebf25a3..1eb4892a4a6c 100644
17--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
18+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
19@@ -169,7 +169,9 @@ create_pass_manager(struct gallivm_state *gallivm)
20 */
21 LLVMAddReassociatePass(gallivm->passmgr);
22 LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
23+#if LLVM_VERSION_MAJOR <= 11
24 LLVMAddConstantPropagationPass(gallivm->passmgr);
25+#endif
26 LLVMAddInstructionCombiningPass(gallivm->passmgr);
27 LLVMAddGVNPass(gallivm->passmgr);
28 }
29--
30GitLab
31
diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend
index ddf5305..8af7a0e 100644
--- a/recipes-graphics/mesa/mesa_%.bbappend
+++ b/recipes-graphics/mesa/mesa_%.bbappend
@@ -6,4 +6,12 @@ EXTRA_OEMASON_append_toolchain-clang_x86-64 = " -Dasm=false"
6 6
7export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-config" 7export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-config"
8 8
9FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
10
11SRC_URI += "file://0001-gallium-add-missing-header-for-powf.patch \
12 file://0001-gallivm-fix-build-on-llvm-12-due-to-LLVMAddConstantPropagationPass-removal.patch \
13 file://0001-gallivm-add-InstSimplify-pass.patch \
14 file://0001-gallium-gallivm-remove-unused-header-include-for-newer-LLVM.patch \
15 "
16
9PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true, -Dllvm=false, clang clang-native elfutils" 17PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true, -Dllvm=false, clang clang-native elfutils"