File: fix_hppa_alignof_assert.patch

package info (click to toggle)
protobuf 3.21.12-11
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 41,628 kB
  • sloc: cpp: 179,370; java: 87,796; objc: 60,661; ansic: 37,810; cs: 28,526; python: 22,443; php: 11,464; ruby: 6,127; sh: 3,635; makefile: 3,341; pascal: 2,354; xml: 2,317; javascript: 311; lisp: 87; awk: 17
file content (32 lines) | stat: -rw-r--r-- 1,248 bytes parent folder | download | duplicates (3)
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-04-09

---

--- a/src/google/protobuf/descriptor.cc
+++ b/src/google/protobuf/descriptor.cc
@@ -370,7 +370,9 @@ class FlatAllocatorImpl {
     GOOGLE_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