summaryrefslogtreecommitdiff
path: root/tools/toolchain-patches
diff options
context:
space:
mode:
Diffstat (limited to 'tools/toolchain-patches')
-rw-r--r--tools/toolchain-patches/glibc-227-make44.patch (renamed from tools/toolchain-patches/glibc-225-make44.patch)102
-rw-r--r--tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff56
-rw-r--r--tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff77
3 files changed, 122 insertions, 113 deletions
diff --git a/tools/toolchain-patches/glibc-225-make44.patch b/tools/toolchain-patches/glibc-227-make44.patch
index 45d4e9c621..3de5cb0fdd 100644
--- a/tools/toolchain-patches/glibc-225-make44.patch
+++ b/tools/toolchain-patches/glibc-227-make44.patch
@@ -1,7 +1,7 @@
1diff -Naur glibc-2.25/libio/stdio.h glibc-2.25-patched/libio/stdio.h 1diff -Naur glibc-2.27/libio/stdio.h glibc-2.27-patched/libio/stdio.h
2--- glibc-2.25/libio/stdio.h 2017-02-05 10:28:43.000000000 -0500 2--- glibc-2.27/libio/stdio.h 2018-02-01 11:17:18.000000000 -0500
3+++ glibc-2.25-patched/libio/stdio.h 2023-05-23 15:22:27.482980335 -0400 3+++ glibc-2.27-patched/libio/stdio.h 2023-05-23 14:10:06.618633203 -0400
4@@ -154,18 +154,23 @@ 4@@ -118,18 +118,23 @@
5 # define P_tmpdir "/tmp" 5 # define P_tmpdir "/tmp"
6 #endif 6 #endif
7 7
@@ -32,20 +32,19 @@ diff -Naur glibc-2.25/libio/stdio.h glibc-2.25-patched/libio/stdio.h
32 32
33 /* Standard streams. */ 33 /* Standard streams. */
34 extern struct _IO_FILE *stdin; /* Standard input stream. */ 34 extern struct _IO_FILE *stdin; /* Standard input stream. */
35diff -Naur glibc-2.25/Makerules glibc-2.25-patched/Makerules 35diff -Naur glibc-2.27/Makerules glibc-2.27-patched/Makerules
36--- glibc-2.25/Makerules 2017-02-05 10:28:43.000000000 -0500 36--- glibc-2.27/Makerules 2018-02-01 11:17:18.000000000 -0500
37+++ glibc-2.25-patched/Makerules 2023-05-23 15:22:05.594967548 -0400 37+++ glibc-2.27-patched/Makerules 2023-05-23 14:10:06.617633203 -0400
38@@ -1474,55 +1474,7 @@ 38@@ -1522,46 +1522,6 @@
39 endif
40 39
41 endif 40 endif
42- 41
43-# These will have been set by sysdeps/posix/Makefile. 42-# These will have been set by sysdeps/posix/Makefile.
44-L_tmpnam ?= 1 43-L_tmpnam ?= 1
45-TMP_MAX ?= 0 44-TMP_MAX ?= 0
46-L_ctermid ?= 1 45-L_ctermid ?= 1
47-L_cuserid ?= 1 46-L_cuserid ?= 1
48 47-
49-stdio_lim = $(common-objpfx)bits/stdio_lim.h 48-stdio_lim = $(common-objpfx)bits/stdio_lim.h
50- 49-
51-$(stdio_lim:lim.h=%.h) $(stdio_lim:lim.h=%.d): $(stdio_lim:lim.h=%.st); @: 50-$(stdio_lim:lim.h=%.h) $(stdio_lim:lim.h=%.d): $(stdio_lim:lim.h=%.st); @:
@@ -53,8 +52,7 @@ diff -Naur glibc-2.25/Makerules glibc-2.25-patched/Makerules
53- $(common-objpfx)config.make 52- $(common-objpfx)config.make
54- $(make-target-directory) 53- $(make-target-directory)
55- { echo '#include "$(..)posix/bits/posix1_lim.h"'; \ 54- { echo '#include "$(..)posix/bits/posix1_lim.h"'; \
56- echo '#define _LIBC 1'; \ 55- } | \
57- echo '#include "$(..)misc/sys/uio.h"'; } | \
58- $(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)' \ 56- $(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)' \
59- $(CPPUNDEFS) $(+includes) -xc - -o $(@:st=hT) 57- $(CPPUNDEFS) $(+includes) -xc - -o $(@:st=hT)
60- sed $(sed-remove-objpfx) $(sed-remove-dotdot) \ 58- sed $(sed-remove-objpfx) $(sed-remove-dotdot) \
@@ -62,21 +60,14 @@ diff -Naur glibc-2.25/Makerules glibc-2.25-patched/Makerules
62- mv -f $(@:st=dt) $(@:st=d) 60- mv -f $(@:st=dt) $(@:st=d)
63- fopen_max=`sed -n 's/^#define OPEN_MAX //1p' $(@:st=hT)`; \ 61- fopen_max=`sed -n 's/^#define OPEN_MAX //1p' $(@:st=hT)`; \
64- filename_max=`sed -n 's/^#define PATH_MAX //1p' $(@:st=hT)`; \ 62- filename_max=`sed -n 's/^#define PATH_MAX //1p' $(@:st=hT)`; \
65- iov_max=`sed -n 's/^#define UIO_MAXIOV //p' $(@:st=hT)`; \
66- fopen_max=$${fopen_max:-16}; \ 63- fopen_max=$${fopen_max:-16}; \
67- filename_max=$${filename_max:-1024}; \ 64- filename_max=$${filename_max:-1024}; \
68- if [ -z "$$iov_max" ]; then \
69- define_iov_max="# undef IOV_MAX"; \
70- else \
71- define_iov_max="# define IOV_MAX $$iov_max"; \
72- fi; \
73- sed -e "s/@FOPEN_MAX@/$$fopen_max/" \ 65- sed -e "s/@FOPEN_MAX@/$$fopen_max/" \
74- -e "s/@FILENAME_MAX@/$$filename_max/" \ 66- -e "s/@FILENAME_MAX@/$$filename_max/" \
75- -e "s/@L_tmpnam@/$(L_tmpnam)/" \ 67- -e "s/@L_tmpnam@/$(L_tmpnam)/" \
76- -e "s/@TMP_MAX@/$(TMP_MAX)/" \ 68- -e "s/@TMP_MAX@/$(TMP_MAX)/" \
77- -e "s/@L_ctermid@/$(L_ctermid)/" \ 69- -e "s/@L_ctermid@/$(L_ctermid)/" \
78- -e "s/@L_cuserid@/$(L_cuserid)/" \ 70- -e "s/@L_cuserid@/$(L_cuserid)/" \
79- -e "s/@define_IOV_MAX@/$$define_iov_max/" \
80- $< > $(@:st=h.new) 71- $< > $(@:st=h.new)
81- $(move-if-change) $(@:st=h.new) $(@:st=h) 72- $(move-if-change) $(@:st=h.new) $(@:st=h)
82-# Remove these last so that they can be examined if something went wrong. 73-# Remove these last so that they can be examined if something went wrong.
@@ -91,9 +82,9 @@ diff -Naur glibc-2.25/Makerules glibc-2.25-patched/Makerules
91 FORCE: 82 FORCE:
92 83
93 .PHONY: echo-headers 84 .PHONY: echo-headers
94diff -Naur glibc-2.25/Rules glibc-2.25-patched/Rules 85diff -Naur glibc-2.27/Rules glibc-2.27-patched/Rules
95--- glibc-2.25/Rules 2017-02-05 10:28:43.000000000 -0500 86--- glibc-2.27/Rules 2018-02-01 11:17:18.000000000 -0500
96+++ glibc-2.25-patched/Rules 2023-05-23 15:22:27.482980335 -0400 87+++ glibc-2.27-patched/Rules 2023-05-23 14:10:06.617633203 -0400
97@@ -60,9 +60,6 @@ 88@@ -60,9 +60,6 @@
98 common-generated := 89 common-generated :=
99 endif 90 endif
@@ -104,11 +95,11 @@ diff -Naur glibc-2.25/Rules glibc-2.25-patched/Rules
104 include $(..)Makerules 95 include $(..)Makerules
105 96
106 .PHONY: subdir_lib 97 .PHONY: subdir_lib
107diff -Naur glibc-2.25/stdio-common/stdio_lim.h.in glibc-2.25-patched/stdio-common/stdio_lim.h.in 98diff -Naur glibc-2.27/stdio-common/stdio_lim.h.in glibc-2.27-patched/stdio-common/stdio_lim.h.in
108--- glibc-2.25/stdio-common/stdio_lim.h.in 2017-02-05 10:28:43.000000000 -0500 99--- glibc-2.27/stdio-common/stdio_lim.h.in 2018-02-01 11:17:18.000000000 -0500
109+++ glibc-2.25-patched/stdio-common/stdio_lim.h.in 1969-12-31 19:00:00.000000000 -0500 100+++ glibc-2.27-patched/stdio-common/stdio_lim.h.in 1969-12-31 19:00:00.000000000 -0500
110@@ -1,42 +0,0 @@ 101@@ -1,39 +0,0 @@
111-/* Copyright (C) 1994-2017 Free Software Foundation, Inc. 102-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
112- This file is part of the GNU C Library. 103- This file is part of the GNU C Library.
113- 104-
114- The GNU C Library is free software; you can redistribute it and/or 105- The GNU C Library is free software; you can redistribute it and/or
@@ -125,34 +116,31 @@ diff -Naur glibc-2.25/stdio-common/stdio_lim.h.in glibc-2.25-patched/stdio-commo
125- License along with the GNU C Library; if not, see 116- License along with the GNU C Library; if not, see
126- <http://www.gnu.org/licenses/>. */ 117- <http://www.gnu.org/licenses/>. */
127- 118-
128-#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX 119-#ifndef _BITS_STDIO_LIM_H
120-#define _BITS_STDIO_LIM_H 1
121-
122-#ifndef _STDIO_H
129-# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead." 123-# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
130-#endif 124-#endif
131- 125-
132-#ifdef _STDIO_H 126-#define L_tmpnam @L_tmpnam@
133-# define L_tmpnam @L_tmpnam@ 127-#define TMP_MAX @TMP_MAX@
134-# define TMP_MAX @TMP_MAX@ 128-#define FILENAME_MAX @FILENAME_MAX@
135-# define FILENAME_MAX @FILENAME_MAX@
136- 129-
137-# ifdef __USE_POSIX 130-#ifdef __USE_POSIX
138-# define L_ctermid @L_ctermid@ 131-# define L_ctermid @L_ctermid@
139-# if !defined __USE_XOPEN2K || defined __USE_GNU 132-# if !defined __USE_XOPEN2K || defined __USE_GNU
140-# define L_cuserid @L_cuserid@ 133-# define L_cuserid @L_cuserid@
141-# endif
142-# endif 134-# endif
143-#endif 135-#endif
144- 136-
145-#if defined __need_FOPEN_MAX || defined _STDIO_H 137-#undef FOPEN_MAX
146-# undef FOPEN_MAX 138-#define FOPEN_MAX @FOPEN_MAX@
147-# define FOPEN_MAX @FOPEN_MAX@
148-#endif
149- 139-
150-#if defined __need_IOV_MAX && !defined IOV_MAX 140-#endif /* bits/stdio_lim.h */
151-@define_IOV_MAX@ 141diff -Naur glibc-2.27/sysdeps/mach/hurd/bits/stdio_lim.h glibc-2.27-patched/sysdeps/mach/hurd/bits/stdio_lim.h
152-#endif 142--- glibc-2.27/sysdeps/mach/hurd/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500
153diff -Naur glibc-2.25/sysdeps/mach/hurd/bits/stdio_lim.h glibc-2.25-patched/sysdeps/mach/hurd/bits/stdio_lim.h 143+++ glibc-2.27-patched/sysdeps/mach/hurd/bits/stdio_lim.h 2023-05-23 14:10:06.618633203 -0400
154--- glibc-2.25/sysdeps/mach/hurd/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500
155+++ glibc-2.25-patched/sysdeps/mach/hurd/bits/stdio_lim.h 2023-05-23 15:22:27.483980336 -0400
156@@ -0,0 +1,28 @@ 144@@ -0,0 +1,28 @@
157+/* System specific stdio.h definitions. Hurd version. 145+/* System specific stdio.h definitions. Hurd version.
158+ Copyright (C) 2023 Free Software Foundation, Inc. 146+ Copyright (C) 2023 Free Software Foundation, Inc.
@@ -182,9 +170,9 @@ diff -Naur glibc-2.25/sysdeps/mach/hurd/bits/stdio_lim.h glibc-2.25-patched/sysd
182+#define FILENAME_MAX 1024 170+#define FILENAME_MAX 1024
183+ 171+
184+#endif /* bits/stdio_lim.h */ 172+#endif /* bits/stdio_lim.h */
185diff -Naur glibc-2.25/sysdeps/posix/Makefile glibc-2.25-patched/sysdeps/posix/Makefile 173diff -Naur glibc-2.27/sysdeps/posix/Makefile glibc-2.27-patched/sysdeps/posix/Makefile
186--- glibc-2.25/sysdeps/posix/Makefile 2017-02-05 10:28:43.000000000 -0500 174--- glibc-2.27/sysdeps/posix/Makefile 2018-02-01 11:17:18.000000000 -0500
187+++ glibc-2.25-patched/sysdeps/posix/Makefile 2023-05-23 15:22:27.483980336 -0400 175+++ glibc-2.27-patched/sysdeps/posix/Makefile 2023-05-23 14:10:06.618633203 -0400
188@@ -1,8 +1,3 @@ 176@@ -1,8 +1,3 @@
189-# These affect the generated bits/stdio_lim.h file. 177-# These affect the generated bits/stdio_lim.h file.
190-L_tmpnam = 20 178-L_tmpnam = 20
@@ -194,9 +182,9 @@ diff -Naur glibc-2.25/sysdeps/posix/Makefile glibc-2.25-patched/sysdeps/posix/Ma
194 182
195 ifeq ($(subdir)|$(have-thread-library),rt|no) 183 ifeq ($(subdir)|$(have-thread-library),rt|no)
196 # With NPTL, this lives in libpthread so it can be used for sem_open too. 184 # With NPTL, this lives in libpthread so it can be used for sem_open too.
197diff -Naur glibc-2.25/sysdeps/unix/sysv/linux/bits/stdio_lim.h glibc-2.25-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h 185diff -Naur glibc-2.27/sysdeps/unix/sysv/linux/bits/stdio_lim.h glibc-2.27-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h
198--- glibc-2.25/sysdeps/unix/sysv/linux/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500 186--- glibc-2.27/sysdeps/unix/sysv/linux/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500
199+++ glibc-2.25-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h 2023-05-23 15:22:27.483980336 -0400 187+++ glibc-2.27-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h 2023-05-23 14:10:06.618633203 -0400
200@@ -0,0 +1,28 @@ 188@@ -0,0 +1,28 @@
201+/* System specific stdio.h definitions. Linux version. 189+/* System specific stdio.h definitions. Linux version.
202+ Copyright (C) 2023 Free Software Foundation, Inc. 190+ Copyright (C) 2023 Free Software Foundation, Inc.
@@ -219,9 +207,9 @@ diff -Naur glibc-2.25/sysdeps/unix/sysv/linux/bits/stdio_lim.h glibc-2.25-patche
219+#ifndef _BITS_STDIO_LIM_H 207+#ifndef _BITS_STDIO_LIM_H
220+#define _BITS_STDIO_LIM_H 1 208+#define _BITS_STDIO_LIM_H 1
221+ 209+
222+//#ifndef _STDIO_H 210+#ifndef _STDIO_H
223+//# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead." 211+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
224+//#endif 212+#endif
225+ 213+
226+#define FILENAME_MAX 4096 214+#define FILENAME_MAX 4096
227+ 215+
diff --git a/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff b/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff
deleted file mode 100644
index cd98d3751c..0000000000
--- a/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff
+++ /dev/null
@@ -1,56 +0,0 @@
1diff -Naur gcc-4.9.4/gcc/config/arm/t-arm-elf gcc-4.9.4-fixed/gcc/config/arm/t-arm-elf
2--- gcc-4.9.4/gcc/config/arm/t-arm-elf 2014-01-02 17:23:26.000000000 -0500
3+++ gcc-4.9.4-fixed/gcc/config/arm/t-arm-elf 2020-07-01 22:11:01.198403110 -0400
4@@ -44,6 +44,11 @@
5 #MULTILIB_EXCEPTIONS += *mcpu=fa526/*mfloat-abi=hard*
6 #MULTILIB_EXCEPTIONS += *mcpu=fa626/*mfloat-abi=hard*
7
8+# We build a lib for each specific CPU Rockbox targets. If anyone knows a better
9+# way to do this, please let us know.
10+MULTILIB_OPTIONS += mcpu=arm7tdmi/mcpu=arm9tdmi/mcpu=arm9e/mcpu=arm926ej-s/mcpu=arm1136jf-s
11+MULTILIB_DIRNAMES += arm7tdmi arm9tdmi arm9e arm926ej-s arm1136jf-s
12+
13 # MULTILIB_OPTIONS += mcpu=ep9312
14 # MULTILIB_DIRNAMES += ep9312
15 # MULTILIB_EXCEPTIONS += *mthumb/*mcpu=ep9312*
16@@ -56,8 +61,8 @@
17 # MULTILIB_DIRNAMES += fpu soft
18 # MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
19 #
20-# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
21-# MULTILIB_DIRNAMES += normal interwork
22+MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
23+MULTILIB_DIRNAMES += normal interwork
24 #
25 # MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore
26 # MULTILIB_DIRNAMES += elf under
27diff -Naur gcc-4.9.4/libgcc/config/arm/t-bpabi gcc-4.9.4-fixed/libgcc/config/arm/t-bpabi
28--- gcc-4.9.4/libgcc/config/arm/t-bpabi 2012-08-17 11:06:06.000000000 -0400
29+++ gcc-4.9.4-fixed/libgcc/config/arm/t-bpabi 2020-07-01 22:13:39.103762818 -0400
30@@ -17,4 +17,4 @@
31 # On ARM, specifying -fnon-call-exceptions will needlessly pull in
32 # the unwinder in simple programs which use 64-bit division. Omitting
33 # the option is safe.
34-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions
35+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions -fno-non-call-exceptions
36diff -Naur gcc-4.9.4/libgcc/Makefile.in gcc-4.9.4-fixed/libgcc/Makefile.in
37--- gcc-4.9.4/libgcc/Makefile.in 2014-01-08 11:37:08.000000000 -0500
38+++ gcc-4.9.4-fixed/libgcc/Makefile.in 2020-07-01 22:11:01.199403087 -0400
39@@ -495,7 +495,7 @@
40 ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
41 # Provide default flags for compiling divmod functions, if they haven't been
42 # set already by a target-specific Makefile fragment.
43-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
44+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions -fno-non-call-exceptions
45 endif
46
47 # Build LIB2_DIVMOD_FUNCS.
48@@ -816,7 +816,7 @@
49 # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
50 # LIB2ADDEHSHARED matter. (Usually all three are identical.)
51
52-c_flags := -fexceptions
53+c_flags := -fno-exceptions
54
55 ifeq ($(enable_shared),yes)
56
diff --git a/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff b/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff
new file mode 100644
index 0000000000..b320b969a5
--- /dev/null
+++ b/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff
@@ -0,0 +1,77 @@
1diff -Naur gcc-8.5.0/gcc/config/arm/arm_cmse.h gcc-8.5.0-patched/gcc/config/arm/ar
2m_cmse.h
3--- gcc-8.5.0/gcc/config/arm/arm_cmse.h 2021-05-14 04:42:08.000000000 -0400
4+++ gcc-8.5.0-patched/gcc/config/arm/arm_cmse.h 2023-04-17 14:32:56.547477547 -0400
5@@ -35,7 +35,7 @@
6 #if __ARM_FEATURE_CMSE & 1
7
8 #include <stddef.h>
9-#include <stdint.h>
10+//#include <stdint.h>
11
12 #ifdef __ARM_BIG_ENDIAN
13
14diff -aur gcc-8.5.0/gcc/config/arm/t-arm-elf gcc-8.5.0-patched/gcc/config/arm/t-arm-elf
15--- gcc-8.5.0/gcc/config/arm/t-arm-elf 2021-05-14 04:42:08.000000000 -0400
16+++ gcc-8.5.0-patched/gcc/config/arm/t-arm-elf 2022-11-26 23:16:30.714433566 -0500
17@@ -80,6 +80,10 @@
18 MULTILIB_REQUIRED += marm/mfpu=auto/march=armv5te+fp/mfloat-abi=hard
19 MULTILIB_REQUIRED += mthumb/mfpu=auto/march=armv7+fp/mfloat-abi=hard
20
21+# And we want to be able to disable interworking
22+MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
23+MULTILIB_DIRNAMES += normal interwork
24+
25 # PART 3 - Match rules
26
27 # Map all supported FPUs onto mfpu=auto
28diff -aur gcc-8.5.0/libgcc/config/arm/t-bpabi gcc-8.5.0-patched/libgcc/config/arm/t-bpabi
29--- gcc-8.5.0/libgcc/config/arm/t-bpabi 2021-05-14 04:42:10.000000000 -0400
30+++ gcc-8.5.0-patched/libgcc/config/arm/t-bpabi 2022-11-26 23:14:40.938038440 -0500
31@@ -17,4 +17,4 @@
32 # On ARM, specifying -fnon-call-exceptions will needlessly pull in
33 # the unwinder in simple programs which use 64-bit division. Omitting
34 # the option is safe.
35-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions
36+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions -fno-non-call-exceptions
37diff -aur gcc-8.5.0/libgcc/config/arm/cmse.c gcc-8.5.0-patch/libgcc/config/arm/cmse.c
38--- gcc-8.5.0/libgcc/config/arm/cmse.c 2021-05-14 04:42:10.000000000 -0400
39+++ gcc-8.5.0-patched/libgcc/config/arm/cmse.c 2023-04-17 15:12:11.865456701 -0400
40@@ -36,7 +36,7 @@
41 char *pb = (char *) p, *pe;
42
43 /* Check if the range wraps around. */
44- if (UINTPTR_MAX - (uintptr_t) p < size)
45+ if (__UINTPTR_MAX__ - (__UINTPTR_TYPE__) p < size)
46 return NULL;
47
48 /* Check if an unknown flag is present. */
49@@ -51,7 +51,7 @@
50
51 /* Execute the right variant of the TT instructions. */
52 pe = pb + size - 1;
53- const int singleCheck = (((uintptr_t) pb ^ (uintptr_t) pe) < 32);
54+ const int singleCheck = (((__UINTPTR_TYPE__) pb ^ (__UINTPTR_TYPE__) pe) < 32);
55 switch (flags & known_secure_level)
56 {
57 case 0:
58diff -aur gcc-8.5.0/libgcc/Makefile.in gcc-8.5.0-patched/libgcc/Makefile.in
59--- gcc-8.5.0/libgcc/Makefile.in 2021-05-14 04:42:10.000000000 -0400
60+++ gcc-8.5.0-patched/libgcc/Makefile.in 2022-11-26 23:13:56.781304250 -0500
61@@ -526,7 +526,7 @@
62 ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
63 # Provide default flags for compiling divmod functions, if they haven't been
64 # set already by a target-specific Makefile fragment.
65-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
66+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions -fno-non-call-exceptions
67 endif
68
69 # Build LIB2_DIVMOD_FUNCS.
70@@ -847,7 +847,7 @@
71 # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
72 # LIB2ADDEHSHARED matter. (Usually all three are identical.)
73
74-c_flags := -fexceptions
75+c_flags := -fno-exceptions
76
77 ifeq ($(enable_shared),yes)