/
gcc-patch-000
38 lines (38 loc) · 1.82 KB
/
gcc-patch-000
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
diff -durN gcc-12.1.0/gcc/config/i386/t-x86_64-elf gcc-12.1.0.patched/gcc/config/i386/t-x86_64-elf
--- gcc-12.1.0/gcc/config/i386/t-x86_64-elf 1969-12-31 16:00:00.000000000 -0800
+++ gcc-12.1.0.patched/gcc/config/i386/t-x86_64-elf 2022-05-21 15:53:08.545055474 -0700
@@ -0,0 +1,8 @@
+# Add redzoneless libgcc
+MULTILIB_OPTIONS += mno-red-zone
+MULTILIB_DIRNAMES += no-red-zone
+
+# Build a 32bit libgcc as well
+# NOTE: disabled for now, does not seem to build properly with gcc 10
+#MULTILIB_OPTIONS += m32
+#MULTILIB_DIRNAMES += 32
diff -durN gcc-12.1.0/gcc/config/riscv/t-elf-multilib gcc-12.1.0.patched/gcc/config/riscv/t-elf-multilib
--- gcc-12.1.0/gcc/config/riscv/t-elf-multilib 2022-05-06 00:30:57.000000000 -0700
+++ gcc-12.1.0.patched/gcc/config/riscv/t-elf-multilib 2022-05-21 15:53:08.545055474 -0700
@@ -28,3 +28,11 @@
march.rv32imafc/mabi.ilp32f=march.rv32imafdc/mabi.ilp32f \
march.rv32imafc/mabi.ilp32f=march.rv32gc/mabi.ilp32f \
march.rv64imafdc/mabi.lp64d=march.rv64gc/mabi.lp64d
+
+# build variants of the 64bit libgccs with mcmodel=medany flag set
+MULTILIB_OPTIONS += mcmodel=medany
+MULTILIB_DIRNAMES += medany
+MULTILIB_REQUIRED += \
+march=rv64imac/mabi=lp64/mcmodel=medany \
+march=rv64imafdc/mabi=lp64d/mcmodel=medany
+MULTILIB_REUSE = march.rv64imafdc/mabi.lp64d/mcmodel.medany=march.rv64gc/mabi.lp64d/mcmodel.medany
diff -durN gcc-12.1.0/gcc/config.gcc gcc-12.1.0.patched/gcc/config.gcc
--- gcc-12.1.0/gcc/config.gcc 2022-05-06 00:30:56.000000000 -0700
+++ gcc-12.1.0.patched/gcc/config.gcc 2022-05-21 15:53:08.545055474 -0700
@@ -1899,6 +1899,7 @@
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
;;
x86_64-*-elf*)
+ tmake_file="${tmake_file} i386/t-x86_64-elf"
tm_file="${tm_file} i386/unix.h i386/att.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
;;
x86_64-*-rtems*)