Clang13 crashes and lets workaround it for now

Signed-off-by: Khem Raj <[email protected]>
---
 .../0001-Fix-build-on-mips-clang.patch        | 32 +++++++++++++++++++
 .../protobuf/protobuf_3.19.1.bb               |  3 ++
 2 files changed, 35 insertions(+)
 create mode 100644 
meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch

diff --git 
a/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch 
b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch
new file mode 100644
index 0000000000..8a0696edfe
--- /dev/null
+++ 
b/meta-oe/recipes-devtools/protobuf/protobuf/0001-Fix-build-on-mips-clang.patch
@@ -0,0 +1,32 @@
+From 08e46feb6553af670754e65d94c3bb6fcd4e0cf9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sun, 31 Oct 2021 23:39:44 -0700
+Subject: [PATCH] Fix build on mips/clang
+
+clang13 crashes on mips, until its fixed upstream disable tailcall on
+mips
+
+https://bugs.llvm.org/show_bug.cgi?id=52367
+
+Upstream-Status: Inappropriate [Clang workaround]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/google/protobuf/port_def.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/google/protobuf/port_def.inc 
b/src/google/protobuf/port_def.inc
+index 71325c387..303475232 100644
+--- a/src/google/protobuf/port_def.inc
++++ b/src/google/protobuf/port_def.inc
+@@ -230,7 +230,7 @@
+ #error PROTOBUF_TAILCALL was previously defined
+ #endif
+ #if __has_cpp_attribute(clang::musttail) && \
+-  !defined(__arm__) && !defined(_ARCH_PPC) && !defined(__wasm__)
++  !defined(__arm__) && !defined(_ARCH_PPC) && !defined(__wasm__) && 
!defined(__mips__)
+ #  ifndef PROTO2_OPENSOURCE
+ // Compilation fails on ARM32: b/195943306
+ // Compilation fails on powerpc64le: b/187985113
+-- 
+2.33.1
+
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_3.19.1.bb 
b/meta-oe/recipes-devtools/protobuf/protobuf_3.19.1.bb
index 9b8c396045..93daa1804e 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf_3.19.1.bb
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_3.19.1.bb
@@ -19,6 +19,9 @@ SRC_URI = 
"git://github.com/protocolbuffers/protobuf.git;branch=3.19.x \
            
file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \
            file://0001-Fix-linking-error-with-ld-gold.patch \
            "
+SRC_URI:append:mips:toolchain-clang = " 
file://0001-Fix-build-on-mips-clang.patch "
+SRC_URI:append:mipsel:toolchain-clang = " 
file://0001-Fix-build-on-mips-clang.patch "
+
 S = "${WORKDIR}/git"
 
 inherit autotools-brokensep pkgconfig ptest
-- 
2.33.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#93689): 
https://lists.openembedded.org/g/openembedded-devel/message/93689
Mute This Topic: https://lists.openembedded.org/mt/86734006/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to