File: gcc-14

package info (click to toggle)
pypy3 7.3.19%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,236 kB
  • sloc: python: 2,098,316; ansic: 540,565; sh: 21,462; asm: 14,419; cpp: 4,451; makefile: 4,209; objc: 761; xml: 530; exp: 499; javascript: 314; pascal: 244; lisp: 45; csh: 12; awk: 4
file content (50 lines) | stat: -rw-r--r-- 2,206 bytes parent folder | download | duplicates (2)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From: Stefano Rivera <stefanor@debian.org>
Date: Sat, 31 Aug 2024 12:58:23 +0200
Subject: GCC-14: Ignore -Wincompatible-pointer-types on 32-bit

Work around missing GCC-14 support for 32-builds of PyPy by suppressing
the GCC error. We hope to replace this with a real patch soon.

Bug-Upstream: https://github.com/pypy/pypy/issues/5016
---
 rpython/translator/c/genc.py           | 5 +++++
 rpython/translator/c/src/threadlocal.c | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/rpython/translator/c/genc.py b/rpython/translator/c/genc.py
index ebbf52f..3ec6db5 100644
--- a/rpython/translator/c/genc.py
+++ b/rpython/translator/c/genc.py
@@ -700,6 +700,7 @@ class SourceGenerator:
                 print('/***********************************************************/', file=fc)
 
         nextralines = 12
+        IS_32_BIT = sys.maxint == 2**31-1
         for name, nodeiter in self.splitnodesimpl('implement.c',
                                                    self.funcnodes,
                                                    nextralines, 1,
@@ -715,6 +716,10 @@ class SourceGenerator:
                     if self.database.reverse_debugger:
                         print('#include "revdb_def.h"', file=fc)
                     print(file=fc)
+                if IS_32_BIT:
+                    print('#if defined __GNUC__ && __GNUC__ >= 14', file=fc)
+                    print('#pragma GCC diagnostic warning "-Wincompatible-pointer-types"', file=fc)
+                    print('#endif', file=fc)
                 print(MARKER, file=fc)
                 for node, impl in nodeiter:
                     print('\n'.join(impl), file=fc)
diff --git a/rpython/translator/c/src/threadlocal.c b/rpython/translator/c/src/threadlocal.c
index aae978f..9e708cf 100644
--- a/rpython/translator/c/src/threadlocal.c
+++ b/rpython/translator/c/src/threadlocal.c
@@ -7,6 +7,9 @@
 #include "src/threadlocal.h"
 #include "src/thread.h"
 
+#if defined __GNUC__ && __GNUC__ >= 14
+#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
+#endif
 
 /* this is a spin-lock that must be acquired around each doubly-linked-list
    manipulation (because such manipulations can occur without the GIL) */