diff --git a/gallium-Undef-__arm_streaming-macro-to-workaround-cl.patch b/gallium-Undef-__arm_streaming-macro-to-workaround-cl.patch new file mode 100644 index 0000000..4ecd46a --- /dev/null +++ b/gallium-Undef-__arm_streaming-macro-to-workaround-cl.patch @@ -0,0 +1,96 @@ +From bc99ffc770879ff8633128f74dad3159ce3206d3 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Fri, 19 Jan 2024 12:21:07 +0100 +Subject: [PATCH] gallium: Undef __arm_streaming macro to workaround clang + nested expansion + +Prior to GCC14, the `__arm_streaming` macro was not spelled as an attribute +using the CXX11 syntax (e.g: [[arm::streaming]]) and so clang expanded that +macro macro. + +But since GCC14, it's spelled as `[[arm::streaming]]` which makes clang to +try expanding the attribute again and generating an invalid preprocessing +token due the nested macro usage: + +/usr/include/clang/Basic/AttrTokenKinds.inc:9:1: error: pasting "kw_" and "[" does not give a valid preprocessing token + 9 | KEYWORD_ATTRIBUTE(__arm_streaming) + +Until this is fixed in clang, let's undefine the __arm_streaming macro. + +Signed-off-by: Javier Martinez Canillas +--- + src/compiler/clc/clc_helpers.cpp | 2 ++ + src/gallium/frontends/clover/llvm/codegen/bitcode.cpp | 2 ++ + src/gallium/frontends/clover/llvm/codegen/common.cpp | 2 ++ + src/gallium/frontends/clover/llvm/codegen/native.cpp | 2 ++ + src/gallium/frontends/clover/llvm/invocation.cpp | 2 ++ + 5 files changed, 10 insertions(+) + +diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp +index 15af4b44c6ce..f8cf4afe74a7 100644 +--- a/src/compiler/clc/clc_helpers.cpp ++++ b/src/compiler/clc/clc_helpers.cpp +@@ -23,6 +23,8 @@ + // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + // OTHER DEALINGS IN THE SOFTWARE. + ++#undef __arm_streaming ++ + #include + #include + #include +diff --git a/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp b/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp +index 568bdd993f59..00e10672f973 100644 +--- a/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp ++++ b/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp +@@ -31,6 +31,8 @@ + /// after linking against other bitcode object files. + /// + ++#undef __arm_streaming ++ + #include + + #include "llvm/codegen.hpp" +diff --git a/src/gallium/frontends/clover/llvm/codegen/common.cpp b/src/gallium/frontends/clover/llvm/codegen/common.cpp +index fe5fc768bcd5..f659b35283b5 100644 +--- a/src/gallium/frontends/clover/llvm/codegen/common.cpp ++++ b/src/gallium/frontends/clover/llvm/codegen/common.cpp +@@ -30,6 +30,8 @@ + /// understood by pipe drivers. + /// + ++#undef __arm_streaming ++ + #include + #include + +diff --git a/src/gallium/frontends/clover/llvm/codegen/native.cpp b/src/gallium/frontends/clover/llvm/codegen/native.cpp +index 72046c8a1881..e115e06cbbb6 100644 +--- a/src/gallium/frontends/clover/llvm/codegen/native.cpp ++++ b/src/gallium/frontends/clover/llvm/codegen/native.cpp +@@ -27,6 +27,8 @@ + /// executable code as an ELF object file. + /// + ++#undef __arm_streaming ++ + #include + #include + +diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp +index 6ab32befbcd3..287af9891015 100644 +--- a/src/gallium/frontends/clover/llvm/invocation.cpp ++++ b/src/gallium/frontends/clover/llvm/invocation.cpp +@@ -24,6 +24,8 @@ + // OTHER DEALINGS IN THE SOFTWARE. + // + ++#undef __arm_streaming ++ + #include + #include + #include +-- +2.43.0 + diff --git a/mesa.spec b/mesa.spec index ca30c51..2a41d09 100644 --- a/mesa.spec +++ b/mesa.spec @@ -74,6 +74,8 @@ Source0: https://archive.mesa3d.org/mesa-%{ver}.tar.xz Source1: Mesa-MLAA-License-Clarification-Email.txt Patch10: gnome-shell-glthread-disable.patch +# Workaround for llvm/clang bug: https://github.com/llvm/llvm-project/issues/78691 +Patch11: gallium-Undef-__arm_streaming-macro-to-workaround-cl.patch BuildRequires: meson >= 1.2.0 BuildRequires: gcc