File: fix_hppa_alignof_assert.patch

package info (click to toggle)
protobuf 3.25.7-1
  • links: PTS
  • area: main
  • in suites: experimental
  • size: 46,004 kB
  • sloc: cpp: 204,412; java: 88,198; ansic: 81,264; objc: 58,434; cs: 27,303; python: 22,841; php: 11,408; ruby: 8,637; pascal: 3,333; xml: 2,333; sh: 1,331; makefile: 538; lisp: 86; awk: 17
file content (32 lines) | stat: -rw-r--r-- 1,246 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Description: hppa is over aligned and fails
 Filter out hppa machines on the static_assert lines.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Forwarded: no
Last-Update: 2023-12-26

---

--- a/src/google/protobuf/descriptor.cc
+++ b/src/google/protobuf/descriptor.cc
@@ -369,7 +369,9 @@ class FlatAllocatorImpl {
     ABSL_CHECK(!has_allocated());
     if (std::is_trivially_destructible<U>::value) {
       // Trivial types are aligned to 8 bytes.
+#if !defined(__hppa__)
       static_assert(alignof(U) <= 8, "");
+#endif
       total_.template Get<char>() += RoundUpTo<8>(array_size * sizeof(U));
     } else {
       // Since we can't use `if constexpr`, just make the expression compile
--- a/src/google/protobuf/map.h
+++ b/src/google/protobuf/map.h
@@ -121,7 +121,9 @@ class MapAllocator {
   // MapAllocator does not support alignments beyond 8. Technically we should
   // support up to std::max_align_t, but this fails with ubsan and tcmalloc
   // debug allocation logic which assume 8 as default alignment.
+#if !defined(__hppa__)
   static_assert(alignof(value_type) <= 8, "");
+#endif
 
   pointer allocate(size_type n, const void* /* hint */ = nullptr) {
     // If arena is not given, malloc needs to be called which doesn't