source: mainline/tools/toolchain-gcc-4.8.1-targets.patch@ 0cabd10

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 0cabd10 was 5a65d29, checked in by Vojtech Horky <vojtechhorky@…>, 12 years ago

Add HelenOS-specific toolchain patches

It is possible to build '*-helenos-*' toolchain, that is the triplet
would contain the word 'helenos' instead of 'linux' and GCC would
provide some HelenOS-specific macros.

The toolchain can be built with the toolchain.sh script, just provide
—helenos-target as a parameter.

Changes to the autotool/configuration scripts would be added later.

  • Property mode set to 100644
File size: 10.8 KB
RevLine 
[5a65d29]1diff -ud -Nrud gcc-4.8.1/config.sub gcc-4.8.1/config.sub
2--- gcc-4.8.1/config.sub 2013-01-11 14:02:58.000000000 +0100
3+++ gcc-4.8.1/config.sub 2013-07-12 09:10:19.136870930 +0200
4@@ -1369,6 +1369,7 @@
5 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
6 | -chorusos* | -chorusrdb* | -cegcc* \
7 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
8+ | -helenos \
9 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
10 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
11 | -uxpv* | -beos* | -mpeix* | -udk* \
12diff -ud -Nrud gcc-4.8.1/gcc/config.gcc gcc-4.8.1/gcc/config.gcc
13--- gcc-4.8.1/gcc/config.gcc 2013-03-13 10:47:41.000000000 +0100
14+++ gcc-4.8.1/gcc/config.gcc 2013-07-12 13:20:08.321208280 +0200
15@@ -624,7 +624,7 @@
16 # need_64bit_hwint=yes # system compiler has this for all arch!
17 use_gcc_stdint=wrap
18 ;;
19-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
20+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-helenos*)
21 extra_options="$extra_options gnu-user.opt"
22 gas=yes
23 gnu_ld=yes
24@@ -642,7 +642,7 @@
25 # glibc / uclibc / bionic switch.
26 # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
27 case $target in
28- *linux*)
29+ *linux* | *helenos*)
30 extra_options="$extra_options linux.opt";;
31 esac
32 case $target in
33@@ -663,7 +663,7 @@
34 use_gcc_stdint=wrap
35 # Add Android userspace support to Linux targets.
36 case $target in
37- *linux*)
38+ *linux* | *helenos*)
39 tm_file="$tm_file linux-android.h"
40 extra_options="$extra_options linux-android.opt"
41 ;;
42@@ -681,6 +681,10 @@
43 cxx_target_objs="${cxx_target_objs} glibc-c.o"
44 tmake_file="${tmake_file} t-glibc"
45 target_has_targetcm=yes
46+ # HelenOS
47+ case $target in
48+ *-helenos*) tm_file="$tm_file helenos.h" ;;
49+ esac
50 ;;
51 *-*-netbsd*)
52 tmake_file="t-slibgcc"
53@@ -868,7 +872,7 @@
54 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
55 tmake_file="${tmake_file} arm/t-arm"
56 ;;
57-arm*-*-linux-*) # ARM GNU/Linux with ELF
58+arm*-*-linux-* | arm*-helenos-*) # ARM GNU/Linux with ELF
59 tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
60 case $target in
61 arm*b-*-linux*)
62@@ -890,6 +894,12 @@
63 # The EABI requires the use of __cxa_atexit.
64 default_use_cxa_atexit=yes
65 with_tls=${with_tls:-gnu}
66+ # HelenOS
67+ # (Strangely, tm_file ignores the defaults loaded previously and
68+ # we need to add helenos.h one more time.)
69+ case $target in
70+ *-helenos*) tm_file="$tm_file helenos.h arm/helenos-arm32.h arm/helenos.h" ;;
71+ esac
72 ;;
73 arm*-*-uclinux*eabi*) # ARM ucLinux
74 tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
75@@ -1257,12 +1267,12 @@
76 gas=yes
77 gnu_ld=yes
78 ;;
79-i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
80+i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu | i[34567]86-*-helenos)
81 # Intel 80386's running GNU/*
82 # with ELF format using glibc 2
83 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h"
84 case ${target} in
85- i[34567]86-*-linux*)
86+ i[34567]86-*-linux* | i[34567]86-*-helenos)
87 tm_file="${tm_file} linux.h"
88 # Assume modern glibc
89 default_gnu_indirect_function=yes
90@@ -1318,12 +1328,16 @@
91 tm_file="$tm_file i386/gnu-user-common.h i386/gnu-user.h gnu.h i386/gnu.h"
92 ;;
93 esac
94+ # HelenOS
95+ case $target in
96+ *-helenos*) tm_file="$tm_file i386/helenos-ia32.h i386/helenos.h" ;;
97+ esac
98 ;;
99-x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
100+x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu | x86_64-*-helenos)
101 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
102 i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h"
103 case ${target} in
104- x86_64-*-linux*)
105+ x86_64-*-linux* | x86_64-*-helenos)
106 tm_file="${tm_file} linux.h i386/linux-common.h i386/linux64.h"
107 # Assume modern glibc
108 default_gnu_indirect_function=yes
109@@ -1359,6 +1373,10 @@
110 esac
111 done
112 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
113+ # HelenOS
114+ case $target in
115+ *-helenos*) tm_file="$tm_file i386/helenos-amd64.h i386/helenos.h" ;;
116+ esac
117 ;;
118 i[34567]86-pc-msdosdjgpp*)
119 xm_file=i386/xm-djgpp.h
120@@ -1567,10 +1585,14 @@
121 target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
122 tmake_file="${tmake_file} ia64/t-ia64"
123 ;;
124-ia64*-*-linux*)
125+ia64*-*-linux* | ia64-*-helenos)
126 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
127 tmake_file="${tmake_file} ia64/t-ia64 ia64/t-linux t-libunwind"
128 target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
129+ # HelenOS
130+ case $target in
131+ *-helenos*) tm_file="$tm_file ia64/helenos-ia64.h ia64/helenos.h" ;;
132+ esac
133 ;;
134 ia64*-*-hpux*)
135 tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/hpux.h"
136@@ -1794,7 +1816,7 @@
137 gas=yes
138 test x$with_llsc != x || with_llsc=yes
139 ;;
140-mips64*-*-linux* | mipsisa64*-*-linux*)
141+mips64*-*-linux* | mipsisa64*-*-linux* | mips64*-*-helenos)
142 tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h"
143 tmake_file="${tmake_file} mips/t-linux64"
144 tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
145@@ -1814,8 +1836,12 @@
146 gnu_ld=yes
147 gas=yes
148 test x$with_llsc != x || with_llsc=yes
149+ # HelenOS
150+ case $target in
151+ *-helenos*) tm_file="$tm_file mips/helenos-mips64el.h mips/helenos.h" ;;
152+ esac
153 ;;
154-mips*-*-linux*) # Linux MIPS, either endian.
155+mips*-*-linux* | mips*-*-helenos) # Linux MIPS, either endian.
156 tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h"
157 if test x$enable_targets = xall; then
158 tm_file="${tm_file} mips/gnu-user64.h mips/linux64.h"
159@@ -1830,6 +1856,11 @@
160 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
161 esac
162 test x$with_llsc != x || with_llsc=yes
163+ # HelenOS
164+ case $target in
165+ mipsel-*-helenos*) tm_file="$tm_file mips/helenos-mips32el.h mips/helenos.h" ;;
166+ mips-*-helenos*) tm_file="$tm_file mips/helenos-mips32eb.h mips/helenos.h" ;;
167+ esac
168 ;;
169 mips*-mti-elf*)
170 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h mips/mti-elf.h"
171@@ -2066,7 +2097,7 @@
172 extra_options="${extra_options} rs6000/sysv4.opt"
173 tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"
174 ;;
175-powerpc-*-linux* | powerpc64-*-linux*)
176+powerpc-*-linux* | powerpc64-*-linux* | powerpc*-*-helenos)
177 tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
178 extra_options="${extra_options} rs6000/sysv4.opt"
179 tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
180@@ -2079,7 +2110,7 @@
181 powerpc-*-linux*spe* | powerpc-*-linux*paired*)
182 maybe_biarch=
183 ;;
184- powerpc64-*-linux*)
185+ powerpc64-*-linux* | powerpc64-*-helenos)
186 test x$with_cpu != x || cpu_is_64bit=yes
187 maybe_biarch=always
188 ;;
189@@ -2112,6 +2143,11 @@
190 if test x${enable_secureplt} = xyes; then
191 tm_file="rs6000/secureplt.h ${tm_file}"
192 fi
193+ # HelenOS
194+ case $target in
195+ powerpc-*-helenos*) tm_file="$tm_file rs6000/helenos-ppc32.h rs6000/helenos.h" ;;
196+ powerpc64-*-helenos*) tm_file="$tm_file rs6000/helenos-ppc64.h rs6000/helenos64.h" ;;
197+ esac
198 ;;
199 powerpc-wrs-vxworks|powerpc-wrs-vxworksae)
200 tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h"
201@@ -2496,10 +2532,14 @@
202 extra_options="${extra_options}"
203 tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64 t-rtems"
204 ;;
205-sparc64-*-linux*)
206+sparc64-*-linux* | sparc64-*-helenos)
207 tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h sparc/tso.h"
208 extra_options="${extra_options} sparc/long-double-switch.opt"
209 tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
210+ # HelenOS
211+ case $target in
212+ *-helenos*) tm_file="$tm_file sparc/helenos-sparc64.h sparc/helenos64.h" ;;
213+ esac
214 ;;
215 sparc64-*-freebsd*|ultrasparc-*-freebsd*)
216 tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
217diff -ud -Nrud gcc-4.8.1/libgcc/config.host gcc-4.8.1/libgcc/config.host
218--- gcc-4.8.1/libgcc/config.host 2013-02-04 20:06:20.000000000 +0100
219+++ gcc-4.8.1/libgcc/config.host 2013-07-12 09:10:20.120208557 +0200
220@@ -195,7 +195,7 @@
221 ;;
222 esac
223 ;;
224-*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
225+*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-helenos)
226 tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
227 extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
228 ;;
229@@ -322,7 +322,7 @@
230 arm*-*-netbsdelf*)
231 tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
232 ;;
233-arm*-*-linux*) # ARM GNU/Linux with ELF
234+arm*-*-linux* | arm*-helenos-gnueabi) # ARM GNU/Linux with ELF
235 tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix"
236 tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
237 tm_file="$tm_file arm/bpabi-lib.h"
238@@ -518,7 +518,7 @@
239 ;;
240 x86_64-*-openbsd*)
241 ;;
242-i[34567]86-*-linux*)
243+i[34567]86-*-linux* | i[34567]86-*-helenos)
244 extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
245 tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
246 md_unwind_header=i386/linux-unwind.h
247@@ -527,7 +527,7 @@
248 extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
249 tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
250 ;;
251-x86_64-*-linux*)
252+x86_64-*-linux* | x86_64-*-helenos)
253 extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
254 tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
255 md_unwind_header=i386/linux-unwind.h
256@@ -631,7 +631,7 @@
257 extra_parts="$extra_parts crtfastmath.o"
258 tmake_file="$tmake_file ia64/t-ia64 ia64/t-ia64-elf ia64/t-eh-ia64 t-crtfm"
259 ;;
260-ia64*-*-linux*)
261+ia64*-*-linux* | ia64-*-helenos)
262 # Don't use crtbeginT.o from *-*-linux* default.
263 extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
264 tmake_file="$tmake_file ia64/t-ia64 ia64/t-ia64-elf t-crtfm t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat ia64/t-eh-ia64 t-libunwind ia64/t-linux"
265@@ -1038,7 +1038,7 @@
266 tmake_file="$tmake_file t-crtfm"
267 extra_parts="$extra_parts crtfastmath.o"
268 ;;
269-sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
270+sparc64-*-linux* | sparc64-*-helenos) # 64-bit SPARC's running GNU/Linux
271 extra_parts="$extra_parts crtfastmath.o"
272 tmake_file="${tmake_file} t-crtfm sparc/t-linux"
273 if test "${host_address}" = 64; then
Note: See TracBrowser for help on using the repository browser.