diff options
author | Florian Wühr <f.wuehr@rational-online.com> | 2022-08-30 16:10:43 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-08-30 07:35:53 -0700 |
commit | 92e0da74f36e6cc4e9b37c0a5976888afcab8ca1 (patch) | |
tree | 769d3b1483d4f91020782877ce952682a0dadd75 | |
parent | 93552c79eed5daa44a24bf4b7a063a2ade739e97 (diff) | |
download | meta-clang-92e0da74f36e6cc4e9b37c0a5976888afcab8ca1.tar.gz |
Fix mesa build with newer clang (port fixes from mesa)
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 @@ | |||
1 | From ff8daa013621019f1606dc0c188b16f1ce34fea7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vinson Lee <vlee@freedesktop.org> | ||
3 | Date: Mon, 6 Apr 2020 18:21:54 -0700 | ||
4 | Subject: gallivm: Add missing header for powf. | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Fix build error after llvm-11 commit 3a29393b4709 ("Remove | ||
10 | math.h/cmath include from DataTypes.h"). | ||
11 | |||
12 | src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c: In function ‘lp_build_linear_to_srgb’: | ||
13 | src/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 | | ^~~~ | ||
16 | src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c:194:44: warning: incompatible implicit declaration of built-in function ‘powf’ | ||
17 | src/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 | |||
22 | Signed-off-by: Vinson Lee <vlee@freedesktop.org> | ||
23 | Reviewed-by: Roland Scheidegger <sroland@vmware.com> | ||
24 | Part-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 | |||
29 | diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c b/src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c | ||
30 | index 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 @@ | |||
1 | From 52aa730d07618513d6c055618069b2f4680974cc Mon Sep 17 00:00:00 2001 | ||
2 | From: Jan Zielinski <jan.zielinski@intel.com> | ||
3 | Date: Mon, 27 Apr 2020 13:34:59 +0200 | ||
4 | Subject: [PATCH] gallium/gallivm: remove unused header include for newer LLVM | ||
5 | |||
6 | In the top of the trunk LLVM (11) llvm/IR/CallSite.h header | ||
7 | has been removed. The file compiles without this include also | ||
8 | for LLVM 8, but I'm not sure about 9, 10, and older versions | ||
9 | so I disable it only for the latest LLVM | ||
10 | |||
11 | Reviewed-by: Roland Scheidegger <sroland@vmware.com> | ||
12 | Part-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 | |||
17 | diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | ||
18 | index 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 | -- | ||
32 | GitLab | ||
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 @@ | |||
1 | From 1d018bc7fde744b5fc71108887a51e5bfaff8776 Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Scheidegger <sroland@vmware.com> | ||
3 | Date: Wed, 2 Sep 2020 04:04:50 +0200 | ||
4 | Subject: [PATCH] gallivm: add InstSimplify pass | ||
5 | |||
6 | This is the recommended replacement for the removed ConstantPropagation | ||
7 | pass, and llvm now added c binding for it. | ||
8 | |||
9 | Part-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 | |||
14 | diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c | ||
15 | index 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 | -- | ||
28 | GitLab | ||
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 @@ | |||
1 | From 52cac068621a5998f486f8e44f9c2d9d045d1c31 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com> | ||
3 | Date: Mon, 31 Aug 2020 21:59:39 -0400 | ||
4 | Subject: [PATCH] gallivm: fix build on LLVM 12 due to | ||
5 | LLVMAddConstantPropagationPass removal | ||
6 | |||
7 | Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3465 | ||
8 | Cc: 20.1 20.2 <mesa-stable@lists.freedesktop.org> | ||
9 | Reviewed-by: Dave Airlie <airlied@redhat.com> | ||
10 | Part-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 | |||
15 | diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c | ||
16 | index 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 | -- | ||
30 | GitLab | ||
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 | ||
7 | export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-config" | 7 | export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-config" |
8 | 8 | ||
9 | FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" | ||
10 | |||
11 | SRC_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 | |||
9 | PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true, -Dllvm=false, clang clang-native elfutils" | 17 | PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true, -Dllvm=false, clang clang-native elfutils" |