aboutsummaryrefslogtreecommitdiff
path: root/files/aleksa-gcc-11.2.0.diff
blob: 3373721939a72a09ea7baf1ccd216f3ec42e0223 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
diff '--color=auto' -ruN ../../gcc-11.2.0/fixincludes/mkfixinc.sh ./gcc-11.2.0/fixincludes/mkfixinc.sh
--- ../../gcc-11.2.0/fixincludes/mkfixinc.sh	2021-07-28 08:55:06.644278372 +0200
+++ ./gcc-11.2.0/fixincludes/mkfixinc.sh	2022-01-11 18:37:07.379567018 +0100
@@ -11,6 +11,7 @@
 
 # Check for special fix rules for particular targets
 case $machine in
+    *-aleksa* | \
     i?86-*-cygwin* | \
     i?86-*-mingw32* | \
     x86_64-*-mingw32* | \
diff '--color=auto' -ruN ../../gcc-11.2.0/gcc/config/aleksa.h ./gcc-11.2.0/gcc/config/aleksa.h
--- ../../gcc-11.2.0/gcc/config/aleksa.h	1970-01-01 01:00:00.000000000 +0100
+++ ./gcc-11.2.0/gcc/config/aleksa.h	2022-01-11 18:31:15.382909005 +0100
@@ -0,0 +1,28 @@
+/* Useful if you wish to make target-specific GCC changes. */
+#undef TARGET_ALEKSA
+#define TARGET_ALEKSA 1
+ 
+/* Default arguments you want when running your
+   i686-aleksa-gcc/x86_64-aleksa-gcc toolchain */
+#undef LIB_SPEC
+#define LIB_SPEC "-lc" /* link against C standard library */
+ 
+/* Files that are linked before user code.
+   The %s tells GCC to look for these files in the library directory. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"
+ 
+/* Files that are linked after user code. */
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
+ 
+/* Additional predefined macros. */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()      \
+  do {                                \
+    builtin_define ("__aleksa__");    \
+    builtin_define ("__unix__");      \
+    builtin_assert ("system=aleksa"); \
+    builtin_assert ("system=unix");   \
+    builtin_assert ("system=posix");  \
+  } while(0);
diff '--color=auto' -ruN ../../gcc-11.2.0/gcc/config.gcc ./gcc-11.2.0/gcc/config.gcc
--- ../../gcc-11.2.0/gcc/config.gcc	2021-07-28 08:55:07.000283339 +0200
+++ ./gcc-11.2.0/gcc/config.gcc	2022-01-11 18:30:02.532910796 +0100
@@ -686,6 +686,12 @@
 
 # Common parts for widely ported systems.
 case ${target} in
+*-*-aleksa*)
+  gas=yes
+  gnu_ld=yes
+  default_use_cxa_atexit=yes
+  use_gcc_stdint=wrap
+  ;;
 *-*-darwin*)
   tmake_file="t-darwin "
   tm_file="${tm_file} darwin.h"
@@ -1084,6 +1090,12 @@
 esac
 
 case ${target} in
+i[34567]86-*-aleksa*)
+    tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h aleksa.h"
+    ;;
+x86_64-*-aleksa*)
+    tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h aleksa.h"
+    ;;
 aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
 	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
 	tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-elf-raw.h"
diff '--color=auto' -ruN ../../gcc-11.2.0/libgcc/config.host ./gcc-11.2.0/libgcc/config.host
--- ../../gcc-11.2.0/libgcc/config.host	2021-07-28 08:55:08.752307785 +0200
+++ ./gcc-11.2.0/libgcc/config.host	2022-01-11 18:33:33.522905613 +0100
@@ -356,6 +356,14 @@
 esac
 
 case ${host} in
+i[34567]86-*-aleksa*)
+	extra_parts="$extra_parts crti.o crtbegin.o crtend.o crtn.o"
+	tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
+	;;
+x86_64-*-aleksa*)
+	extra_parts="$extra_parts crti.o crtbegin.o crtend.o crtn.o"
+	tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
+	;;
 aarch64*-*-elf | aarch64*-*-rtems*)
 	extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o"
 	extra_parts="$extra_parts crtfastmath.o"
diff '--color=auto' -ruN ../../gcc-11.2.0/libstdc++-v3/crossconfig.m4 ./gcc-11.2.0/libstdc++-v3/crossconfig.m4
--- ../../gcc-11.2.0/libstdc++-v3/crossconfig.m4	2021-07-28 08:55:09.228314429 +0200
+++ ./gcc-11.2.0/libstdc++-v3/crossconfig.m4	2022-01-11 18:32:31.719573793 +0100
@@ -5,6 +5,12 @@
 AC_DEFUN([GLIBCXX_CROSSCONFIG],[
 # Base decisions on target environment.
 case "${host}" in
+  *-aleksa*)
+    GLIBCXX_CHECK_COMPILER_FEATURES
+    GLIBCXX_CHECK_LINKER_FEATURES
+    GLIBCXX_CHECK_MATH_SUPPORT
+    GLIBCXX_CHECK_STDLIB_SUPPORT
+    ;;
   arm*-*-symbianelf*)
     # This is a freestanding configuration; there is nothing to do here.
     ;;
diff '--color=auto' -ruN ../../gcc-11.2.0/config.sub ./gcc-11.2.0/config.sub
--- ../../gcc-11.2.0/config.sub	2021-07-28 08:55:06.620278039 +0200
+++ ./gcc-11.2.0/config.sub	2022-01-11 18:41:19.216227511 +0100
@@ -1725,7 +1725,8 @@
 	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
 	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
 	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
-	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*)
+	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* \
+	     | aleksa*)
 		;;
 	# This one is extra strict with allowed versions
 	sco3.2v2 | sco3.2v[4-9]* | sco5v6*)