aboutsummaryrefslogtreecommitdiff
blob: ddfb6527c310dc5bf1cd46b1be5b74d38375cb38 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From b750323260c1ceb47c64e98ddab7095696b00a6d Mon Sep 17 00:00:00 2001
Message-ID: <b750323260c1ceb47c64e98ddab7095696b00a6d.1731921825.git.sam@gentoo.org>
From: Sam James <sam@gentoo.org>
Date: Mon, 18 Nov 2024 09:22:33 +0000
Subject: [PATCH] libgcc: fix C23 issues

This includes Jeff's patch from https://inbox.sourceware.org/gcc-patches/9cb69002-9754-476a-a525-68dcca9c23d8@gmail.com/.

Bug: https://gcc.gnu.org/PR117628
--- a/libgcc/config/arm/linux-atomic-64bit.c
+++ b/libgcc/config/arm/linux-atomic-64bit.c
@@ -141,9 +141,7 @@ __sync_val_compare_and_swap_8 (long long *ptr, long long oldval,
     }
 }
 
-typedef unsigned char bool;
-
-bool HIDDEN
+unsigned char HIDDEN
 __sync_bool_compare_and_swap_8 (long long *ptr, long long oldval,
 				 long long newval)
 {
--- a/libgcc/config/arm/linux-atomic.c
+++ b/libgcc/config/arm/linux-atomic.c
@@ -249,9 +249,7 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
 SUBWORD_VAL_CAS (short,       2)
 SUBWORD_VAL_CAS (signed char, 1)
 
-typedef unsigned char bool;
-
-bool HIDDEN
+unsigned char HIDDEN
 __sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval)
 {
   int failure = __kernel_cmpxchg (oldval, newval, ptr);
@@ -259,7 +257,7 @@ __sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval)
 }
 
 #define SUBWORD_BOOL_CAS(TYPE, WIDTH)					\
-  bool HIDDEN								\
+  unsigned char HIDDEN								\
   __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval,		\
 					TYPE newval)			\
   {									\
--- a/libgcc/config/csky/linux-atomic.c
+++ b/libgcc/config/csky/linux-atomic.c
@@ -215,8 +215,6 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval)
 SUBWORD_VAL_CAS (unsigned short, 2)
 SUBWORD_VAL_CAS (unsigned char,	1)
 
-typedef unsigned char bool;
-
 bool HIDDEN
 __sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval)
 {
--- a/libgcc/unwind-arm-common.inc
+++ b/libgcc/unwind-arm-common.inc
@@ -52,8 +52,6 @@
 
 /* Definitions for C++ runtime support routines.  We make these weak
    declarations to avoid pulling in libsupc++ unnecessarily.  */
-typedef unsigned char bool;
-
 typedef struct _ZSt9type_info type_info; /* This names C++ type_info type */
 enum __cxa_type_match_result
   {

base-commit: 45a3277149d95a51cf9109cab87ee39a7dce73e2
-- 
2.47.0